{"openapi":"3.1.0","info":{"title":"Mnemix Caller Intelligence API","version":"1.0.0-alpha","description":"Caller memory and enrichment endpoints for AI voice agents.","x-mnemix-canonical":"https://mnemix.ai/agents.json"},"servers":[{"url":"https://mnemix-api.sayeed965.workers.dev"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/recall_and_enrich":{"post":{"operationId":"recallAndEnrich","summary":"Recall memory and enrich caller identity before a turn.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["phone_number","tenant_id"],"properties":{"phone_number":{"type":"string","description":"Caller phone number in E.164 format.","examples":["+15551234567"]},"tenant_id":{"type":"string","description":"Tenant or workspace identifier."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Caller context for the voice agent.","content":{"application/json":{"schema":{"type":"object","required":["caller","memories","enrichment"],"properties":{"caller":{"$ref":"#/components/schemas/Caller"},"memories":{"type":"array","items":{"$ref":"#/components/schemas/Memory"}},"enrichment":{"$ref":"#/components/schemas/Enrichment"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/calls/end":{"post":{"operationId":"endCall","summary":"Persist call summary and terminal memory observations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["call_id","summary"],"properties":{"call_id":{"type":"string","description":"Stable call identifier from the voice stack."},"summary":{"type":"string","description":"Final call summary."},"tenant_id":{"type":"string"},"phone_number":{"type":"string","description":"Caller phone number in E.164 format."},"metadata":{"type":"object","additionalProperties":true}},"additionalProperties":true}}}},"responses":{"204":{"description":"Call memory persisted."},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/caller/{phone_number}":{"get":{"operationId":"getCaller","summary":"Fetch caller profile and last seen timestamp.","parameters":[{"name":"phone_number","in":"path","required":true,"description":"Caller phone number in E.164 format.","schema":{"type":"string"},"examples":{"us":{"value":"+15551234567"}}}],"responses":{"200":{"description":"Caller profile.","content":{"application/json":{"schema":{"type":"object","required":["caller","last_seen"],"properties":{"caller":{"$ref":"#/components/schemas/Caller"},"last_seen":{"type":"string","format":"date-time","nullable":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Caller not found."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"Unauthorized":{"description":"Missing or invalid bearer token."}},"schemas":{"Caller":{"type":"object","properties":{"phone_number":{"type":"string"},"name":{"type":"string","nullable":true},"line_type":{"type":"string","nullable":true},"carrier":{"type":"string","nullable":true},"company":{"type":"string","nullable":true}},"additionalProperties":true},"Memory":{"type":"object","properties":{"id":{"type":"string"},"fact":{"type":"string"},"confidence":{"type":"number"},"observed_at":{"type":"string","format":"date-time"}},"additionalProperties":true},"Enrichment":{"type":"object","properties":{"phone_lookup":{"type":"object","additionalProperties":true},"person":{"type":"object","additionalProperties":true},"call_intent":{"type":"object","additionalProperties":true}},"additionalProperties":true}}}}