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
}
]
}
'import requests
url = "https://api.memoclaw.com/v1/memories/batch"
payload = { "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
}
] }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
}
]
})
};
fetch('https://api.memoclaw.com/v1/memories/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memoclaw.com/v1/memories/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.memoclaw.com/v1/memories/batch"
payload := strings.NewReader("{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.memoclaw.com/v1/memories/batch")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/memories/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": 123,
"errors": [
{
"errors[].id": "<string>",
"errors[].status": 123,
"errors[].message": "<string>"
}
]
}API Reference
Batch Update
PATCH /v1/memories/batch — Update multiple memories in a single request.
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
}
]
}
'import requests
url = "https://api.memoclaw.com/v1/memories/batch"
payload = { "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
}
] }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
}
]
})
};
fetch('https://api.memoclaw.com/v1/memories/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memoclaw.com/v1/memories/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.memoclaw.com/v1/memories/batch"
payload := strings.NewReader("{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.memoclaw.com/v1/memories/batch")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/memories/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"updates[].id\": \"<string>\",\n \"updates[].content\": \"<string>\",\n \"updates[].metadata\": {},\n \"updates[].importance\": 123,\n \"updates[].memory_type\": \"<string>\",\n \"updates[].namespace\": \"<string>\",\n \"updates[].pinned\": true,\n \"updates[].expires_at\": {},\n \"updates[].immutable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": 123,
"errors": [
{
"errors[].id": "<string>",
"errors[].status": 123,
"errors[].message": "<string>"
}
]
}This endpoint requires an x402 payment header.
id and at least one field to change. If content is changed on any memory, its embedding is regenerated.
Request Body
array
required
Array of update objects. Min 1, max 100. Each must include
id plus at least one field to change.Show Update object fields
Show Update object fields
string
required
UUID of the memory to update.
string
New memory text. Max 8,192 characters. Triggers re-embedding.
object
Replace metadata entirely. Max 4 KB, 20 keys, 3 levels deep.
number
Float between 0 and 1.
string
One of:
correction, preference, decision, project, observation, general.string
Move memory to a different namespace. Max 255 characters.
boolean
Pin or unpin the memory.
string | null
ISO 8601 date string or
null to clear expiration.boolean
Lock the memory permanently. One-way operation.
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)
number
Number of memories successfully updated.
array
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"] }
}
]
}'
memoclaw update 550e8400-e29b-41d4-a716-446655440000 \
--importance 0.95 --pinned
memoclaw update 6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
--content "Updated: team now uses pnpm instead of npm" \
--tags stack,tooling
from memoclaw import MemoClaw
client = MemoClaw()
result = client.update_batch([
{
"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"]},
},
])
import { MemoClawClient } from "memoclaw";
const client = new MemoClawClient();
const result = await client.updateBatch({
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
| Status | Description |
|---|---|
| 404 | Memory not found (skipped, reported in errors). |
| 409 | Memory is immutable (skipped, reported in errors). |
| 422 | Invalid request body or field validation failed. |
⌘I