{"openapi":"3.1.0","info":{"title":"Cael API","summary":"Plan date nights and read plans and the partner file in a person's Cael account.","description":"Cael is the date planner you text: it plans the whole night, books it once the person says go, and remembers what their partner loves. This API works on one person's Cael account, with their personal API key. Errors are JSON: `{\"error\": {\"code\", \"message\", \"status\", \"hint\", \"docs\"}, \"detail\"}`.\n\nNothing is booked, bought or sent without the person's go-ahead. Guide: https://caelagent.com/developers. AI assistants connect through the MCP endpoint.","termsOfService":"https://caelagent.com/terms","contact":{"name":"Cael developer support","url":"https://caelagent.com/developers","email":"alec@caelagent.com"},"version":"1.0.0"},"servers":[{"url":"https://caelagent.com","description":"Cael"}],"paths":{"/api/v1/message":{"post":{"tags":["public-api"],"summary":"Send Cael a message","description":"Runs Cael on the text exactly as if the person had texted it, and returns the reply. Use it to plan a date (\"plan a cozy dinner Saturday in Philly\"), ask about their plans, or ask what their partner likes. Without the agent:act scope Cael uses read-only tools; `deliver: true` needs message:deliver. Nothing is booked without the person's go-ahead. Limit: 20 a minute and 300 an hour per key, plus the account's daily quota.","operationId":"sendMessage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"401":{"description":"Missing, malformed or unknown API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key lacks the scope this call needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request didn't match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or daily quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"caelApiKey":["agent:read"]}]}},"/api/v1/plans":{"get":{"tags":["public-api"],"summary":"List date plans","description":"The person's date plans in Cael, newest first. Use getPlan for one plan's stops.","operationId":"listPlans","security":[{"caelApiKey":["agent:read"]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"How many plans to return, newest first.","default":10,"title":"Limit"},"description":"How many plans to return, newest first."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanList"}}}},"401":{"description":"Missing, malformed or unknown API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key lacks the scope this call needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request didn't match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or daily quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/plans/{plan_id}":{"get":{"tags":["public-api"],"summary":"Get a date plan","description":"One of the person's plans with every stop, its time, why it was picked and whether it's booked. `booked` is true only when Cael's booking went through.","operationId":"getPlan","security":[{"caelApiKey":["agent:read"]}],"parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The plan's id, from listPlans.","title":"Plan Id"},"description":"The plan's id, from listPlans."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOut"}}}},"401":{"description":"Missing, malformed or unknown API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key lacks the scope this call needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request didn't match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or daily quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No plan with that id in this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/partner":{"get":{"tags":["public-api"],"summary":"Get the partner file","description":"What Cael knows about the person's partner: name, favorite foods, things to avoid, allergies, places they want to try and important dates. `partner` is null when there's no partner file yet.","operationId":"getPartnerFile","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerFileOut"}}}},"401":{"description":"Missing, malformed or unknown API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key lacks the scope this call needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request didn't match the schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or daily quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"caelApiKey":["agent:read"]}]}},"/mcp":{"post":{"operationId":"callMcp","summary":"Cael MCP server (for AI assistants)","description":"The Model Context Protocol endpoint (streamable HTTP, JSON responses). Connect an MCP client here rather than calling it by hand: it lists Cael's tools (plan_date, list_plans, get_plan, get_partner_file, add_to_partner_file, lookup_place, find_events). Setup for each assistant: https://caelagent.com/ai","tags":["mcp"],"servers":[{"url":"https://backend-production-f9bda.up.railway.app"}],"security":[{"caelOAuth":["cael"]},{"caelApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"A JSON-RPC 2.0 request, such as tools/list or tools/call.","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","integer"]},"method":{"type":"string","examples":["tools/list"]},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"The JSON-RPC response.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Not signed in. The WWW-Authenticate header points to the protected resource metadata that starts the sign-in."}}}}},"components":{"schemas":{"ErrorInfo":{"properties":{"code":{"type":"string","title":"Code","description":"Stable machine-readable code, like not_found or insufficient_scope.","examples":["unauthenticated"]},"message":{"type":"string","title":"Message","description":"What went wrong, in plain words."},"status":{"type":"integer","title":"Status","description":"The HTTP status code."},"hint":{"type":"string","title":"Hint","description":"What to do about it."},"docs":{"type":"string","title":"Docs","description":"Where the API is documented."}},"type":"object","required":["code","message","status","hint","docs"],"title":"ErrorInfo"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"},"detail":{"title":"Detail","description":"FastAPI's own detail: the message, or for 422 the list of field errors."}},"type":"object","required":["error"],"title":"ErrorResponse"},"MessageIn":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text","description":"What to tell Cael, in plain words.","examples":["Plan a cozy dinner date Saturday in Philly, around $150"]},"deliver":{"type":"boolean","title":"Deliver","description":"Also send the reply to the person's chat. Needs the message:deliver scope.","default":false}},"type":"object","required":["text"],"title":"MessageIn"},"MessageOut":{"properties":{"reply":{"type":"string","title":"Reply","description":"Cael's reply."},"delivered":{"type":"boolean","title":"Delivered","description":"Whether the reply was also sent to the person's chat."}},"type":"object","required":["reply","delivered"],"title":"MessageOut"},"Occasion":{"properties":{"kind":{"type":"string","title":"Kind","description":"birthday, anniversary or another kind of date."},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"month":{"type":"integer","title":"Month"},"day":{"type":"integer","title":"Day"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"}},"type":"object","required":["kind","month","day"],"title":"Occasion"},"Partner":{"properties":{"name":{"type":"string","title":"Name"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"pronoun":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pronoun"},"relationship_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relationship Stage"},"is_primary":{"type":"boolean","title":"Is Primary"},"details":{"additionalProperties":true,"type":"object","title":"Details","description":"Foods they love or avoid, allergies, places they want to try and more."},"occasions":{"items":{"$ref":"#/components/schemas/Occasion"},"type":"array","title":"Occasions"}},"type":"object","required":["name","is_primary","details","occasions"],"title":"Partner"},"PartnerFileOut":{"properties":{"partner":{"anyOf":[{"$ref":"#/components/schemas/Partner"},{"type":"null"}]}},"type":"object","required":["partner"],"title":"PartnerFileOut"},"Plan":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"date_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Label"},"time_span":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time Span"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"budget":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Budget","description":"Estimated cost of the night."},"partner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Name"},"surprise":{"type":"boolean","title":"Surprise","description":"Whether it's a surprise kept from the partner."},"stops":{"items":{"$ref":"#/components/schemas/Stop"},"type":"array","title":"Stops"},"url":{"type":"string","title":"Url","description":"The plan in Cael, where the person books, changes or shares it."}},"type":"object","required":["id","title","surprise","stops","url"],"title":"Plan"},"PlanList":{"properties":{"plans":{"items":{"$ref":"#/components/schemas/PlanSummary"},"type":"array","title":"Plans"}},"type":"object","required":["plans"],"title":"PlanList"},"PlanOut":{"properties":{"plan":{"$ref":"#/components/schemas/Plan"}},"type":"object","required":["plan"],"title":"PlanOut"},"PlanSummary":{"properties":{"id":{"type":"string","title":"Id","description":"The plan's id."},"title":{"type":"string","title":"Title"},"date_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Label","description":"When it's for, like \"Saturday, Oct 10\"."},"stops":{"type":"integer","title":"Stops","description":"How many stops the plan has."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When the plan was made (ISO 8601, UTC)."}},"type":"object","required":["id","title","stops"],"title":"PlanSummary"},"Stop":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Time","description":"When to be there, like \"7:15 pm\"."},"why":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Why","description":"Why Cael picked it."},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"verified":{"type":"boolean","title":"Verified","description":"Whether Cael checked the place is open at that time."},"open_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Open Note"},"booked":{"type":"boolean","title":"Booked","description":"True only when Cael's booking actually went through."}},"type":"object","required":["name","verified","booked"],"title":"Stop"}},"securitySchemes":{"caelApiKey":{"type":"http","scheme":"bearer","bearerFormat":"Cael API key (cael_…)","description":"A personal API key, made at https://caelagent.com/dashboard/integrations and shown once. Each key carries scopes, listed per operation:\n- `agent:read`: Read plans and the partner file, and ask Cael questions. Every key has it.\n- `agent:act`: Let Cael take actions (like setting reminders) when answering a message.\n- `message:deliver`: Also send Cael's reply to the person's own chat (iMessage, WhatsApp or Telegram)."},"caelOAuth":{"type":"oauth2","description":"\"Sign in with Cael\": OAuth 2.1 authorization code with PKCE (S256) and dynamic client registration (https://caelagent.com/oauth/register). Metadata: https://caelagent.com/.well-known/oauth-authorization-server. Tokens are issued for the MCP endpoint, and registration is open to the AI assistants Cael supports.","flows":{"authorizationCode":{"authorizationUrl":"https://caelagent.com/oauth/authorize","tokenUrl":"https://caelagent.com/oauth/token","refreshUrl":"https://caelagent.com/oauth/token","scopes":{"cael":"Plan dates, read the person's plans and partner file, add to the partner file, and look up places and events. Never books, buys or sends anything."}}}}}},"tags":[{"name":"public-api","description":"Plans, the partner file and messages."},{"name":"mcp","description":"The endpoint AI assistants connect to."}],"externalDocs":{"description":"Cael developer docs","url":"https://caelagent.com/developers"}}