Skip to main content
PATCH
/
v1
/
memories
/
batch
Batch Update
curl --request PATCH \
  --url https://api.memoclaw.com/v1/memories/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "updates": [
    {
      "updates[].id": "<string>",
      "updates[].content": "<string>",
      "updates[].metadata": {},
      "updates[].importance": 123,
      "updates[].memory_type": "<string>",
      "updates[].namespace": "<string>",
      "updates[].pinned": true,
      "updates[].expires_at": {},
      "updates[].immutable": true
    }
  ]
}
'
{
  "updated": 123,
  "errors": [
    {
      "errors[].id": "<string>",
      "errors[].status": 123,
      "errors[].message": "<string>"
    }
  ]
}
This endpoint requires an x402 payment header.
Price: $0.005 USDC Update multiple memories at once. Each update object must include the memory id and at least one field to change. If content is changed on any memory, its embedding is regenerated.

Request Body

updates
array
required
Array of update objects. Min 1, max 100. Each must include id plus at least one field to change.
Immutable memories in the batch are skipped and returned in the errors array with a 409 status. The rest of the batch still processes.

Response (200)

updated
number
Number of memories successfully updated.
errors
array
Array of error objects for memories that failed to update.

Example

curl -X PATCH https://api.memoclaw.com/v1/memories/batch \
  -H "Content-Type: application/json" \
  -d '{
    "updates": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "importance": 0.95,
        "pinned": true
      },
      {
        "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
        "content": "Updated: team now uses pnpm instead of npm",
        "metadata": { "tags": ["stack", "tooling"] }
      }
    ]
  }'
Response
{
  "updated": 2,
  "errors": []
}

Errors

StatusDescription
404Memory not found (skipped, reported in errors).
409Memory is immutable (skipped, reported in errors).
422Invalid request body or field validation failed.