API reference · Memory

Import an exchange

POST/v1/memory

Hand Memtro a conversation it was not part of, and it learns from it as though it had been: no answer is generated.

Open Memtro

Takes an exchange that happened somewhere else (a transcript you already hold, a conversation from another tool) and learns from it as though it had run through Memtro. No answer is generated; the only model call is the one that reads the transcript, charged to the organisation's background allowance and logged like any other. Afterwards the cards of up to four entities the exchange touched are refreshed, so a question about them minutes later reads the new facts.

The body is the chat-completions shape, with the last message an assistant turn, plus a memtro object with this endpoint's own options.

Example

Against https://platform.memtro.com, with your key in MEMTRO_API_KEY.

curl https://platform.memtro.com/v1/memory \
  -H "Authorization: Bearer $MEMTRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "user", "content": "Where did we land on the Baltic renewal?"},
      {"role": "assistant", "content": "14 March, at £48,000, signed by Birthe."}
    ],
    "memtro": {"occurred_at": "2026-03-02T09:30:00Z", "transcript": "exchange"}
  }'

The response.

{
  "object": "memory.ingest",
  "learned": true,
  "episode": "e4b0…",
  "memory_ids": ["91d7…"],
  "entity_ids": ["5a10…", "b7e2…"],
  "cards": 2,
  "memories": 1,
  "personal": 0,
  "entities": 2,
  "relationships": 1,
  "superseded": 0,
  "corroborated": 0,
  "attributes": 1,
  "visibility": "org",
  "usage": { "input_tokens": 2310, "output_tokens": 240, "total_tokens": 2550 }
}

Authentication

An API key, as Authorization: Bearer or x-api-key. Read-only keys are refused before the body is read. Writing into the organisation's shared memory needs the import permission; writing into your own does not.

  • Every reply, errors included, carries x-request-id and request-id headers with the same id, starting req-. Quote it to support.
  • Browsers may call it from any origin: it answers CORS preflights and allows the Authorization, x-api-key and Anthropic version headers.

Request body

JSON, with Content-Type: application/json.

messagesarray of objectsRequired

The exchange, in the chat-completions message shape. The last message must be the assistant's, with text in it.

memtroobjectOptional

This endpoint's options. (off is not a memory setting here, and the chat options do not apply.)

4 fields of memtro
memorystringOptional

Where the facts go. The key's ceiling applies as in chat; a key with nowhere to write is refused with memory_disabled.

One of org or personal.

Default:

org when the key belongs to an organisation, otherwise personal

transcriptstringOptional

exchange reads the last turn for facts and the rest as context, as a chat turn does; conversation reads every turn. Use conversation for a history nothing has read before.

One of exchange or conversation.

Default:

exchange

occurred_atstringOptional

When the exchange happened: an ISO date, or anything a JavaScript Date can read. Relative dates ("next Tuesday") are resolved against it, so set it for anything that did not happen today.

Default:

Now

learnstringOptional

always overrides the check that skips exchanges with nothing memorable in them.

One of auto or always.

Default:

auto

Response

200application/json

What was learned, or why nothing was.

object"memory.ingest"Optional

Always memory.ingest.

learnedbooleanOptional

Whether anything was stored.

reasonstringOptional

When nothing was learned: why.

episodestring or nullOptional

The id of the recorded exchange.

memory_idsarray of stringsOptional

The memories written.

entity_idsarray of stringsOptional

The entities touched.

cardsintegerOptional

Entity cards refreshed.

memories, personal, entities, relationships, superseded, corroborated, attributesintegerOptional

Counts: memories stored, how many of them personal, entities, relationships, memories superseded, existing facts this exchange confirmed, and recorded values.

visibilitystringOptional

Where it went: org, personal, or team:<id> for a team key.

usageobjectOptional

input_tokens, output_tokens, total_tokens spent reading it.

Errors

In the OpenAI envelope, {"error": {"message", "type", "param", "code"}}. What each code means and what to do about it is in the error catalogue.

StatusCodeWhen
400none

The body failed validation.

400unsupported_parameter

The last message is not the assistant's or has no text (param: messages), or occurred_at is not a date.

400provider_not_configured

No model is available to read the exchange with.

401invalid_api_key

The key is missing, malformed, revoked or expired.

402subscription_inactive

The organisation has no active subscription.

403read_only_key

The key was issued read only.

403memory_disabled

The key may not write memory.

403none

Writing into shared memory without the import permission: send "memory": "personal", or ask an admin.

429allowance_exhausted

The background allowance is spent.

502upstream_error

Reading the exchange failed.

Where agents remember your company

Sign in, add a provider key, create an API key and point your tools at Memtro. It takes about five minutes.

7-day free trial · card on file, nothing charged until it ends · cancel any time