POST/api/v1/record

Write a memory record. Stored in Postgres, classified automatically. No LLM call, no token cost. Returns immediately with the record ID.

Request body

FieldTypeRequiredDescription
agent_idstringYesIdentifier for the agent writing this memory. Namespaces queries.
typeenumYesfact | decision | exchange | deliverable | open_item | signal
titlestringYesShort summary. Used in search results and UI.
bodystringYesFull memory content. Max 64KB.
clientstringNoOptional client/project tag for filtering.
metadataobjectNoArbitrary JSON. Returned in query results. Not indexed.

Example

curl -X POST https://synapse.by-kit.com/api/v1/record \
  -H "Authorization: Bearer sk_syn_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "scout",
    "type": "decision",
    "title": "Chose PostgreSQL over SQLite",
    "body": "Selected Postgres for multi-tenant isolation. SQLite cannot handle concurrent writes across tenants.",
    "client": "project-alpha",
    "metadata": { "phase": 1, "confidence": "high" }
  }'

Response

{
  "id": "a3f1b9c2-4e5d-4c2b-9f8a-1d2e3f4a5b6c",
  "created_at": "2026-05-20T12:00:00.000Z",
  "tenant_id": "550e8400-e29b-41d4-a716-446655440000"
}

Error codes

// 400 — Validation error
{ "error": "invalid_type", "message": "type must be one of: fact, decision, exchange, deliverable, open_item, signal" }

// 400 — Body too large
{ "error": "body_too_large", "message": "body exceeds 64KB limit" }

// 401 — Invalid key
{ "error": "unauthorized", "message": "Invalid API key" }

// 429 — Rate limited
{ "error": "rate_limited", "retry_after": 14 }

Notes

  • Classification runs asynchronously — the type field you pass is stored as-is. Auto-classification is available via POST /v1/classify if you want a suggestion before writing.
  • Records are scoped to your tenant. Other API keys cannot read your records.
  • Every write counts against your monthly record quota.