Skip to main content
POST
/
agents
/
{agent_id}
/
rekey
Re-bind agent to a new API key
curl --request POST \
  --url https://api.mnemom.ai/v1/agents/{agent_id}/rekey \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "new_key_hash": "a3f8c1d9e7b2045f",
  "key_prefix": "sk-ant-api03-xx"
}
'
{
  "success": true,
  "agent_id": "smolt-a1b2c3d4",
  "rekeyed_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Supabase JWT token in Authorization: Bearer header

Path Parameters

agent_id
string
required

Agent identifier (e.g. smolt-abc123)

Body

application/json
new_key_hash
string
required

First 16 hex characters of SHA256(newApiKey) for unnamed agents, or SHA256(newApiKey + '|' + agentName) for named agents. Compute client-side — do not transmit the raw key.

Pattern: ^[0-9a-f]{16}$
Example:

"a3f8c1d9e7b2045f"

key_prefix
string

First 16 characters of the new provider API key. Stored for display — not sensitive. If provided, returned in the response.

Example:

"sk-ant-api03-xx"

Response

Agent successfully re-bound to the new key.

success
boolean
Example:

true

agent_id
string
Example:

"smolt-a1b2c3d4"

rekeyed_at
string<date-time>