Re-bind agent to a new API key
Updates the agent's key binding to a new provider API key hash. The agent ID, traces, alignment card, integrity score, and trust edges are fully preserved.
Security model: Your API key is hashed on your device (SHA-256) before transmission — the raw key is never sent to Mnemom servers.
Named agents: If this agent was registered with a name (via x-mnemom-agent), hash the new key as SHA256(newKey + '|' + agentName) before submitting.
Conflict: If the new key was already used and auto-created a new agent, the endpoint returns 409 with the conflicting agent ID.
Authorization: agent_id is resolved to its governing organization from the DB and the caller must be an owner, admin or member of that org. An agent in another org, or an unknown agent, returns 403 before the body is read, so no one can rebind another tenant's agent to a key they control. Possession of the old key is deliberately not required: rekey is the recovery path for a lost or compromised key, and the org-membership check is what gates it.
Request
- Base URL: https://api.mnemom.ai/v1
- URL: https://api.mnemom.ai/v1/agents/{agent_id}/rekey
- Auth: one of:
- HTTP bearer
- API key in header X-Mnemom-Api-Key
Path parameters
Agent identifier (e.g. smolt-abc123)
Request body
Example request
{
"new_key_hash": "a3f8c1d9e7b2045f",
"key_prefix": "sk-ant-api03-xx"
}Response
Agent successfully re-bound to the new key.
Example response
{
"success": true,
"agent_id": "smolt-a1b2c3d4"
}Changes
No recorded changes to this operation across all 1 revision of this API.