Upsert up to 100 notes (idempotent via X-Idempotency-Key)
const url = 'https://api.engram.page/notes/batch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"notes":[{"content":"# Engram\n\nAn AI-powered personal knowledge base.\n","mtime":1718900000,"path":"Projects/Engram.md","tags":["project","ai"]},{"content":"## 2026-06-20\n\n- Shipped the batch upsert endpoint.\n","mtime":1718900100,"path":"Daily/2026-06-20.md"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.engram.page/notes/batch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "notes": [ { "content": "# Engram\n\nAn AI-powered personal knowledge base.\n", "mtime": 1718900000, "path": "Projects/Engram.md", "tags": [ "project", "ai" ] }, { "content": "## 2026-06-20\n\n- Shipped the batch upsert endpoint.\n", "mtime": 1718900100, "path": "Daily/2026-06-20.md" } ] }'Creates or updates up to 100 notes in one request, returning a per-note result (ok, conflict, or error) so a single bad or oversized (>10MB) note does not fail the batch. More than 100 notes returns 400, and exceeding the plan’s note cap returns 402. Requires the X-Idempotency-Key header for safe retries.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Notes array
object
object
Compare-and-swap guard: the content_hash you last read for this note. If the note changed since, the write returns 409 instead of merging.
Example
{ "content": "# Engram\n\nAn AI-powered personal knowledge base.\n", "mtime": 1718900000, "path": "Projects/Engram.md", "tags": [ "project", "ai" ]}Example
{ "notes": [ { "content": "# Engram\n\nAn AI-powered personal knowledge base.\n", "mtime": 1718900000, "path": "Projects/Engram.md", "tags": [ "project", "ai" ] }, { "content": "## 2026-06-20\n\n- Shipped the batch upsert endpoint.\n", "mtime": 1718900100, "path": "Daily/2026-06-20.md" } ]}Responses
Section titled “Responses”Per-note results
object
object
object
Present when parse_status is “degraded”: {code, message, detail}
object
Frontmatter parse outcome
object
OKF frontmatter description field
OKF frontmatter created/date field
OKF frontmatter timestamp/modified/updated field
Client mtime (epoch seconds)
Present when parse_status is “degraded”: {code, message, detail}
object
Frontmatter parse outcome
OKF frontmatter resource field
OKF frontmatter type field
Example
{ "results": [ { "parse_status": "ok", "server_note": { "parse_status": "ok", "path": "Projects/engram.md" }, "status": "ok" } ]}Invalid array / >100 items