TraceTrace
API

Memories

Create Apple Note revisions and read the complete current Memory projection.

GET /memories/:id

Returns one Memory owned by the authenticated Sterling Trace account.

Retrieve a Memory
1curl \
2  --request GET \
3  --url "https://accounts.sterlingtrace.com/developer/v1/memories/7b4f5c42-7f27-4f38-9f53-524b7e574d51" \
4  --header "Authorization: Bearer $TRACE_API_KEY"
NameTypeRequiredDescription
idUUIDYesThe Memory ID supplied by a webhook or returned by creation.

The projection includes the preserved metadata and every enrichment field currently available. A field may be null while its processing stage is incomplete or when the app cannot provide it.

GET response

{
  "memory": {
    "id": "7b4f5c42-7f27-4f38-9f53-524b7e574d51",
    "createdAt": "2026-09-11T09:42:17.000Z",
    "type": "email",
    "source": "gmail",
    "metadata": { "subject": "September software receipt" },
    "canonicalText": "Receipt from Northstar Software…",
    "description": "## Purchase\nAnnual software subscription…",
    "gist": "Annual software subscription for £120 including VAT.",
    "tags": ["receipt", "software"],
    "questions": ["What software costs did the business incur?"],
    "relevance": { "relevant": true, "score": 0.98, "provenance": "model" }
  }
}

Create an Apple Note Memory

POST /memories

Accepts one immutable revision from the Apple Notes desktop app. This endpoint currently accepts only type: "note" with memory.app: "apple-notes". The stored Memory is tagged apple-notes-app as a durable app fact, then follows the ordinary extraction, enrichment, graph and tag pipeline.

Create an Apple Note
1curl \
2  --request POST \
3  --url "https://accounts.sterlingtrace.com/developer/v1/memories" \
4  --header "Authorization: Bearer $TRACE_API_KEY" \
5  --header "Content-Type: application/json" \
6  --data @apple-note.json
{
  "type": "note",
  "memory": {
    "app": "apple-notes",
    "id": "x-coredata://79E7DC60-5698-487A-999E-C79B44352DE6/ICNote/p5079",
    "revisionId": "b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7b3c7",
    "previousRevisionId": null,
    "title": "March plan",
    "account": "iCloud",
    "folder": null,
    "createdAt": "2026-09-11T14:53:47Z",
    "updatedAt": "2026-09-11T21:35:12Z",
    "locked": false,
    "content": "# March plan\n\nShip the developer API."
  }
}

id is the stable Apple Note ID. revisionId is the client-calculated 64-character hexadecimal SHA-256 identifier for the complete normalized note revision; retrying the same document returns the same Memory with duplicate: true. Do not edit an accepted revision. Send a changed note as a new request with a new revisionId and the preceding revision in previousRevisionId; Trace records a supersedes graph edge. The first revision sets previousRevisionId to null. content is limited to 2 MiB.

The desktop app should map its Markdown front matter to the camel-case fields above, convert a missing folder to null, and put the Markdown body in content. The request is accepted only after durable storage and a normal processing request is attempted; enrichment itself remains asynchronous.

Response

{ "memory": { "id": "7b4f5c42-7f27-4f38-9f53-524b7e574d51" }, "duplicate": false }

201 means a new revision was accepted. 200 means an idempotent retry found the original revision. If starting the asynchronous worker is temporarily unavailable, Trace reports and recovers it through the normal sweep; the stored 201 result is still valid.

Errors

StatusError codeMeaning
400invalid-requestThe JSON does not match the Apple Note contract.
401not-authenticatedThe Bearer key is missing, malformed, expired or revoked.
403developer-scope-requiredThe key lacks the required permission; grant memories:write in Developer settings to add a Memory.
409revision-conflictThat revision ID was already used with different contents, or an initial revision conflicts with an existing note.
409previous-revision-not-foundSend the missing predecessor first.
500internal-errorTrace could not accept the request. Retry with backoff.