nicememhelpOpen nicemem →

API reference

The REST API: auth, endpoints, errors, and conventions.

A plain REST API — JSON in, JSON out. This page is deliberately light: the common calls and conventions, not an exhaustive schema.

Base URL   https://nicemem.com/api/v1
Auth       Authorization: Bearer nicemem_sk_…

Create keys in Settings → Keys. A key's write policy and space pin apply to every request it makes.

Endpoints

Method Path What it does
POST /memories Create a memory.
GET /memories The timeline, newest first. Cursor-paginated; filter by kind.
GET /memories/:id One memory. Counts as a retrieval — reinforces its strength.
PATCH /memories/:id Edit. Content changes re-embed automatically.
DELETE /memories/:id Soft delete.
POST /search Semantic search.
GET /spaces The spaces this key can see.
GET /export Everything the key can see, as NDJSON.
GET /me Whoami — handy for verifying a key.

Creating

curl -s https://nicemem.com/api/v1/memories \
  -H "Authorization: Bearer nicemem_sk_…" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "marked v16: parse() is sync unless an async extension is registered",
    "kind": "note",
    "tags": ["marked", "markdown"],
    "source_label": "my-script"
  }'

Optional fields: title, language (for snippets), metadata (an open JSON bag), space (a slug — unknown slugs are a 400 unknown_space), and context ({ "git_remote": … }) for binding-based filing. The response is the created memory; through a review key it carries "status": "pending" until approved.

Searching

curl -s https://nicemem.com/api/v1/search \
  -H "Authorization: Bearer nicemem_sk_…" \
  -H "Content-Type: application/json" \
  -d '{ "query": "how we fixed the safari autofill popup", "limit": 5 }'

Search is semantic — describe meaning, not keywords. Results include score (relevance × strength) and similarity (raw relevance), ranked by score. Optional: tags and kind as exact filters, space as a hard scope, context to boost the matching space, and decay: false to rank by raw similarity alone.

Conventions

  • Errors: { "error": { "code": "not_found", "message": "…" } } — codes are stable strings, messages are for humans. The ones worth handling: unknown_space (400), monthly_limit_reached (402, with resets_at — see plans), not_found (404), and search_unavailable (503, temporary).
  • Pagination is an opaque cursor plus limit, never offsets.
  • Timestamps are ISO 8601, UTC.
  • Response shapes are a public contract. We add fields; we don't repurpose or remove them.