{"openapi":"3.1.0","info":{"title":"Concya Muse Connector API","version":"1.0.0","description":"Partner surface for Meta's Muse agent. Mirrors the Concya Manager Chat: send a message to the house GM, read the ops brief, and act on pending approvals. Mutations stay behind the operator approval ledger — a chat turn stages them, an approve call executes them."},"servers":[{"url":"https://muse.concya.com"}],"security":[{"bearerAuth":[]}],"paths":{"/chat":{"post":{"operationId":"sendChatMessage","summary":"Send a message to the house GM","description":"Runs one Manager Chat turn for the venue: deterministic ops paths (86s, coverage, EOD, facilities intake) first, then the agent tool loop. Replies arrive whole. Actions that spend money, message staff, or change schedules are staged as approvals, not executed — check GET /approvals afterwards.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"The completed turn","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/brief":{"get":{"operationId":"getOpsBrief","summary":"House ops brief","description":"Pulse line, open workflow, pending approval, and open incident count for the venue. Read-only.","parameters":[{"$ref":"#/components/parameters/RestaurantId"}],"responses":{"200":{"description":"The ops brief","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/approvals":{"get":{"operationId":"listApprovals","summary":"List pending approvals","description":"Staged and processing approvals waiting on an operator decision for the venue. Approve or reject each by id.","parameters":[{"$ref":"#/components/parameters/RestaurantId"}],"responses":{"200":{"description":"Pending approvals","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/approvals/{id}/approve":{"post":{"operationId":"approveAction","summary":"Execute a staged approval","description":"Claims and runs the pending action — sends the staff text, books the vendor, publishes the schedule. Vendor campaigns accept an optional selected vendor override.","parameters":[{"$ref":"#/components/parameters/ApprovalId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionRequest"}}}},"responses":{"200":{"description":"Approval executed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"$ref":"#/components/responses/Gone"}}}},"/approvals/{id}/reject":{"post":{"operationId":"rejectAction","summary":"Cancel a staged approval","parameters":[{"$ref":"#/components/parameters/ApprovalId"}],"responses":{"200":{"description":"Approval rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/openapi.json":{"get":{"operationId":"getOpenAPISpec","summary":"This document","security":[],"responses":{"200":{"description":"The OpenAPI specification"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"MUSE_API_SECRET partner credential"}},"parameters":{"RestaurantId":{"name":"restaurant_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The Concya venue id"},"ApprovalId":{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Approval id from GET /approvals"}},"responses":{"BadRequest":{"description":"Missing or invalid parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid bearer credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Valid credential, no access to this venue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Approval not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Approval already claimed or no longer pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Gone":{"description":"Approval expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Turn budget exceeded — retry shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"Runtime disabled or the partner credential is not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"reason":{"type":"string"}},"required":["error"]},"ChatRequest":{"type":"object","required":["restaurant_id","message"],"properties":{"restaurant_id":{"type":"string","format":"uuid"},"message":{"type":"string","description":"What the operator asked, in plain language"},"include_ops":{"type":"boolean","description":"Include the ops brief on the response","default":false},"active_plugin_ids":{"type":"array","items":{"type":"string"},"description":"Connected integration ids to pin for this turn"}}},"ChatResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"replies":{"type":"array","items":{"type":"string"},"description":"The GM reply text — one entry per bubble"},"routed":{"type":"string"},"action":{"type":["string","null"],"description":"The lane that handled the turn"},"card":{"type":["object","null"],"description":"Structured card (incident case) when present"},"agent_run":{"type":["object","null"],"description":"Marketplace agent run result when present"},"tool_calls":{"type":"array","items":{"type":"string"}},"approvals_staged":{"type":"array","description":"Approvals this turn staged for an operator decision — execute or cancel via /approvals/{id}/approve|reject","items":{"type":"object","properties":{"approval_id":{"type":"string"},"tool":{"type":"string"},"summary":{"type":"string"},"confirm_prompt":{"type":"string"}}}},"ops":{"type":["object","null"],"description":"Ops brief, present when include_ops was set"},"latency_ms":{"type":"integer"}}},"BriefResponse":{"type":"object","properties":{"ops":{"type":"object","description":"Pulse, open workflow, pending approval, open incident count"}}},"Approval":{"type":"object","properties":{"id":{"type":"string"},"restaurantId":{"type":"string"},"actionType":{"type":"string"},"channel":{"type":["string","null"]},"summary":{"type":["string","null"]},"targetType":{"type":["string","null"]},"targetId":{"type":["string","null"]},"targetLabel":{"type":["string","null"]},"status":{"type":"string","enum":["staged","processing"]},"expiresAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":["string","null"],"format":"date-time"},"incidentId":{"type":["string","null"]}}},"ApprovalsResponse":{"type":"object","properties":{"approvals":{"type":"array","items":{"$ref":"#/components/schemas/Approval"}}}},"ApprovalDecisionRequest":{"type":"object","properties":{"restaurant_id":{"type":"string","format":"uuid"},"selected_vendor_name":{"type":"string"},"selected_vendor_index":{"type":"integer"}}},"ApprovalDecisionResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"approval_id":{"type":"string"},"status":{"type":"string","enum":["executed","rejected","failed"]},"message":{"type":"string"},"reason":{"type":"string"}}}}}}