Skip to content

Write items in bulk

View .md
POST

Up to 25 sets and deletes in one call, in one scope.

Not a transaction. Each operation succeeds or fails on its own and is reported separately; the call returns 200 even when some failed. Check every entry's ok — treating a 200 as "all 25 landed" is the mistake this endpoint invites.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • collectionstringrequired

    Collection name.

Query parameters

  • scopestring

    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.

Body

application/json

  • opsobject[]required
    Limitsmin items 1 · max items 25
    4 properties
    • opstringrequired
      One ofsetdelete
    • keystringrequired
    • valueany

      The document, for set.

    • ttlSecondsinteger
      Limitsmin 60 · max 63072000

Responses

200Every operation was attempted. Inspect each result.
  • resultsobject[]required

    One entry per submitted operation, in order. Check every ok: the call returns 200 even when some operations failed.

    4 properties
    • keystringrequired
    • okbooleanrequired
    • revinteger

      New revision, on a successful set.

    • errorstring

      Why this operation failed. Present when ok is false.

400Invalid body, scope, or more than 25 operations.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Collection not found.
  • codestringrequired
  • messagestringrequired
  • detailsobject
429The plan's monthly unit quota is spent.
  • codestringrequired
  • messagestringrequired
  • detailsobject