---
title: "Verify key binding"
method: POST
path: "/agents/{agent_id}/verify-binding"
tags: ["Agents"]
---

# Verify key binding

`POST /agents/{agent_id}/verify-binding`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/agents/{agent_id}/verify-binding`
- Auth: one of:
  - none
  - HTTP bearer
  - API key in header `X-Mnemom-Api-Key`

Checks whether a given API key hash matches the key currently bound to this agent. The raw key is hashed client-side — only the hash is transmitted.

**Named agents**: hash as `SHA256(key + '|' + agentName)` before submitting.

**Public anti-impersonation check (anon-allowed).** A relying party that holds an agent's id + key can confirm the binding without being a member of the agent's org. Anonymous / cross-org callers receive **only** `bound` (the boolean leaks nothing they didn't already supply). `key_prefix` is returned **only** to callers who are members of the agent's org.

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `key_hash` string, required: First 16 hex chars of SHA256(apiKey) or SHA256(apiKey + '|' + agentName) for named agents.

## Response `200`

Binding check result.

- object
  - `bound` boolean, required: True if the submitted hash matches the registered key.
  - `caller` 'anonymous' | 'authenticated' | 'org_member', required: Self-describing caller context. `key_prefix` is present iff `caller` is `org_member`; `anonymous` and `authenticated` (non-member) callers receive `{ bound, caller }` only. This is BY DESIGN, not a partial or leaky response — read `caller` instead of treating an absent `key_prefix` as a leak. The boolean `bound` is an anti-impersonation confirmation that reveals nothing the caller did not already supply.
  - `key_prefix` string, nullable: First 16 chars of the registered key (or null if not yet captured). Returned ONLY to callers who are members of the agent's org (`caller` === `org_member`); omitted for anonymous / cross-org callers.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
