Documentation

API reference

The full public v1 surface is three endpoints. Base URL for all of them: https://mcp.mnemix.ai. Every request needs a bearer token:

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx

POST /v1/recall_and_enrich

The hot path. Call it once, before the agent's first turn. Auto-creates the caller on a miss, recalls same-number memory, and fires real-world enrichment for cold and returning callers.

Request body:

FieldTypeRequiredNotes
phone_numberstringyesAny format; normalized to E.164 server-side.
trigger"ringing" | "answered"noWhen in the call lifecycle this fired.
session_idstringnoCorrelates this recall with the matching calls/end write-back.
agent_idstringnoWhich agent/assistant is handling the call, if you run more than one.
metadataobjectnoArbitrary key-value passthrough, stored with the interaction.
curl -sS -X POST https://mcp.mnemix.ai/v1/recall_and_enrich \
  -H "Authorization: Bearer $MNEMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+15551234567",
    "trigger": "answered",
    "session_id": "call_abc123"
  }'

Response — 200 OK:

{
  "trace_id": "trace_...",
  "known": true,
  "caller": {
    "name": "Mike Reynolds",
    "first_seen_ms": 1750000000000,
    "last_seen_ms": 1751000000000,
    "total_calls": 3,
    "tags": ["fleet", "commercial"],
    "custom_attributes": {}
  },
  "memory": {
    "summary": "Repeat customer, 3 calls over 2 months. Fleet account.",
    "recent_calls": [
      {
        "call_id": "int_...",
        "started_at_ms": 1750900000000,
        "duration_s": 92,
        "summary": "Confirmed brake inspection for Thursday",
        "outcome": "appointment_booked"
      }
    ]
  },
  "enrichment": {
    "person": { "name": "Mike Reynolds", "title": null, "company": null },
    "company": null,
    "phone": { "carrier": "Verizon", "line_type": "mobile" }
  },
  "timing_ms": { "total": "<measured>", "memory_ms": "<measured>", "enrichment_ms": "<measured>", "cache_hit": true },
  "freshness": { "memory_age_ms": null, "enrichment_age_ms": null }
}

timing_ms and freshness are real measured fields on every response — not published benchmarks. A first-time caller returns known: false with enrichment populated instead of memory; a Mnemix-side degradation returns the same shape with degraded: true and empty defaults, so your integration never has to special-case a failure mode — it always gets a well-formed object back.

POST /v1/calls/end

The write-back. Record what happened so the next call starts warmer. Summarization runs in the background — this call returns immediately.

Request body:

FieldTypeRequiredNotes
session_idstringyesMust match the session_id from the paired recall_and_enrich call.
phone_numberstringyesSame caller.
transcriptarray of {role, text, ts_ms}yesrole is "user" or "agent". Not a raw string.
duration_snumberyesCall length in seconds, ≥ 0.
outcomestringyesOne of appointment_booked, quote_given, callback_requested, no_answer, other.
agent_metadataobjectnoArbitrary key-value passthrough.
curl -sS -X POST https://mcp.mnemix.ai/v1/calls/end \
  -H "Authorization: Bearer $MNEMIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "call_abc123",
    "phone_number": "+15551234567",
    "transcript": [
      { "role": "agent", "text": "Thanks for calling, how can I help?", "ts_ms": 0 },
      { "role": "user", "text": "I need to confirm Thursday.", "ts_ms": 3200 }
    ],
    "duration_s": 92,
    "outcome": "appointment_booked"
  }'

Response — 204 No Content. No body. Mnemix summarizes in the background; the next recall_and_enrich for this caller reflects it.

GET /v1/caller/

Read-only profile fetch. No side effects — doesn't trigger enrichment, doesn't create a contact on a miss.

curl -sS https://mcp.mnemix.ai/v1/caller/+15551234567 \
  -H "Authorization: Bearer $MNEMIX_API_KEY"

Response — 200 OK:

{
  "name": "Mike Reynolds",
  "first_seen_ms": 1750000000000,
  "last_seen_ms": 1751000000000,
  "total_calls": 3,
  "tags": ["fleet", "commercial"],
  "custom_attributes": {}
}

404 if the number has never called — this endpoint never auto-creates. Use recall_and_enrich for that.

Errors

Every non-2xx response carries a machine-readable code:

{ "error": { "code": "validation_error", "message": "..." } }
StatusCodeMeaning
400bad_requestMalformed input — e.g. an unparseable phone number.
401unauthorizedMissing or invalid bearer token.
404not_foundGET /v1/caller/{phone_number} on an unknown caller.
422validation_errorRequest body fails schema validation.
429rate_limitedToken bucket exhausted; back off and retry.

Machine-readable spec

The same three endpoints, as OpenAPI: /.well-known/openapi.json. Codegen a typed client directly from it — the spec mirrors the same request schemas the API enforces.

Next steps