Docs
Memory REST API reference
The memory REST API lets your own code add, list, search and delete memories over HTTPS. Every route below is under https://agentics.you/v1/. The reference on this page is generated from the OpenAPI 3.1 description at /developers/openapi.yaml, so the two always agree. Agents in MCP clients use the MCP server instead.
Authentication
Send an org API key as a bearer token. A workspace admin creates one in the console under API keys. It starts ak_ and is shown once.
export AGENTICS_API_KEY="ak_..."
curl https://agentics.you/v1/memories \
-H "Authorization: Bearer $AGENTICS_API_KEY"A key reaches only the namespaces it is bound to. A new key is bound to your workspace's default namespace, so it works on its first call. A signed-in workspace admin can change a key's namespaces with PUT /v1/keys/{key_id}/namespaces, under Keys below. A key created with the memory.read or memory.write scope is narrowed further: reads need either, writes need memory.write. The console's own pages use the signed-in session instead of a key. A virtual key (vk_) and an agent key (agk_mcp_) are not accepted here. See Scoping.
Conventions
- Bodies are JSON, and every field is snake_case.
- A list answers
{ "data": [...], "next_cursor": "..." }. Passnext_cursorback ascursoruntil it isnull. - An error answers
{ "error": { "code": "...", "message": "...", "details": {...} } }. Match oncode. Every code, its status and what to do is on Errors and limits. - A write is a receipt. A memory's
receipt_idand thereceipt_idof a delete can be checked like any other receipt. See Receipts. - The webhook routes under Webhooks name the agent that owns the webhook with an
x-agentics-agentheader: that agent'sagk_mcp_key, or a JITak_token minted for it. A raw identity id is not accepted. An org API key may leave the header out, and its webhooks then belong to the key's own agent; a signed-in session must send it. When a matching memory is admitted, written over REST or with MCP, the webhook gets a signed POST. - Search is
POST /v1/memories/search. It combines keyword and meaning (vector) matching. Each reply reportsmode(hybrid, orkeywordif the vector step can't run) and anydegradedreasons. Each hit carries its receipt and why it matched.GET /v1/memories?q=is a plain full-text filter on the list, newest first.
Add a memory, then find it
curl https://agentics.you/v1/memories \
-H "Authorization: Bearer $AGENTICS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"Billing runs on Neon. Decided 2026-10-01.","metadata":{"team":"billing"}}'
curl "https://agentics.you/v1/ingest/$JOB_ID" \
-H "Authorization: Bearer $AGENTICS_API_KEY"
curl https://agentics.you/v1/memories/search \
-H "Authorization: Bearer $AGENTICS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"which database runs billing?"}'The add answers 202 with job_id and memory_id. The memory is searchable once its job reaches done. Each hit has score, why and the receipt_hash of its write.
Each search hit also says how sure the search is and how it found the memory:
confidenceis the retrieval confidence for the hit, a number from 0 to 1.pathshows how the hit was retrieved.armslists the retrieval arms that returned it (vector,bm25,entity,temporal), andarm_ranksgives its rank in each.rerankisnullwhen no re-rank step ran. Otherwise it givesapplied,rank_before,rank_afteranddelta, wheredeltaisrank_beforeminusrank_after, so a positivedeltameans the hit moved up.supersedeslists the hashes of the memories this hit supersedes.
{
"score": 0.82,
"confidence": 0.91,
"path": {
"arms": ["vector", "bm25"],
"arm_ranks": { "vector": 1, "bm25": 3 },
"rerank": { "applied": true, "rank_before": 3, "rank_after": 1, "delta": 2 },
"supersedes": ["a1b2c3d4"]
}
}Memories
List and search memories
GET /v1/memories
Ready memories, newest first. q is a full-text search (web search syntax: quoted phrases, OR, and -word). Use cursor for paging; page is also accepted, up to offset 10000.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
q | query | string | ||
namespace_id | query | string | One namespace id, or several separated by commas. | |
user_id | query | string | ||
agent_id | query | string | ||
app_id | query | string | ||
run_id | query | string | ||
include_playground | query | boolean, default false | ||
limit | query | integer, 1 to 100, default 25 | ||
cursor | query | string | ||
page | query | integer | 1-based. Not with cursor. | |
sort | query | one of: newest |
| Status | Meaning | Body |
|---|---|---|
200 | A page of memories | MemoryList |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Add a memory
POST /v1/memories
Stores the memory as pending and queues a job that makes it ready. Poll GET /v1/ingest/{job_id}. The same content in the same namespace returns the existing memory with duplicate true and status 200. The write is a receipt. Emails, phone numbers, card and IBAN numbers, keys and tokens in content and metadata are stored as [redacted]; a workspace set to refuse them answers 400 content_rejected. The workspace's write rules apply: Pause all answers 423 tenant_paused, and a rule that asks the owner answers 409 approval_required with details.approval_id; retry with approval_id once it is approved.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Body field | Type | Notes | |
|---|---|---|---|
content | string | required | At most 1048576 bytes of UTF-8. |
namespace | string | A namespace id or name. Defaults to the workspace's default namespace. | |
metadata | object | At most 65536 bytes as JSON. | |
source | string or null | ||
playground | boolean | Marks a test memory. Lists leave it out unless include_playground is true. | |
approval_id | string | The Needs-you approval from a 409 approval_required. Send it on the retry once a person approved the write. |
| Status | Meaning | Body |
|---|---|---|
200 | Already stored in this namespace | MemoryAccepted |
202 | Accepted and queued | MemoryAccepted |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
402 | Free is at its monthly actions (plan_action_limit) or its stored memories (plan_memory_limit). Nothing was written. | PlanLimit |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
413 | content_too_large or metadata_too_large (details.limit_bytes says the limit), or body_too_large when the whole request body is over 8 MiB. | MemoryError |
423 | tenant_paused: the workspace owner paused every agent (Pause all). Nothing was written. Only the owner can resume. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | receipt_unavailable: the write could not be recorded as a receipt. meter_unavailable: the plan meter could not be read. approval_unavailable: a write rule needs the owner's approval and the request could not be filed. Nothing was written. Retry; meter_unavailable sends Retry-After. | MemoryError |
Search memories
POST /v1/memories/search
Combines keyword and meaning (vector) matching over ready memories in the namespaces the caller can read. Each reply reports mode (hybrid, or keyword if the vector step can't run) and any degraded reasons. It reads the same memories as the MCP recall and get_context tools. Each hit carries its write receipt_hash, a score from 0 to 1, and why it ranked. Nothing falls back silently. Each search writes one memory.recall receipt; if that receipt cannot be written, no hits are returned (503 recall_receipt_unavailable). A key narrowed with scopes needs memory.read or memory.write.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Body field | Type | Notes | |
|---|---|---|---|
query | string, 1 to 2000 | required | |
namespace_ids | string (uuid) list, 1 to 100 | Defaults to every namespace the caller can read. | |
agent_id | string | Only memories this agent wrote. | |
k | integer, 1 to 50, default 8 | How many hits. | |
token_budget | integer, 200 to 32000, default 4000 | Bounds the reply. The best hit always comes back, cut to fit. | |
filters | object |
| Status | Meaning | Body |
|---|---|---|
200 | Ranked hits | MemorySearchResult |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | recall_receipt_unavailable: the search could not be recorded as a memory.recall receipt, so no hits were returned. Wait Retry-After seconds and retry. | MemoryError |
Delete many memories
POST /v1/memories/bulk-delete
Without approval_receipt_id, a person is asked in Needs you and the call answers 409 approval_required with details.approval_id. Once approved, repeat it with approval_receipt_id for exactly the same ids. Each delete is a receipt.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Body field | Type | Notes | |
|---|---|---|---|
ids | string (uuid) list, 1 to 1000 | required | |
approval_receipt_id | string |
| Status | Meaning | Body |
|---|---|---|
200 | Deleted | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | receipt_unavailable: the write could not be recorded as a receipt. meter_unavailable: the plan meter could not be read. approval_unavailable: a write rule needs the owner's approval and the request could not be filed. Nothing was written. Retry; meter_unavailable sends Retry-After. | MemoryError |
Get a memory
GET /v1/memories/{memory_id}
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
memory_id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
200 | The memory, with its full content | Memory |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Delete a memory
DELETE /v1/memories/{memory_id}
The delete is a receipt. The write receipt keeps its hash.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
memory_id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
200 | Deleted | MemoryDeleted |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | receipt_unavailable: the write could not be recorded as a receipt. meter_unavailable: the plan meter could not be read. approval_unavailable: a write rule needs the owner's approval and the request could not be filed. Nothing was written. Retry; meter_unavailable sends Retry-After. | MemoryError |
Export memories
GET /v1/memories/export
Every memory in the namespaces the caller can read, ready ones and pending ones, a page at a time in the agentics-memories/1 format. A page stops at about 8 MiB of content and metadata. Follow next_cursor until it is null. Needs an owner or admin session (403 admin_required), or a key not narrowed to memory.read or memory.write (403 insufficient_scope).
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
cursor | query | string | ||
limit | query | integer |
| Status | Meaning | Body |
|---|---|---|
200 | One page of the export | MemoryExport |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Ingest
Get an ingest job
GET /v1/ingest/{job_id}
Poll until terminal is true, waiting poll_after_ms between calls.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
job_id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
200 | The job | IngestJob |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Retry an ingest job
POST /v1/ingest/{job_id}/retry
Only a failed or stalled job, or one with no progress for 15 minutes. Otherwise 409 job_not_retryable.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
job_id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
202 | Queued again | IngestJob |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
List ingest jobs
GET /v1/ingest
The caller's jobs, newest first, each with its source and label. Filter by stage with a comma-separated list.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
stage | query | string | Comma-separated stages. An unknown stage answers invalid_stage. | |
cursor | query | string | ||
limit | query | integer |
| Status | Meaning | Body |
|---|---|---|
200 | A page of jobs | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Import text, a file or a URL
POST /v1/ingest
One entry point for a text paste, a file (PDF and text types; PDF text is extracted, and a PDF with no text layer is refused) or a URL (fetched server side: http or https only, no credentials, no private, loopback or link-local hosts, 10 seconds, 5 MB). Each becomes a POST /v1/memories, with the same job, pipeline and write receipt. Extracted text over 1 MiB is refused with content_too_large, never cut. kind import (L16-09) brings in another assistant's memory instead: a Claude memory export, a ChatGPT data export, or Markdown and text notes (Notion and Obsidian folders included). It needs an owner or admin (a key: the admin scope). It answers 201 with an import job in review and writes nothing yet; the facts are written on POST /v1/ingest/imports/{id}/confirm. An unknown format is refused with 415 unknown_format, never guessed at; at most 50 MB per upload and 10,000 facts per import (413 upload_too_large, too_many_facts; never cut). The console and the desktop app make this same call, parsing the export on the device and sending parsed.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Body field | Type | Notes | |
|---|---|---|---|
kind | one of: text, file, url, import | required | |
format | one of: claude_memory, chatgpt_export, notes | kind import. With files: optional, the format you expect; it is checked against what the files are (format_mismatch). With parsed: required, the format the parser detected. | |
label | string, at most 200 | kind import. A name for the import, shown in the console. | |
namespace_id | string (uuid) | kind import. The namespace the facts are listed in. The default namespace when left out; a key must be bound to it. | |
files | ImportFile list | kind import. The export as uploaded: a ZIP (the ChatGPT data export, a Claude export, a Notion export or a zipped vault), memories.json and projects.json, conversations.json, or Markdown and text notes. Parsed by Agentics. Bounded by the 8 MiB request body; larger exports are parsed on the device and sent as parsed. | |
parsed | ImportParsed | kind import. What lib/memory/import/formats.ts found on the person's device, for an export too large to send: the console and the desktop app parse there, so the export never leaves the device and only its candidate facts are sent. They are reviewed, stored and written exactly as files are. | |
content | string | kind text. Up to 1 MiB. | |
source | string | kind text. import:file marks a part of a file split in the browser; anything else is import:text. | |
filename | string | kind file. | |
content_type | string | kind file. | |
data_base64 | string | kind file. The file, base64. Up to 5 MB. | |
url | string, at most 2048 | kind url. http or https. | |
namespace | string | The namespace id or name. The default namespace when left out. | |
metadata | object | ||
playground | boolean |
| Status | Meaning | Body |
|---|---|---|
200 | Already stored in this namespace | MemoryAccepted |
201 | kind import. The import job, in review. skipped names up to 20 files of the upload that were not read. | JSON object |
202 | Accepted and queued | MemoryAccepted |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
402 | Free is at its monthly actions (plan_action_limit) or its stored memories (plan_memory_limit). Nothing was written. | PlanLimit |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
413 | content_too_large or metadata_too_large (details.limit_bytes says the limit), or body_too_large when the whole request body is over 8 MiB. | MemoryError |
415 | unsupported_file or unsupported_url: Import reads PDF and text files, and HTML or text pages. unknown_format (kind import): the upload is not a Claude memory export, a ChatGPT data export or notes; error.details.accepted lists the formats. | MemoryError |
422 | no_text or unreadable_pdf: there is no text to remember. Nothing was written. | MemoryError |
423 | tenant_paused: the workspace owner paused every agent (Pause all). Nothing was written. Only the owner can resume. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
502 | fetch_failed: the URL could not be fetched, answered an error, or redirected too often. | MemoryError |
503 | receipt_unavailable: the write could not be recorded as a receipt. meter_unavailable: the plan meter could not be read. approval_unavailable: a write rule needs the owner's approval and the request could not be filed. Nothing was written. Retry; meter_unavailable sends Retry-After. | MemoryError |
List memory imports
GET /v1/ingest/imports
The workspace's memory imports, newest first. Needs an owner or admin (a key, the admin scope).
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
cursor | query | string | ||
limit | query | integer, 1 to 100 |
| Status | Meaning | Body |
|---|---|---|
200 | A page of imports | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
A memory import and its candidate facts
GET /v1/ingest/imports/{id}
The import and a page of its candidate facts, for the person's review. An import left open past review_expires_at ends as expired on this read, and its candidates' text is deleted.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
id | path | string (uuid) | required | |
cursor | query | string | ||
limit | query | integer, 1 to 1000 |
| Status | Meaning | Body |
|---|---|---|
200 | The import and a page of its facts | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
Confirm a memory import
POST /v1/ingest/imports/{id}/confirm
The person's choices, then the writes. Every pending fact is written unless it is in exclude; a flagged fact (sensitive or instruction-like) only when it is in include. Each fact is written with a memory.imported receipt keyed import:<id>:<item_sha256>, stored trust_level external and tainted true. One call writes up to 50 facts: while remaining is above 0 the import stays writing, and the same call with no body continues it. When the receipt ledger is down it answers 503 import_write_unavailable with what was written; send it again.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
id | path | string (uuid) | required |
| Body field | Type | Notes | |
|---|---|---|---|
include | string list | item_sha256 of flagged facts to keep. | |
exclude | string list | item_sha256 of facts to leave out. |
| Status | Meaning | Body |
|---|---|---|
200 | The import after this call's writes | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
503 | receipt_unavailable: the write could not be recorded as a receipt. meter_unavailable: the plan meter could not be read. approval_unavailable: a write rule needs the owner's approval and the request could not be filed. Nothing was written. Retry; meter_unavailable sends Retry-After. | MemoryError |
Cancel a memory import
POST /v1/ingest/imports/{id}/cancel
Ends an open import. Facts already written stay; the candidates' text is deleted.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
200 | The cancelled import | JSON object |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
Namespaces
List namespaces
GET /v1/namespaces
A key sees the namespaces it is bound to. A session sees every namespace in the workspace. Ordered by name.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
cursor | query | string | ||
limit | query | integer, 1 to 1000, default 1000 | ||
include | query | one of: stats | stats adds memory_count and last_activity_at to each namespace. |
| Status | Meaning | Body |
|---|---|---|
200 | Namespaces | NamespaceList |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Create a namespace
POST /v1/namespaces
A signed-in workspace admin only. A key gets namespace_management_forbidden.
Auth: a signed-in session.
| Body field | Type | Notes | |
|---|---|---|---|
name | string, 1 to 64 | required | Trimmed. No control characters. Unique in the workspace. |
| Status | Meaning | Body |
|---|---|---|
201 | Created | Namespace |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Get a namespace
GET /v1/namespaces/{namespace_id}
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
namespace_id | path | string (uuid) | required |
| Status | Meaning | Body |
|---|---|---|
200 | The namespace | Namespace |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Rename a namespace
PATCH /v1/namespaces/{namespace_id}
A signed-in workspace admin only.
Auth: a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
namespace_id | path | string (uuid) | required |
| Body field | Type | Notes | |
|---|---|---|---|
name | string, 1 to 64 | required | Trimmed. No control characters. Unique in the workspace. |
| Status | Meaning | Body |
|---|---|---|
200 | Renamed | Namespace |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Delete a namespace
DELETE /v1/namespaces/{namespace_id}
A signed-in workspace admin only. The default namespace cannot be deleted (cannot_delete_default_namespace). A namespace that holds memories answers namespace_not_empty unless move_to names another namespace, in the body or the query, to move them to first.
Auth: a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
namespace_id | path | string (uuid) | required | |
move_to | query | string |
| Body field | Type | Notes | |
|---|---|---|---|
move_to | string |
| Status | Meaning | Body |
|---|---|---|
200 | Deleted | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Keys
List a key's namespaces
GET /v1/keys/{key_id}/namespaces
A signed-in person only. API keys get user_session_required.
Auth: a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
key_id | path | string (uuid) | required | The id of an org API key in this workspace. |
| Status | Meaning | Body |
|---|---|---|
200 | The key's namespaces | KeyNamespaces |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Set a key's namespaces
PUT /v1/keys/{key_id}/namespaces
A signed-in workspace admin only. Replaces the whole list. An empty list denies the key everything (key_has_no_namespaces on its next call).
Auth: a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
key_id | path | string (uuid) | required | The id of an org API key in this workspace. |
| Body field | Type | Notes | |
|---|---|---|---|
namespace_ids | string list, at most 1000 | required | Namespace ids or names. |
| Status | Meaning | Body |
|---|---|---|
200 | The key's namespaces now | KeyNamespaces |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
Webhooks
List an agent's memory webhooks
GET /v1/webhooks
The REST form of the MCP list_subscriptions tool. The webhook URL is never returned, only its host. On only while memory tools are on (404 otherwise). 120 requests a minute per client address.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
x-agentics-agent | header | string | The agent that owns the webhook, named by a credential it holds: its own agk_mcp_ key, or a JIT ak_ token minted for it on the same workspace as the API key. A raw agent_identities id is not accepted, and a value that names no active agent answers 400 agent_required. An org API key may leave the header out: its webhooks then belong to the key's own agent. A signed-in session must send it. |
| Status | Meaning | Body |
|---|---|---|
200 | The agent's webhooks | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | memory_unavailable: the subscription store could not be reached. Nothing was changed. Retry. | MemoryError |
Create a memory webhook
POST /v1/webhooks
The REST form of the MCP subscribe tool. When a memory that matches the pattern is admitted, updated (an outcome recorded on it, or a write that replaces it) or deleted, whether over REST or with MCP, agentics.you sends one signed POST (x-agentics-signature) to the URL right after the write: memory.admitted, memory.updated or memory.deleted (see the webhooks section and MemoryWebhookEvent). A failed delivery is retried after 1, 5 and 30 minutes, then dead-lettered. Up to 50 per agent and 500 per workspace. A key narrowed with scopes needs memory.write.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
x-agentics-agent | header | string | The agent that owns the webhook, named by a credential it holds: its own agk_mcp_ key, or a JIT ak_ token minted for it on the same workspace as the API key. A raw agent_identities id is not accepted, and a value that names no active agent answers 400 agent_required. An org API key may leave the header out: its webhooks then belong to the key's own agent. A signed-in session must send it. |
| Body field | Type | Notes | |
|---|---|---|---|
webhook_url | string (uri), at most 2000 | required | A public https URL. |
name | string | ||
pattern | WebhookPattern | required | What a memory must match. At least one field. |
| Status | Meaning | Body |
|---|---|---|
201 | The new webhook | Webhook |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
409 | The request conflicts with the current state. See error.code. | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | memory_unavailable: the subscription store could not be reached. Nothing was changed. Retry. | MemoryError |
Delete a memory webhook
DELETE /v1/webhooks/{webhook_id}
The REST form of the MCP unsubscribe tool. Only the agent that owns the webhook can delete it.
Auth: an API key (Authorization: Bearer ak_…), or a signed-in session.
| Parameter | In | Type | Notes | |
|---|---|---|---|---|
webhook_id | path | string (uuid) | required | |
x-agentics-agent | header | string | The agent that owns the webhook, named by a credential it holds: its own agk_mcp_ key, or a JIT ak_ token minted for it on the same workspace as the API key. A raw agent_identities id is not accepted, and a value that names no active agent answers 400 agent_required. An org API key may leave the header out: its webhooks then belong to the key's own agent. A signed-in session must send it. |
| Status | Meaning | Body |
|---|---|---|
200 | Deleted | JSON object |
400 | The request was malformed. See error.code. | MemoryError |
401 | No credential, an expired session, or a key with no workspace (unauthorized, session_expired). | MemoryError |
403 | The caller is not allowed (credential_not_supported, csrf, workspace_role_required, read_only, admin_required, key_has_no_namespaces, or a scope code such as namespace_out_of_scope). | MemoryError |
404 | Missing, out of the caller's workspace, or the memory API is not on for this workspace (not_found, feature_not_enabled, route_not_found, or the resource's own not_found code). | MemoryError |
429 | rate_limited. 300 requests a minute per client address, and per workspace 600 writes and 300 searches a minute. Retry-After and error.details.retry_after say how many seconds to wait. | MemoryError |
503 | memory_unavailable: the subscription store could not be reached. Nothing was changed. Retry. | MemoryError |
Schemas
MemoryIn
| Field | Type | Notes | |
|---|---|---|---|
content | string | required | At most 1048576 bytes of UTF-8. |
namespace | string | A namespace id or name. Defaults to the workspace's default namespace. | |
metadata | object | At most 65536 bytes as JSON. | |
source | string or null | ||
playground | boolean | Marks a test memory. Lists leave it out unless include_playground is true. | |
approval_id | string | The Needs-you approval from a 409 approval_required. Send it on the retry once a person approved the write. |
MemoryAccepted
| Field | Type | Notes | |
|---|---|---|---|
job_id | string (uuid) | required | |
memory_id | string (uuid) | required | |
duplicate | boolean | required | True when the same content is already in this namespace. No new job is queued. |
stage | one of: queued, extracting, chunking, embedding, indexing, done, failed | required |
Memory
| Field | Type | Notes | |
|---|---|---|---|
id | string (uuid) | required | |
namespace_id | string (uuid) | required | |
content | string | required | |
content_hash | string | required | |
metadata | object | required | |
source | string or null | required | |
provenance | Provenance | required | Who wrote the memory. Set by the server from the caller, never from the request body. |
playground | boolean | required | |
status | one of: pending, ready, failed | required | |
receipt_id | string or null | required | The receipt of the write, once it is recorded. |
created_at | string (date-time) | required | |
updated_at | string (date-time) | required |
MemorySummary
| Field | Type | Notes | |
|---|---|---|---|
id | string (uuid) | required | |
namespace_id | string (uuid) | required | |
excerpt | string | required | The first 280 characters of the content, ending in an ellipsis when cut. |
content_hash | string | required | |
metadata | object | required | The first 20 keys. |
metadata_key_count | integer | required | |
metadata_truncated | boolean | required | |
source | string or null | required | |
provenance | Provenance | required | Who wrote the memory. Set by the server from the caller, never from the request body. |
playground | boolean | required | |
receipt_id | string or null | required | |
created_at | string (date-time) | required | |
updated_at | string (date-time) | required |
MemoryList
| Field | Type | Notes | |
|---|---|---|---|
data | MemorySummary list | required | |
next_cursor | string or null | required | Pass as cursor for the next page. Null on the last page, and always null with page. |
MemoryDeleted
| Field | Type | Notes | |
|---|---|---|---|
id | string (uuid) | required | |
deleted | true | required | |
receipt_id | string | required |
IngestJob
| Field | Type | Notes | |
|---|---|---|---|
job_id | string (uuid) | required | |
memory_id | string (uuid) | required | |
namespace_id | string (uuid) | required | |
stage | one of: queued, extracting, chunking, embedding, indexing, done, failed | required | |
stage_timestamps | object | required | |
failed_stage | string or null | required | |
failure_reason | string or null | required | |
attempts | integer | required | |
created_at | string (date-time) | required | |
updated_at | string (date-time) | required | |
stalled | boolean | required | Not finished more than 4 hours after it was queued. |
terminal | boolean | required | True at done or failed. |
poll_after_ms | integer or null | required | How long to wait before polling again. Null when the job is terminal or stalled. |
Namespace
| Field | Type | Notes | |
|---|---|---|---|
id | string (uuid) | required | |
name | string, 1 to 64 | required | |
is_default | boolean | required | |
created_at | string (date-time) | required | |
updated_at | string (date-time) | required | |
memory_count | integer | Only with include=stats on the list. | |
last_activity_at | string or null (date-time) | Only with include=stats on the list. |
NamespaceList
| Field | Type | Notes | |
|---|---|---|---|
data | Namespace list | required | |
next_cursor | string or null | required |
KeyNamespaces
| Field | Type | Notes | |
|---|---|---|---|
key_id | string | required | |
data | Namespace list | required |
Provenance
| Field | Type | Notes | |
|---|---|---|---|
user_id | string or null | ||
agent_id | string or null | ||
app_id | string or null | ||
run_id | string or null |
MemoryError
| Field | Type | Notes | |
|---|---|---|---|
error | object | required |