Kagura AI Agent State API

Agent Memory Substrate (epic #885): per-context key→value scratch state lane with optional TTL. Structurally excluded from recall(). REST companion to the set_state / get_state MCP tools.

GitHub OpenAPI

Operations 4

PUT /api/v1/contexts/{context_id}/state/{key} Set Agent State #
GET /api/v1/contexts/{context_id}/state/{key} Get Agent State #
DELETE /api/v1/contexts/{context_id}/state/{key} Delete Agent State #
GET /api/v1/contexts/{context_id}/state List Agent State #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/kagura-ai-com:kagura-ai-com-agent-state-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

kagura-ai-com-agent-state-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Kagura Memory Cloud Agent State API
  description: Universal AI Memory Platform - Remote MCP Server + Web Management
  version: 0.158.1
tags:
- name: agent-state
  description: 'Agent Memory Substrate (epic #885): per-context key→value scratch state lane with optional TTL. Structurally excluded from recall(). REST companion to the set_state / get_state MCP tools.'
paths:
  /api/v1/contexts/{context_id}/state/{key}:
    put:
      tags:
      - agent-state
      summary: Set Agent State
      description: Upsert ``value`` at ``(context_id, key)`` (PUT = idempotent, 200 on replace).
      operationId: set_agent_state_api_v1_contexts__context_id__state__key__put
      parameters:
      - name: context_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Context Id
      - name: key
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 255
          title: Key
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentStateSetRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStateKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - agent-state
      summary: Get Agent State
      description: Read one key's live value. 404 when absent or expired.
      operationId: get_agent_state_api_v1_contexts__context_id__state__key__get
      parameters:
      - name: context_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Context Id
      - name: key
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 255
          title: Key
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStateValueResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - agent-state
      summary: Delete Agent State
      description: Delete ``(context_id, key)``. 404 when the key was not present.
      operationId: delete_agent_state_api_v1_contexts__context_id__state__key__delete
      parameters:
      - name: context_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Context Id
      - name: key
        in: path
        required: true
        schema:
          type: string
          minLength: 1
          maxLength: 255
          title: Key
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStateKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/contexts/{context_id}/state:
    get:
      tags:
      - agent-state
      summary: List Agent State
      description: List all live ``key → value`` entries for the context (200, empty = {}).
      operationId: list_agent_state_api_v1_contexts__context_id__state_get
      parameters:
      - name: context_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Context Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStateListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentStateListResponse:
      properties:
        states:
          additionalProperties: true
          type: object
          title: States
        count:
          type: integer
          title: Count
      type: object
      required:
      - states
      - count
      title: AgentStateListResponse
      description: Envelope for listing all live entries in a context.
    AgentStateKeyResponse:
      properties:
        key:
          type: string
          title: Key
      type: object
      required:
      - key
      title: AgentStateKeyResponse
      description: Envelope for a write that returns just the affected key (set / delete).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentStateValueResponse:
      properties:
        key:
          type: string
          title: Key
        value:
          title: Value
      type: object
      required:
      - key
      - value
      title: AgentStateValueResponse
      description: Envelope for a single-key read.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    AgentStateSetRequest:
      properties:
        value:
          title: Value
          description: Arbitrary JSON value to store (must not be null)
        ttl_seconds:
          anyOf:
          - type: integer
            exclusiveMinimum: 0.0
          - type: 'null'
          title: Ttl Seconds
          description: Optional TTL in seconds (clamped server-side to 30 days). Omit to persist until explicitly deleted.
      type: object
      required:
      - value
      title: AgentStateSetRequest
      description: 'Body for upserting an agent-state entry.


        ``value`` is arbitrary JSON (stored in the JSONB column) but must not be

        null — the column is NOT NULL, and a null value is rejected up front as a

        422 rather than surfacing as a DB-layer 500.'