Skip to main content
PUT
Write an item

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

If-Match
string

Make the write conditional on the item's current revision, as returned by a previous read or write (plain 3 or ETag-quoted "3"). The write is refused with 409 revision_conflict if the item moved on in between. Without it, the write always wins and silently overwrites a concurrent one.

Example:

"3"

Path Parameters

collection
string
required

Collection name.

key
string
required

Item key. 1-255 chars from A-Z a-z 0-9 . _ : @ -

Query Parameters

scope
string

Which scope to address: contact:<contactId>, conversation:<conversationId>, or omitted for the project scope.

Note the asymmetry with POST /v1/memory and POST /v1/memory/search, which take the scope in the request BODY as scope plus contactId/conversationId. Every other Memory endpoint takes it here. Scope as a query-string value: contact:<contactId>, conversation:<conversationId>, the literal project, or omitted for project scope.

Only the SHAPE of the id is validated, never its existence — the partition already carries your project, so an id that matches nothing simply addresses an empty scope rather than returning 404.

Example:

"contact:jd7x2k3m4n5p6q7r8s9t0abc"

Body

application/json
value
any
required

The document to store. Any JSON value, max 200KB serialized and 32 levels deep. This is a whole-document write, not a merge: it replaces whatever the key held.

ttlSeconds
integer

Overrides the collection's defaultTtlSeconds for this item.

Required range: 60 <= x <= 63072000

Response

Existing item replaced.

item
object
required

One JSON document in a collection.