REST API Reference
This page is for people who want to connect MeMesh to their own systems. It covers the APIs for workspaces, execution controls, approvals, memory, and team-related flows.
https://memesh.ai/api/v1Not sure whether you need this page?
If you are just trying MeMesh for the first time, start with the docs overview or Setup first. Come back here when you need to automate, integrate, or call the runtime from your own systems.
Authentication Header
x-api-key: mk_your_api_key_hereAll requests need a valid API key. Create one from Setup > Agent Access Keys.
Project Dispatch Targets
Project workspace-scoped dispatch targets and target-level governance truth.
/agents/dispatch-targetsList local and remote dispatch targets for this workspace, including eligibility, runtime policy, control state, and compatibility summaries.
Query: search?, targetKind? (LOCAL_AGENT|REMOTE_A2A), state?, limit?, offset?
/agents/dispatch-targets/:idGet one dispatch target with remote control capability or local runtime summary.
/agents/dispatch-targets/:id/governanceView governance details such as runtime policy, review state, incident handoff, recent runs, recent audit, impacted work, and timeline.
/agents/dispatch-targets/:id/holdPlace a manual hold on a dispatch target. Requires the latest runtime CAS token.
Body: { reason, releaseAfter?, expectedRuntimeUpdatedAt }
/agents/dispatch-targets/:id/releaseRelease a manual hold and recompute effective policy in one CAS-protected mutation.
Body: { note?, expectedRuntimeUpdatedAt }
/agents/dispatch-targets/:id/review/acknowledgeAcknowledge the active governance review for the current policy epoch.
Body: { note?, expectedRuntimeUpdatedAt }
/agents/dispatch-targets/:id/incident/handoffRecord provider-incident handoff for the active incident epoch.
Body: { externalIncidentId, owner, note?, expectedRuntimeUpdatedAt }
Memory
Store and search memories with semantic search support.
/memory/writeWrite one memory item inside the selected project workspace memory with optional metadata.
Body: { projectId, content, space?, summary?, tags?, sensitivity?, source? }
/memory/searchSearch memories inside the selected project workspace memory with a natural-language query over GET.
Query: projectId (required), query (required), spaces?, limit?
/memory/searchSearch memories inside the selected project workspace memory with a structured POST body.
Body: { projectId, query, spaces?, limit? }
/memory/countGet the total memory count inside the selected project workspace memory.
Query: projectId (required)
/memory/batchWrite up to 100 memories inside selected project workspace memory boundaries with transactional or partial-success mode.
Body: { memories[{ projectId, content, space?, ... }], transactional? }
/memory/batch/searchRun up to 50 memory searches in parallel with optional deduplication.
Body: { queries[], deduplicate? }
/memory/spacesList memory spaces inside the selected project workspace memory.
Query: projectId (required)
/memory/queryRun a hybrid memory query inside the selected project workspace memory with semantic, tag, and temporal filters.
Body: { projectId, query, limit?, offset?, similarityThreshold? }
/memory/context-windowSelect memories from the selected project workspace memory for an LLM context window within a token budget.
Body: { projectId, query, tokenBudget }
/memory/stream/exportStream a memory export through Server-Sent Events for large exports.
Query: spaces?
Orchestrator Runtime
Persisted runs, control truth, reconcile, retry-cancel, and runtime health.
/orchestrator/runsList recent runs with target kind, control truth, approval links, and operator guidance.
/orchestrator/runs/:idGet run detail with events, approvals, remote control state, and suggested operator action.
/orchestrator/runs/:id/controlReturn control capability truth, block reasons, and operator guidance for one run.
/orchestrator/runs/:id/reconcileForce-poll remote state and reconcile late terminal truth.
/orchestrator/runs/:id/retry-cancelRetry a remote cancel after timeout or transient failure.
/orchestrator/runs/:id/resolve-remotePerform guarded operator resolution for remote runs after recovery is exhausted.
/orchestrator/runtime-healthView operator health across local compatibility, remote escalation, target governance, and attention backlog.
Local Agent Execution
Claim-token based local execution queue with leases, heartbeats, recovery, and cancel acknowledgement.
/agents/executionsList pending local executions available to the current agent.
/agents/executions/:id/claimClaim a local execution with a caller-supplied claim token.
Body: { claimToken, workerId? }
/agents/executions/:id/heartbeatExtend the active lease and optionally report progress.
Body: { claimToken, progressMessage? }
/agents/executions/:id/completeComplete the claimed execution.
Body: { claimToken, result?, idempotencyKey? }
/agents/executions/:id/ack-cancelAcknowledge a cancel after the runtime requests local interruption.
Body: { claimToken, note? }
Team
Account access roster management, invitations, and role-based admin access. Project workspace membership lives under Projects.
/team/membersList members for the API key account access roster.
/team/members/inviteInvite a person to the account access roster by email. Requires OWNER or ADMIN role.
Body: { email, role? }
/team/members/:userId/roleChange an account roster member's role.
Body: { role }
/team/members/:userIdRemove a member from the account access roster.
Audit
Audit log access for security review and compliance workflows.
/audit/logsQuery audit logs with optional filters for action, resource, date range, and limit.
Query: action?, resource?, startDate?, endDate?, limit? (default: 100)
Billing & Usage
Subscription plans, usage statistics, and quota visibility.
/billing/planGet the current user's subscription plan.
/usage/summaryGet usage statistics for memory, API keys, agents, seats, and rate limits.
API Keys
Create, list, and revoke API keys for programmatic access.
/keysCreate a new API key. The raw value is only shown once in the response.
Body: { name }
/keysList all API keys for the current user. Values are masked.
/keys/:idPermanently revoke an API key.
Device Authorization
OAuth 2.0 Device Authorization flow for CLI and MCP clients.
/auth/deviceStart the device authorization flow. Returns device_code, user_code, and verification_uri.
Body: { client_id, scope? }
/auth/device/tokenPoll for a token after the user authorizes the device.
Body: { grant_type: "urn:ietf:params:oauth:grant-type:device_code", device_code }
Example Requests
curl "https://memesh.ai/api/v1/agents/dispatch-targets?targetKind=REMOTE_A2A&limit=10" \
-H "x-api-key: mk_your_api_key"curl -X POST https://memesh.ai/api/v1/orchestrator/runs/run_123/reconcile \
-H "x-api-key: mk_your_api_key" \
-H "Content-Type: application/json"curl -X POST https://memesh.ai/api/v1/agents/dispatch-targets/{targetId}/hold \
-H "x-api-key: mk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"reason": "provider maintenance",
"releaseAfter": "2026-03-22T09:00:00.000Z",
"expectedRuntimeUpdatedAt": "2026-03-20T09:00:00.000Z"
}'HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created (resource created) |
| 400 | Bad Request (validation error, invalid Agent Card) |
| 401 | Unauthorized (invalid or missing API key) |
| 403 | Forbidden (self-review blocked, insufficient permissions) |
| 404 | Not Found (agent or resource does not exist) |
| 409 | Conflict (stale policy epoch, stale runtime snapshot, duplicate claim) |
| 429 | Too Many Requests (rate limit exceeded) |