api-keys

Set or clear the key's MCP default context (#2129).

The only field this route changes. A context-scoped MCP tool called with this key and without context_id runs in the default (?context= on the URL wins). The context must be readable by the key's owner now, within the key's workspace scope; otherwise 404 Context not found (the same answer for a context that does not exist). Public-bound and agent-bound keys cannot carry one (422): an agent key's default is its agent's default binding.

Raises: NotFoundException: The key is not the caller's, or the context is not readable (404). BadRequestError: The key is revoked (400). ValidationError: The key is public-bound, agent-bound or a connector's shared key (422).

patch/api/v1/config/api-keys/{key_id}

Request

  • Base URL: https://memory.kagura-ai.com (the document declares no server; this is the origin it was published from)
  • URL: https://memory.kagura-ai.com/api/v1/config/api-keys/{key_id}
  • Auth: none declared

Path parameters

key_idstring required

Public id of the API key (akey_ + 22 base62 characters).

Example:akey_0000000000000000000000

Headers

authorizationstring nullable

Request body

default_context_idstring uuid nullable required

The key's MCP default context; null clears it.

Response

Successful Response

idunknown required
key_prefixunknown required
nameunknown required
user_idunknown required
created_atunknown required
last_used_atunknown
revoked_atunknown
expires_atunknown
statusunknown required
default_context_idunknown
default_context_nameunknown

Changes