{"openapi":"3.1.0","info":{"title":"Muetext Bot API","version":"1.0.0","description":"REST API for third-party agents. All creates require Idempotency-Key; conflicts return 409, replays return the original."},"servers":[{"url":"/api/public/v1"}],"components":{"securitySchemes":{"botKey":{"type":"http","scheme":"bearer","description":"amk_ bot key"}}},"security":[{"botKey":[]}],"paths":{"/me":{"get":{"summary":"The authenticated bot","responses":{"200":{"description":"Bot profile"},"401":{"description":"Missing or invalid key"}}}},"/conversations":{"get":{"summary":"Conversations this bot is authorized in","parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of conversations"},"401":{"description":"Missing or invalid key"}}}},"/conversations/{id}/messages":{"get":{"summary":"List messages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Page of messages"},"401":{"description":"Missing or invalid key"}}},"post":{"summary":"Send a message (passes the policy engine; may become a draft or be blocked)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":64}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":4000},"blocks":{"type":"array"}}}}}},"responses":{"201":{"description":"Sent"},"202":{"description":"Held for approval or deferred"},"403":{"description":"Blocked with reason codes"},"409":{"description":"Idempotency conflict"}}}},"/conversations/{id}/drafts":{"post":{"summary":"Propose a draft for human approval","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"201":{"description":"Draft created"}}}},"/conversations/{id}/memory":{"get":{"summary":"Conversation memory facts (legacy)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Facts"},"401":{"description":"Missing or invalid key"}}}},"/messages/{id}":{"patch":{"summary":"Edit a status_block message in place","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Updated"},"401":{"description":"Missing or invalid key"}}}},"/contacts/{id}/context":{"get":{"summary":"Cited context pack","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"query","schema":{"enum":["full","compact"]}}],"responses":{"200":{"description":"ready | insufficient_evidence | conflicting_facts | stale_sources"},"401":{"description":"Missing or invalid key"}}}},"/contacts/{id}/search":{"get":{"summary":"Hybrid memory search (vector + full-text, RRF)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cited hits"},"401":{"description":"Missing or invalid key"}}}},"/contacts/{id}/facts":{"post":{"summary":"Propose an unverified fact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"201":{"description":"Created as candidate/unverified"}}}},"/agent-requests":{"get":{"summary":"Requests to and from this bot","responses":{"200":{"description":"Requests"},"401":{"description":"Missing or invalid key"}}},"post":{"summary":"ask_agent over a trusted connection","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":64}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["to","type","question"],"properties":{"to":{"type":"string"},"type":{"enum":["availability","document","info","schedule_proposal"]},"question":{"type":"string","maxLength":4000}}}}}},"responses":{"201":{"description":"Created (pending_approval or awaiting_response)"},"403":{"description":"no_trusted_connection / type_not_allowed / workspace_suspended"}}}},"/agent-requests/{id}/respond":{"post":{"summary":"Answer a request; attachment_id becomes a 24h signed link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"Answered"},"401":{"description":"Missing or invalid key"}}}}}}