{"openapi":"3.0.3","info":{"title":"Chatora API","version":"1.0.0","description":"Read your workspace contacts, flows and conversations, and create contacts. Authenticate with a scoped API key created in Settings > API keys. Free, rate limited to 120 requests per 10 minutes per key. Creating a contact never sends a message."},"servers":[{"url":"https://chatora.us.ci"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key like chk_live_ followed by 40 hex characters. Scopes: contacts:read, contacts:write, flows:read, conversations:read, events:write, hooks:write, messages:write."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"handle":{"type":"string","nullable":true},"channel":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"fields":{"type":"object","additionalProperties":true},"last_seen":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"Flow":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string","enum":["live","paused","draft"]},"runs":{"type":"integer"},"steps":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}}},"Conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"contact_id":{"type":"string","format":"uuid"},"contact_name":{"type":"string"},"channel":{"type":"string"},"status":{"type":"string","enum":["open","ai","human","closed"]},"unread":{"type":"integer"},"last_at":{"type":"string","format":"date-time"}}},"Message":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"direction":{"type":"string","enum":["in","out"]},"author":{"type":"string","enum":["contact","ai","human"]},"body":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"NewContact":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":80},"handle":{"type":"string","maxLength":120},"channel":{"type":"string","maxLength":30},"tags":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":30}},"fields":{"type":"object","additionalProperties":true}}}}},"paths":{"/api/v1/contacts":{"get":{"summary":"List contacts","description":"Scope: contacts:read.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Match name or handle."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}}}}}},"401":{"description":"Missing or invalid key, or the key lacks the scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited"}}},"post":{"summary":"Create a contact","description":"Scope: contacts:write. Does not start a conversation or send a message. Free plan limit: 100 contacts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewContact"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"409":{"description":"A contact with this handle exists"},"422":{"description":"Invalid input or contact limit reached"}}}},"/api/v1/flows":{"get":{"summary":"List flows","description":"Scope: flows:read. Metadata only, no step text.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}}}}}}},"401":{"description":"Missing or invalid key, or the key lacks the scope"}}}},"/api/v1/conversations":{"get":{"summary":"List conversations","description":"Scope: conversations:read.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","ai","human","closed"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}}}}}}},"401":{"description":"Missing or invalid key, or the key lacks the scope"}}}},"/api/v1/conversations/{id}/messages":{"get":{"summary":"List messages of a conversation","description":"Scope: conversations:read. Newest first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}}}},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"404":{"description":"Conversation not found in this workspace"}}}},"/api/v1/events":{"post":{"summary":"Push a contact event","description":"Scope: events:write. Finds or creates the contact by handle, applies the side effect and starts matching live flows. Works as a Zapier/Make/n8n action. Limit: 60 per 10 minutes per key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","handle"],"properties":{"event":{"type":"string","enum":["tag-applied","tag-removed","field-changed","enroll","unenroll"]},"handle":{"type":"string","maxLength":120,"description":"Contact handle, e.g. tg:123456789, web:abcdef12 or an email."},"name":{"type":"string","maxLength":80},"channel":{"type":"string","maxLength":30},"key":{"type":"string","maxLength":60,"description":"Tag text, field name or flow id, depending on event."}}}}}},"responses":{"200":{"description":"Accepted; fired counts started flows."},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"404":{"description":"Contact not found (unenroll)"},"422":{"description":"Invalid input"},"429":{"description":"Rate limited"}}}},"/api/v1/hooks":{"get":{"summary":"List webhook subscriptions","description":"Scope: hooks:write.","responses":{"200":{"description":"OK"},"401":{"description":"Missing or invalid key, or the key lacks the scope"}}},"post":{"summary":"Subscribe a webhook (Zapier REST Hook)","description":"Scope: hooks:write. Chatora POSTs a JSON body (id, event, created_at, plus event fields) with an x-chatora-event header to target_url each time the event happens. Events: contact.created, message.received, event.received, flow.finished. Limit: 10 subscriptions per workspace.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","target_url"],"properties":{"event":{"type":"string","enum":["contact.created","message.received","event.received","flow.finished"]},"target_url":{"type":"string","format":"uri","description":"https URL, no port or credentials."}}}}}},"responses":{"200":{"description":"Created"},"201":{"description":"Created"},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"422":{"description":"Invalid event or URL, or the subscription limit is reached"}}}},"/api/v1/hooks/{id}":{"delete":{"summary":"Unsubscribe a webhook (Zapier REST Hook)","description":"Scope: hooks:write.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted"},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"404":{"description":"Webhook not found in this workspace"}}}},"/api/v1/hooks/samples":{"get":{"summary":"Recent events (Zapier sample data)","description":"Scope: hooks:write. Returns a bare JSON array of the 20 newest delivered events, newest first; use as the REST Hook perform list.","parameters":[{"name":"event","in":"query","schema":{"type":"string","enum":["contact.created","message.received","event.received","flow.finished"]}}],"responses":{"200":{"description":"OK"},"401":{"description":"Missing or invalid key, or the key lacks the scope"}}}},"/api/v1/messages/send":{"post":{"summary":"Send a Telegram message","description":"Scope: messages:write. Sends through the workspace Telegram bot or connected OpenWA gateway to a contact the workspace already has (handle like tg:123456789 or wa:2010XXXXXXXX). Never messages arbitrary chat ids. Limit: 30 per 10 minutes per key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["handle","text"],"properties":{"handle":{"type":"string","pattern":"^tg:-?[0-9]{1,20}$"},"text":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"Sent"},"401":{"description":"Missing or invalid key, or the key lacks the scope"},"404":{"description":"Contact not found"},"409":{"description":"No Telegram bot connected"},"429":{"description":"Rate limited"}}}}}}