> For the complete documentation index, see [llms.txt](https://docs.metamynd.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metamynd.ai/agent-controls-agentsafe/api-endpoints.md). Agents can also search and read this documentation through its [MCP server](https://docs.metamynd.ai/~gitbook/mcp).

# API Endpoints

Reference for the MetaMynd REST API under /api/v1: authorize, holds, mandates, DIDs, policy bundles and the other routes an integration uses.

## API Endpoints <a href="#user-content-api-endpoints" id="user-content-api-endpoints"></a>

Every route below is live, mounted under the base path `/api/v1` (for the hosted platform, `https://metamynd.ai/api/v1`). The MAGP protocol surface lives in `/policy/*`, `/did/*` and `/magp/*`, plus `/standards/atoms`; the later sections list the other routes a developer integrating an agent or a service actually calls.

**Who may call what**

| Auth              | What it means                                                                                                                                                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **public**        | No session and no API key. Where a signature is required, it is noted.                                                                                                                                              |
| **signed agent**  | Public route whose credential is the agent's own Ed25519 signature over the request (see <a href="https://docs.metamynd.ai/agent-protocol/request-signing-and-message-format" target="_blank">Request Signing</a>). |
| **claimer**       | The service that claimed the hold: its `MAGP-SERVICE-v1` signature (`x-magp-service-*` headers), or — for an anonymous claim — the `claimToken` that claim returned.                                                |
| **owner session** | A signed-in dashboard user; the route is owner-scoped (you only see or change your own agents, mandates and holds — anything else reads as not found).                                                              |
| **approver**      | An owner session that also meets the escalation's approver requirements (role, authority level).                                                                                                                    |
| **session**       | Any signed-in user, acting on their own account or data.                                                                                                                                                            |
| **admin**         | A platform operator session.                                                                                                                                                                                        |
| **gateway token** | A secret held only by a trusted gateway process, never by the agent.                                                                                                                                                |

**`/policy/*` — the gate, mandates and delegation**

| Method + path                                 | Auth                      | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /policy/mandate/authorize`              | **public** · signed agent | The gate — see <a href="https://docs.metamynd.ai/agent-protocol/the-authorize-gate-16-ordered-checks" target="_blank">The Authorize Gate</a>. A permit for a value-bearing action creates a hold.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `POST /policy/decisions/local`                | **public** · signed agent | A local-first guard reports its own offline verdict, for audit visibility only: no hold, no spend check, no evidence anchoring.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /policy/mandate/:ref/status`             | **public**                | Mandate status (active / expired / revoked, remaining budget) including the principal's verification status, and `allowedJurisdictions` (`null` = no restriction).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /policy/mandate`                        | owner session             | Issue a mandate (a policy bound to an agent, issued as a VC). Permissions may carry `riskTier` (`low`/`medium`/`high`/`critical`, a risk floor the agent cannot lower) and `requirePayloadBinding`. Optional `allowedJurisdictions` (ISO 3166-1 alpha-2; `EU` expands to the member states; malformed or empty = `400 MALFORMED_REQUEST`) restricts where the action may be performed — see <a href="https://docs.metamynd.ai/guides/restrict-jurisdictions" target="_blank">Restrict Jurisdictions</a>. Optional `expiresAt` (ISO 8601 date-time) sets when the mandate lapses; a value that is not a date-time is a `400`.                                                                         |
| `POST /policy/mandate/:policyId/delegate`     | owner session             | Agent-to-agent delegation — narrow authority onto a worker agent. A widening is refused (`CONSTRAINT_WIDENED` / `CONSTRAINT_DROPPED`). A child with no `allowedJurisdictions` inherits the parent's list; a stated one must be a subset.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `GET /policy/mandate/:policyId/chain`         | owner session             | The delegation chain back to the principal.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `POST /policy/mandate/:policyId/revoke-chain` | owner session             | Revoke a mandate and everything delegated below it, each exactly as a direct revoke (unclaimed holds released, claimed ones left to settle). `{ reason? }`; answers `{ revoked, voidedHolds, claimedHoldsLeft, closedReviews }`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `GET /policy/mandate/:policyId/events`        | owner session             | Per-mandate request history (amount, currency, merchant, risk level per authorize or refusal).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `POST /policy/mandate/:ref/revoke`            | owner session / admin     | Revoke a mandate **and every mandate delegated from it**. Releases every hold nobody has claimed; a **claimed** hold is left in place to settle or reconcile, its budget still committed. Counts cover the cascade: `revokedMandates`, `voidedHolds`, `claimedHoldsLeft`, `closedReviews`.                                                                                                                                                                                                                                                                                                                                                                                                           |
| `GET /policy/agents/:ref/payload-binding`     | owner session             | How many of the agent's active mandates require payload binding.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `POST /policy/agents/:ref/payload-binding`    | owner session             | `{ "required": true \| false }` — the owner's "require payload binding" switch. Reissues the agent's active mandates; answers **409** and changes nothing while any hold is outstanding.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `GET /policy/agents/:ref/mandate-limits`      | owner session             | The agent's current per-transaction cap, total budget, currency and approved merchants, plus `sopLimits`: the SOP spend rules bound to it, each with `lowerThanMandate` when it refuses below the mandate's own limit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `POST /policy/agents/:ref/mandate-limits`     | owner session             | `{ "perTxnMax"?, "maxAmount"?, "merchants"? }` — change a deployed agent's limits. Reissues its active mandates (spend carries over; unclaimed holds are voided with evidence; mandates delegated from it are revoked); **409** while a gateway has claimed a hold under it, or when it would widen a delegated mandate past its delegator; **400** for a per-transaction cap above the total budget or a mandate that moves no money.                                                                                                                                                                                                                                                               |
| `GET /policy/agents/:ref/mandate-expiry`      | owner session / admin     | When the agent's mandate ends (`expiresAt`, `null` = never), `delegatorExpiresAt` (the latest a delegated mandate may run to) and `delegatedChildren` (the live mandates delegated from it that a change would revoke).                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `POST /policy/agents/:ref/mandate-expiry`     | owner session / admin     | `{ "expiresAt": "<ISO date-time>" \| null }` — shorten, extend or remove (`null`) the end date. Reissues the active mandate (spend carries over; unclaimed holds are voided with evidence; mandates delegated from it are revoked and listed in `revokedDelegated`). **400** `EXPIRY_INVALID` (not a date-time, or not in the future); **409** while a gateway has claimed a hold under it, when the agent's mandates have different expiries, or with `data.reasonCode: "EXPIRY_EXCEEDS_DELEGATOR"` when a delegated mandate would outlast its delegator. See <a href="https://docs.metamynd.ai/core-concepts/mandates-and-delegated-authority" target="_blank">Mandates & Delegated Authority</a>. |

**`/policy/*` — holds, claims and settlement**

Full lifecycle and examples: <a href="https://docs.metamynd.ai/agent-protocol/settlement-and-settlement-evidence" target="_blank">Settlement & Settlement Evidence</a>. Codes: <a href="https://docs.metamynd.ai/agent-protocol/reason-code-registry#settlement-surface-codes" target="_blank">Reason Code Registry → Settlement-surface codes</a>.

| Method + path                                                   | Auth                                                | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /policy/mandate/authorize/:authId/effect/dispatching`     | **public** · signed service, or anonymous           | **The claim.** Atomic and single-use: exactly one claimant wins; every other claim gets `409 AUTHORIZATION_ALREADY_CLAIMED`. Optional `Idempotency-Key` header (32–128 chars, must not contain the authorization id) makes a lost-response retry safe (`replayed: true`). `x-magp-payload-digest` states what will run and is compared with the digest stored at authorize. Body `{ "x402": true }` marks the hold x402-bound. An anonymous claim returns `data.claimToken`. On mainnet the claimer must be in the owner's trusted-counterparty registry.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `POST /policy/mandate/authorize/:authId/effect/dispatched`      | **public** · signed service optional                | The connector accepted the call; optional `remoteRef`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `POST /policy/mandate/authorize/:authId/capture`                | **public**                                          | Settle the hold. Body `{ amountCharged, bookingRef?, settlementTxHash?, claimToken?, payTo? }`. Settling at the full authorized amount needs nothing. Settling **below** it on a claimed hold needs the claimer, and is checked against the payee directory and — for x402-bound holds — the settlement observer. A **refused** capture has the same body as a refused void or refund — the bare code as `message` and `data: { captured: false, authorizationId, reasonCode, detail }` — HTTP **409** `HOLD_UNDER_RECONCILIATION` · `EFFECT_NOT_CAPTURABLE` (the effect is `unknown`: reconcile it) · `NOT_HELD` (already settled or released) · `AUTHORIZATION_EXPIRED` · `HOLD_STATE_CHANGED` (lost a race; nothing captured), **403** `COUNTERPARTY_MISMATCH` (a lower amount from someone who is not the claimer), **400** `AMOUNT_EXCEEDS_AUTHORIZED` · `AMOUNT_INVALID` · `SETTLEMENT_NOT_CONFIRMED` · `SETTLEMENT_AMOUNT_MISMATCH` · `SETTLEMENT_NOT_FOUND` · `PAYEE_NOT_REGISTERED` · `PAYEE_NOT_VERIFIED` · `PASSPORT_EXPIRED` · `PASSPORT_ALREADY_CONSUMED` · `PASSPORT_REVOKED` (a counterparty capture only — reconciliation is never refused on the passport) · `MALFORMED_REQUEST`. A repeat capture answers `409 NOT_HELD`: read `GET …/effect` before retrying. |
| `POST /policy/mandate/authorize/:authId/void`                   | **public**                                          | Release a hold. Body `{ reason?, claimToken? }`. A claimed hold can be released only by its claimer (and, for an x402-bound hold, only if the observer affirms nothing settled). A **refused** void carries the bare code as `message` and `data: { voided: false, authorizationId, reasonCode, detail }`: HTTP **409** for `HOLD_UNDER_RECONCILIATION`, `CLAIMED` or `EFFECT_NOT_VOIDABLE` (the effect is `dispatched` or `unknown` — reconcile it), **403** `COUNTERPARTY_MISMATCH` (claimed, and you are not the claimer), **400** `SETTLEMENT_NOT_CONFIRMED` (the observer did not affirm nothing settled); `NOT_HELD` (already settled or released) stays `200 { voided: false }`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `POST /policy/mandate/authorize/:authId/refund`                 | **public** · claimer, owner or admin                | Record-only reversal of a captured hold. Body `{ amount?, reason?, claimToken? }` (omit `amount` for the full remaining amount). Only the hold's **claimer** — signed under its own action `refund` over `amount` (empty for a full refund) and `reason`, or an anonymous claimer's `claimToken` — the hold's owner or an admin may refund; anyone else gets **403** `COUNTERPARTY_MISMATCH` (`data: { refunded: false, authorizationId, reasonCode, detail }`). A hold captured without a claim: owner or admin only. Other refusals, same body: **409** `NOT_CAPTURED` · `ALREADY_REFUNDED` · `HOLD_STATE_CHANGED`; **400** `AMOUNT_EXCEEDS_REFUNDABLE` · `MALFORMED_REQUEST`. MetaMynd moves no money; the cap counts less.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /policy/mandate/authorize/:authId/payload-binding`        | **public** · signed agent                           | Late payload binding for a hold with no digest (after a reviewer's MODIFY).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /policy/mandate/authorize/:authId/effect`                  | **public**                                          | **The outcome lookup:** `outcome`, `nothingExecuted`, `retrySafe`, `claimed`, `claimedAt`, `authorizedAmount`, `settledAmount`, `settlementEvidence`, `effectState`. Never carries a claim token or the claimer's identity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `POST /policy/mandate/authorize/:authId/effect/unknown`         | claimer · owner session · admin                     | The outcome is ambiguous (timeout, lost response): freezes the hold out of capture/void and into reconciliation. Anyone else gets `403 COUNTERPARTY_MISMATCH`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /policy/mandate/authorize/:authId/effect/reconcile`       | claimer · owner session · admin                     | Ask for an unknown effect to be reconciled; probes the settlement observer (up to 8 s). Anyone else gets `403 RECONCILE_NOT_PERMITTED`. A short per-authorization cooldown applies (`429 RECONCILE_COOLDOWN` with `Retry-After`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `POST /policy/mandate/authorize/:authId/effect/force-reconcile` | owner session (owner of the hold's mandate) · admin | Take a **claimed** hold out of its claimer's hands and into reconciliation — typically after revoking that counterparty. Its budget stays committed; further capture/void answers `HOLD_UNDER_RECONCILIATION`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

**Unknown authorization id.** Capture, void and refund answer `404 AUTHORIZATION_NOT_FOUND` (`data: { captured | voided | refunded: false, authorizationId, reasonCode: "AUTHORIZATION_NOT_FOUND", detail }`), and so does every `effect/*` route, including the outcome lookup (`data: { authorizationId, reasonCode, detail }`).

**Every refusal has a code.** On capture, void, refund and the `effect/*` routes a refusal carries the bare reason code as `message`, and `data.reasonCode` and a human `data.detail` beside it. Branch on the code, never on `detail`. A malformed authorization id (not a UUID) or a body that fails validation is `400 MALFORMED_REQUEST` (the validation issues in `data.issues`). See the <a href="https://docs.metamynd.ai/agent-protocol/reason-code-registry" target="_blank">Reason Code Registry</a>.

**`/policy/*` — trusted counterparties and payees**

See <a href="https://docs.metamynd.ai/core-concepts/trusted-counterparties-and-payee-directory" target="_blank">Trusted Counterparties & Payee Directory</a>.

| Method + path                                  | Auth                         | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /policy/counterparties`                   | owner session                | Your registry (revoked entries included), plus `enforced`. Each entry carries its `purpose` (`claim`, `report` or `observe`) and its `observation` scope, or `null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `POST /policy/counterparties/challenge`        | owner session                | `{ did, purpose? }` → `{ message, challengeToken }`, valid for 10 minutes. The service signs `message` to accept the registration for that purpose.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `POST /policy/counterparties`                  | owner session                | `{ did, label?, merchants?[] (≤ 50), purpose?, proof: { challengeToken, signature }, confirmEnforcementChange? }` — `did` must be `did:key` or `did:hedera`; `purpose` defaults to `claim`. The proof is required (`COUNTERPARTY_PROOF_REQUIRED` / `_INVALID` / `_EXPIRED`). Your **first** `claim` registration switches every one of your holds to registered-only and is refused with `409 ENFORCEMENT_CHANGE_NOT_CONFIRMED` unless it carries `confirmEnforcementChange: true`. Registering an active entry again for less never narrows it (claim > report > observe). There is a cap on active entries (409).                                                                                     |
| `PUT /policy/counterparties/:id/observation`   | owner session                | `{ subjects[] (≤ 50), facts[] (≤ 50), maxValiditySeconds? }` — grant an active, accepted entry an observation scope (`OBSERVATION_SET`), or clear it with no facts (`OBSERVATION_CLEARED`). Subjects are exact or end in `*`; `maxValiditySeconds` is 1 to 600. `409 OBSERVER_IS_AGENT` for one of your own agents' DIDs, `409 OBSERVER_NOT_REGISTERED` for a revoked or unaccepted entry. Audited.                                                                                                                                                                                                                                                                                                     |
| `POST /policy/facts`                           | **public** · signed observer | An observer pushes an attested environment fact `{ subject, fact, value, observedAt, validFor }`, signed `MAGP-SERVICE-v1` with action `attest` over `subject`, `fact`, the JSON `value`, `observedAt` and `validFor`. `201 RECORDED`, or `200 ALREADY_RECORDED` for a resent nonce. Refusals: `400 FACT_MALFORMED`; `401` for a missing or bad signature; `403 OBSERVER_NOT_REGISTERED` · `FACT_OUT_OF_SCOPE` · `FACT_VALIDITY_TOO_LONG` (over the observer's cap); `422 FACT_EXPIRED` · `FACT_FROM_THE_FUTURE` · `FACT_VALIDITY_TOO_LONG` (over 600 s). Rate-limited. See <a href="https://docs.metamynd.ai/core-concepts/attested-environment-facts" target="_blank">Attested Environment Facts</a>. |
| `DELETE /policy/counterparties/:id`            | owner session                | Revoke an entry. Enforcement stays on: revoking your last entry stops every claim until you register again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `GET /policy/counterparties/:id/claimed-holds` | owner session                | The holds that counterparty still has claimed and unsettled — the input to `effect/force-reconcile`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `GET /policy/payees`                           | owner session                | Your merchant → payee-account directory.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `POST /policy/payees`                          | owner session                | `{ merchant, payTo, label?, country? }` — `payTo` is a Hedera account id (`0.0.X`) or an EVM address. The first active entry for a merchant means a lowered settlement for that merchant must name one of its registered accounts. `country` (ISO 3166-1 alpha-2) is per merchant; omitted = keep the merchant's current one.                                                                                                                                                                                                                                                                                                                                                                           |
| `PUT /policy/payees/country`                   | owner session                | `{ merchant, country }` — set (or, with `null`, clear) the country on every active entry of a merchant; `404` when it has none, `400 MALFORMED_REQUEST` for a malformed or group code. A registered country is the **authoritative** jurisdiction of every request paying that merchant (MAGP §8.3.12): a signed jurisdiction that differs is refused `JURISDICTION_MISMATCH`.                                                                                                                                                                                                                                                                                                                          |
| `DELETE /policy/payees/:id`                    | owner session                | Revoke an entry. Revoking a merchant's last entry ends enforcement for that merchant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

**`/policy/*` — bundles, escalations, breakers, digests**

| Method + path                                    | Auth                                             | Purpose                                                                                                                                                                                                                                |
| ------------------------------------------------ | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /policy/bundle/:did`                        | **public**                                       | The agent's signed policy bundle for edge/guard evaluation, re-issued at serve time — see <a href="https://docs.metamynd.ai/agent-protocol/policy-bundle-pinning-and-freshness" target="_blank">Policy Bundle Pinning & Freshness</a>. |
| `GET /policy/events/:did`                        | **public** (SSE)                                 | Emits `policy:changed` when the agent's rules recompile (push-invalidation).                                                                                                                                                           |
| `GET /policy/escalations`                        | approver                                         | Pending reviews (`?status=all` for history). Each row carries `agentName`, the agent's display name, or `null` when its DID no longer resolves to one of the escalation owner's agents.                                                |
| `GET /policy/escalations/:escalationId/status`   | **public** (the escalation id is the capability) | Poll a held escalation: `status`, `reasonCode`, `authorizationId`, `expiresAt`, `approvals`, `required`; after a MODIFY also `modifiedAction` and `nextEscalationId`; and `payloadBound` whenever there is a hold.                     |
| `POST /policy/escalations/:escalationId/resolve` | approver                                         | `{ decision: "approve" \| "deny" \| "modify", note?, modifiedAction? }` — `modifiedAction` `{ amount?, currency?, merchant?, itinerary? }` is required for `modify`.                                                                   |
| `GET /policy/circuit-breakers`                   | owner session / admin                            | List scoped circuit breakers.                                                                                                                                                                                                          |
| `POST /policy/circuit-breakers/trip`             | owner session / admin                            | Manually trip a breaker.                                                                                                                                                                                                               |
| `POST /policy/circuit-breakers/configure`        | owner session / admin                            | Arm auto-trip for a scope. Breakers do nothing until armed or tripped.                                                                                                                                                                 |
| `POST /policy/circuit-breakers/:breakerId/reset` | owner session / admin                            | Reset a breaker.                                                                                                                                                                                                                       |
| `GET /policy/decisions/refusals`                 | owner session                                    | "What did my agents try to do that I refused?" — counts only.                                                                                                                                                                          |
| `POST /policy/decisions/refusals/send`           | owner session                                    | Send the refusal digest on demand.                                                                                                                                                                                                     |
| `POST /policy/evaluate`                          | owner session                                    | Evaluate a generic (non-mandate) policy.                                                                                                                                                                                               |
| `POST /policy/` · `GET /policy/`                 | owner session                                    | Create / list generic policies.                                                                                                                                                                                                        |

**`/did/*`**

| Method + path   | Auth       | Purpose                                       |
| --------------- | ---------- | --------------------------------------------- |
| `GET /did/:did` | **public** | DID resolver. Returns `application/did+json`. |

**`/standards/atoms`**

| Method + path          | Auth          | Purpose                                                                                              |
| ---------------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
| `GET /standards/atoms` | owner session | The atom catalog with required context. Also served (unauthenticated) as part of `GET /magp/schema`. |

**`/magp/*`**

| Method + path                                       | Auth                                                 | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET /magp/schema`                                  | **public**                                           | Machine-readable schema: request/verdict/rule-pack JSON Schemas, the gate reason codes with SAFR aliases, atoms.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `GET /magp/profiles`                                | **public**                                           | List/read regulatory profiles; `?compose=id1,id2` stacks them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `GET /magp/profiles/:id`                            | **public**                                           | One regulatory profile.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `GET /magp/obligations`                             | **public**                                           | Source-obligations traceability (article/section → enforced control); `?standard=` filters.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `POST /magp/agents/:agentDid/profiles`              | owner session / admin                                | `{ profileId }` — assign a regulatory profile to an agent; its Standards then run at the gate and are carried in the agent's signed policy bundle, so a local-first guard enforces them too. Only `active` profiles can be assigned (`PROFILE_NOT_ACTIVE` otherwise); the SAFR Financial Services and Malaysia AI Governance profiles are active. Only the agent's owner or a platform admin; anyone else gets `404 AGENT_NOT_FOUND`.                                                                                                                                                                                                                                                                                                                                                            |
| `GET /risk-declarations/:agentDid`                  | owner session / admin                                | The agent's active risk-assessment declaration, its history, and the mandated actions one must cover. See <a href="https://docs.metamynd.ai/guides/file-a-risk-assessment-declaration" target="_blank">File a Risk-Assessment Declaration</a>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /risk-declarations/:agentDid`                 | owner session / admin                                | File a declaration (supersedes the active one; the gate enforces it from the next request). `400 DECLARATION_INVALID` lists every issue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `GET /magp/agents/:agentDid/profiles`               | owner session / admin                                | An agent's assigned profiles (the agent's owner or a platform admin).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `DELETE /magp/agents/:agentDid/profiles/:profileId` | owner session / admin                                | Unassign a profile (the agent's owner or a platform admin).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /magp/profile-bindings`                        | owner session / admin                                | Every profile binding on your own agents in one read (a platform admin: every agent).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `POST /magp/bundle/compile`                         | owner session                                        | Compile + sign + persist a version-bound policy bundle.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `GET /magp/manifest/:did`                           | **public**                                           | Authority Manifest — what an agent may / conditionally may / needs approval for / may never do, and its principal's verification status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `GET /magp/evidence/:eventId/proof`                 | **public**                                           | Merkle inclusion proof for one evidence event (use the verdict's `eventId`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `POST /magp/private-authorize`                      | **public** (the agent's signature is the credential) | Zero-knowledge blind check. Signed by the agent's DID key (nonce + `issuedAt`, like `/policy/mandate/authorize`, over `MAGP-PRIVATE-AUTHORIZE-v1`). Proves "amount ≤ **the agent's mandate cap**" and, if the mandate has a jurisdiction allow-list, "jurisdiction ∈ **that list**" — both read from the agent's active mandate; a request that sends `cap`/`allowedJurisdictions` is refused `400 ZK_CALLER_POLICY_REJECTED`. Creates no hold or evidence and evaluates no other mandate term or rule. `transactionCommitment` is required (`400 ZK_TRANSACTION_COMMITMENT_REQUIRED`); every allow returns a signed capability bound to it, the agent DID and the mandate. See <a href="https://docs.metamynd.ai/zero-knowledge/why-blind-governance" target="_blank">Why Blind Governance</a>. |
| `GET /magp/capability/pubkey`                       | **public**                                           | Ed25519 capability verification key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `POST /magp/settlement/reserve`                     | **public** (the `authorizationId` is the bearer)     | x402 settlement store: atomically reserve an authorization before settling (`409 SETTLEMENT_REUSED` on reuse).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /magp/settlement/finalize`                    | **public**                                           | Mark a reserved authorization settled with its tx hash.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `POST /magp/settlement/release`                     | **public**                                           | Release a reservation whose settlement failed (retryable).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `GET /magp/governance/events`                       | owner session (SSE)                                  | Live stream of your agents' gate decisions (an admin sees all).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /magp/policy/pubkey`                           | **public**                                           | Policy-bundle verification key — pin it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `GET /magp/bbs/issuer`                              | **public**                                           | BBS issuer public key + credential schema.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `POST /magp/verify-presentation`                    | **public**                                           | Verify a BBS selective-disclosure presentation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

> **x402.** The x402 binding is enforced in two places: the settlement store above (`reserve` / `finalize` / `release`), and the mandate hold itself — a service claims with `{ "x402": true }`, and a lowered capture or a release of that claimed hold must then be supported by the settlement observer. See <a href="https://docs.metamynd.ai/agent-protocol/x402-payment-binding" target="_blank">x402 Payment Binding</a>.

**Proof, credential and onboarding routes a developer uses**

These sit outside the MAGP core but are part of a normal integration.

| Method + path                                                                                                                                              | Auth                                      | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET /action-passport/pubkey`                                                                                                                              | **public** (rate-limited)                 | Key that signs Action Passports and execution receipts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `GET /action-passport/verify/:authorizationId`                                                                                                             | **public** (rate-limited)                 | Verify the Action Passport issued for a permit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /action-passport/receipt/verify/:authorizationId`                                                                                                     | **public** (rate-limited)                 | Verify the execution receipt issued at capture: `integrityValid`, `payloadMatch`, `outcomeStatus`, and (receipt v2) `settlementEvidence`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `GET /action-passport/:authorizationId` · `GET /action-passport/receipt/:authorizationId`                                                                  | owner session                             | Full passport / receipt detail.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /agent-passport/pubkey` · `GET /agent-passport/verify/:agentDid` · `GET /agent-passport/:agentDid/authority-path`                                     | **public** (rate-limited)                 | Verify an agent's Agent Passport and its authority path.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `POST /agent-passport/:agentDid/issue` · `POST /agent-passport/:agentDid/revoke` · `GET /agent-passport/:agentDid`                                         | owner session                             | Issue, revoke, read.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `POST /credential-vault/resolve`                                                                                                                           | gateway token + an active Action Passport | Just-in-time release of an upstream credential to a trusted gateway, for one authorization. Every access is audited. See <a href="https://docs.metamynd.ai/verifai-trust-layer/credential-vault" target="_blank">Credential Vault</a>.                                                                                                                                                                                                                                                                                                                                                                                               |
| `POST /credential-vault` · `GET /credential-vault` · `POST /credential-vault/:credentialId/rotate` · `POST /credential-vault/:credentialId/revoke`         | owner session                             | Store, list, rotate and revoke upstream credentials (encrypted at rest).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `GET /trust-index/:did`                                                                                                                                    | **public** (rate-limited)                 | Signed Trust Index for an agent DID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `GET /trust-index/profile/spec`                                                                                                                            | **public**                                | The scoring profile and adapter catalog.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `POST /trust-index/:did/publish`                                                                                                                           | owner session / admin                     | Anchor the agent's Trust Index to its HCS-28 topic.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /trust-graph/decision/:ref/accountability` · `…/evidence-path` · `GET /trust-graph/agent/:ref/contagion` · `GET /trust-graph/issuer/:id/blast-radius` | owner session                             | The four trust-graph questions, owner-scoped.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `GET /evidence`                                                                                                                                            | owner session · admin                     | The owner's evidence log (the Activity Log's anchored rows), newest first. Filters: `agentDid`, `workerId`, `decision`. Paging: `limit` (default 100, at most 999) with either `page` (1-based) or `offset`, or the `before` cursor (the previous page's `page.nextBefore`; stable while new rows arrive). The response's `page` carries `hasMore`, `total` and `totalPages` (counted only without `before`), `page`, `nextPage`, `offset`, `nextOffset` and `nextBefore`. A malformed `page`/`offset`, or both at once, is 400.                                                                                                     |
| `GET /onboarding/rule-packs` · `GET /onboarding/rule-packs/:key/preview` · `GET /onboarding/sandbox-tiers`                                                 | **public**                                | Starter rule packs (each says `requiresSpend`), their molecules for given caps (`?financial=false` previews for an agent with no spend authority; a spend-built pack answers 422 `RULE_PACK_NEEDS_SPEND`), and sandbox tiers.                                                                                                                                                                                                                                                                                                                                                                                                        |
| `POST /onboarding/agent`                                                                                                                                   | owner session                             | One-call onboarding: identity + mandate + SOP + Standards (what `create-metamynd-agent` calls). New agents are testnet agents. Optional `expiresAt` (ISO 8601 date-time, in the future) sets when the mandate lapses. A `rulePack` is applied exactly as previewed or the call is refused with nothing created: 400 `UNKNOWN_RULE_PACK` (an unknown key), 400 `RULE_PACK_NEEDS_SPEND` (a spend-built pack for an agent with no spend fields), 400 `REVIEWED_RULES_MISMATCH` (optional `reviewedMoleculeIds` differ from what would be attached), 400 `EXPIRY_INVALID` (an `expiresAt` that is not a date-time or not in the future). |
| `POST /onboarding/agents/:ref/rules`                                                                                                                       | owner session                             | An existing agent's mandate and a rule-pack SOP in one call: `{ principalId, scope, rulePack, currency?, perTxnMax?, maxAmount?, merchants?, expiresAt?, reviewedMoleculeIds? }`. For an agent with no active mandate yet (`ALREADY_HAS_MANDATE` otherwise). The rule-pack refusals of `POST /onboarding/agent` apply, and so does `400 EXPIRY_INVALID`; every refusal comes before anything is written.                                                                                                                                                                                                                             |
| `POST /onboarding/sandbox`                                                                                                                                 | **public** (rate-limited)                 | A ready shared sandbox agent, no account needed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `POST /onboarding/sandbox/mine`                                                                                                                            | owner session                             | The same sandbox tiers, owned by you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `POST /onboarding/requests` · `GET /onboarding/requests` · `POST /onboarding/requests/:id/resolve`                                                         | session · owner · owner                   | Delegated issuance: a developer requests an agent for an owner's org; the owner approves or denies.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /onboarding/requests/:id/claim` · `POST /onboarding/requests/:id/verify-key`                                                                          | one-time claim token (rate-limited)       | The developer collects the approved config, and proves control of a BYOK key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

**Owner-console routes**

Agent containment and reinstatement are done from the dashboard; see <a href="https://docs.metamynd.ai/core-concepts/dispositions-and-escalation" target="_blank">Dispositions & Escalation</a>. The routes for organisation invites, reporting, the administrative audit log and regulator access are documented with the features they serve: <a href="https://docs.metamynd.ai/guides/organisation-members-and-invites" target="_blank">Organisation Members & Invites</a>, <a href="https://docs.metamynd.ai/guides/reporting-and-the-decision-explorer" target="_blank">Reporting & the Decision Explorer</a>, <a href="https://docs.metamynd.ai/core-concepts/administrative-audit-log" target="_blank">Administrative Audit Log</a> and <a href="https://docs.metamynd.ai/regulatory-compliance/supervisory-access-for-regulators" target="_blank">Supervisory Access for Regulators</a>.

> This page covers the surface a developer integrating an agent or a service touches. The platform runs other routes for its own console and operations; a second MAGP implementation doesn't need to reproduce them to interoperate. Requests are rate-limited; a `429` carries `Retry-After`.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.metamynd.ai/agent-controls-agentsafe/api-endpoints.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
