Skip to main content
POST
Add a fact
A key set to memory for each user of your app must send the user’s id in x-atlaso-user; without it the call gets 400 memory_scope_per_user. A key whose Memory for is Me reaches your own memory and sends no x-atlaso-user; with it, the call gets 403 memory_scope_owner. Send an Idempotency-Key header to make a retry safe: a resend with the same key and the same text within 24 hours saves nothing new. The 409 answers are listed in Memory API errors. See Memory API.

Authorizations

Authorization
string
header
required

Your Atlaso key in Authorization: Bearer sk-at-.... Send one Authorization header. A request that also sends x-atlaso-key is refused with 401.

Headers

x-atlaso-user
string

Your app user's id, set by your server. A key set to memory for each user of your app must send it on every call; without it the call gets 400 memory_scope_per_user, and an empty value gets 400 missing_user_id. A key whose Memory for is Me reaches your own memory and must not send it: with it, the call gets 403 memory_scope_owner and nothing is read or written. 1 to 256 printable characters, not only spaces, with no API key or token in it. Send it once. Used exactly as sent.

Required string length: 1 - 256
Idempotency-Key
string

Makes a retry safe. 1 to 255 printable ASCII characters, sent once. Resending the same body with the same key within 24 hours returns the first answer instead of saving again, with x-atlaso-idempotent-replay: true. The same key with a different body gets 409 idempotency_key_reused; a resend while the first request is still saving gets 409 idempotency_in_progress. A malformed or repeated header gets 400 invalid_idempotency_key. Do not send it as a body field. The Atlaso SDK sends one for you.

Required string length: 1 - 255

Body

application/json
text
string
required

The fact. Not only spaces, no NUL characters.

Required string length: 1 - 4000
Example:

"Prefers oat-milk lattes."

user
string

Never read as the id. Equal to x-atlaso-user it is ignored; different, the call is refused with 400 user_id_conflict.

Response

The saved fact.

id
string<uuid>
required
object
enum<string>
required
Available options:
memory.fact
created
integer
required

Unix seconds.

text
string
required

The stored fact. Stored text may differ from the input: recognised passwords, API keys and tokens are redacted, but unrecognised secrets and other sensitive details can remain.

source
enum<string>
required
Available options:
api,
learned,
dashboard
app_user
string
required

A 12-character label for the app user, not the id you sent.