{"openapi":"3.1.0","info":{"title":"answerable API","version":"1.0.0","description":"Work with answerable's tickets from your own tools and agents. Authenticate with an API key (Your account → API keys) or an OAuth access token issued for this API. Limits are per key and per workspace; responses carry RateLimit headers, and 429 responses say when to retry in Retry-After."},"servers":[{"url":"https://staging.preview.answerable.co/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key, or an OAuth access token. Scopes: tickets:read, tickets:draft, tickets:investigate, tickets:manage, tickets:send, tickets:act, tickets:import, tickets:receive, agent:read, agent:configure, workspace:configure, help:read, help:write, help:publish."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}},"paths":{"/workspaces":{"get":{"operationId":"listWorkspaces","summary":"List workspaces","description":"The workspaces this key or connection can reach, each with its own inbox and agent, and how many tickets in each wait for you.","x-required-scope":"tickets:read","security":[{"bearer":["tickets:read"]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspaces":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"waitingForYou":{"type":"number","description":"Tickets waiting for you: they need a person, and no one else on the team has them. List them with list_tickets and waitingForYou."},"testMode":{"type":"boolean","description":"In test mode, replies are emailed only to the workspace's members; to anyone else they're kept in the conversation, unsent (delivery HELD). The team turns it off in answerable when they go live."}},"required":["slug","name","url","waitingForYou","testMode"],"additionalProperties":false}}},"required":["workspaces"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/tickets":{"get":{"operationId":"listTickets","summary":"List tickets","description":"Tickets in a view, or only those waiting for you, assigned to someone, or changed since a time; latest message first. Follow nextCursor for more.","x-required-scope":"tickets:read","security":[{"bearer":["tickets:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"view","in":"query","required":false,"schema":{"default":"attention","description":"attention: tickets that need a person (Your turn). open: not closed yet. done: closed. all, spam, trash.","type":"string","enum":["attention","open","done","all","spam","trash"]},"description":"attention: tickets that need a person (Your turn). open: not closed yet. done: closed. all, spam, trash."},{"name":"status","in":"query","required":false,"schema":{"description":"Only tickets with this status.","type":"string","enum":["OPEN","WAITING","CLOSED"]},"description":"Only tickets with this status."},{"name":"resolvedBy","in":"query","required":false,"schema":{"description":"Only closed tickets resolved by answerable's agent on its own (\"agent\") or by a person (\"person\").","type":"string","enum":["agent","person"]},"description":"Only closed tickets resolved by answerable's agent on its own (\"agent\") or by a person (\"person\")."},{"name":"type","in":"query","required":false,"schema":{"description":"Only tickets of this type, by its id (see get_agent), e.g. BILLING.","type":"string","maxLength":40},"description":"Only tickets of this type, by its id (see get_agent), e.g. BILLING."},{"name":"waitingForYou","in":"query","required":false,"schema":{"default":false,"description":"Only tickets waiting for you: they need a person, and no one else on the team has them. list_workspaces counts them.","type":"boolean"},"description":"Only tickets waiting for you: they need a person, and no one else on the team has them. list_workspaces counts them."},{"name":"assignee","in":"query","required":false,"schema":{"description":"Only tickets assigned to you (\"me\"), to no one (\"unassigned\"), or to a teammate, by email address.","anyOf":[{"type":"string","const":"me"},{"type":"string","const":"unassigned"},{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}]},"description":"Only tickets assigned to you (\"me\"), to no one (\"unassigned\"), or to a teammate, by email address."},{"name":"changedSince","in":"query","required":false,"schema":{"description":"Only tickets that changed after this time (ISO 8601): a new message, the agent, or a teammate. Pass the time of your last check to see what's new.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only tickets that changed after this time (ISO 8601): a new message, the agent, or a teammate. Pass the time of your last check to see what's new."},{"name":"query","in":"query","required":false,"schema":{"description":"Words to find in the subject, the customer's name or email, or the messages. A customer's email address finds their tickets.","type":"string","maxLength":200},"description":"Words to find in the subject, the customer's name or email, or the messages. A customer's email address finds their tickets."},{"name":"sort","in":"query","required":false,"schema":{"default":"newest","description":"By latest message. oldest first works through what's waiting in order.","type":"string","enum":["newest","oldest"]},"description":"By latest message. oldest first works through what's waiting in order."},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"description":"From the previous page's nextCursor.","type":"string","maxLength":200},"description":"From the previous page's nextCursor."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"state":{"type":"string","description":"Where it stands, e.g. \"Awaiting approval\" or \"Needs a person\"."},"typeId":{"description":"The ticket's type, by id (see get_agent).","type":["string","null"]},"type":{"description":"The ticket's type, by name, e.g. \"Billing and subscriptions\".","type":["string","null"]},"spam":{"type":"boolean"},"automatic":{"type":"boolean","description":"Sent by a system rather than a person, e.g. a notification."},"customer":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate the ticket is assigned to, if anyone."},"summary":{"description":"The agent's summary of the request.","type":["string","null"]},"preview":{"type":"string"},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"],"description":"APPROVAL: a reply waits for approval. PERSON: the agent handed the ticket to a person. SPAM_REVIEW: possible spam to confirm. FAILED: an investigation failed."},"reason":{"description":"Why, when answerable knows: the safeguard that held the reply, what the agent couldn't do, or what failed.","type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What the ticket waits on a person for, when it does."},"draft":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["ANSWER","FOLLOW_UP"]}},"required":["kind"],"additionalProperties":false},{"type":"null"}],"description":"The reply waiting for approval, if one is: an ANSWER, or a FOLLOW_UP question. Read it with get_tickets."},"lastMessageAt":{"type":"string"},"changedAt":{"type":"string","description":"When anything about the ticket last changed: a message, the agent, or a teammate."},"url":{"type":"string","description":"The ticket in answerable."}},"required":["number","subject","status","state","typeId","type","spam","automatic","customer","assignee","summary","preview","waiting","draft","lastMessageAt","changedAt","url"],"additionalProperties":false}},"nextCursor":{"type":["string","null"]}},"required":["tickets","nextCursor"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateTickets","summary":"Update tickets","description":"Close or reopen one or more tickets, move them to Spam or out of it, assign them, add a note, block their sender or send the sender's email to Spam, have answerable's agent investigate again, or hand them back to it with an `instruction`. Only the fields you send change. With `investigate` or `instruction`, `draftOnly` keeps the agent's reply as a draft, and `wait` waits for it to finish. `investigate` and `instruction` need tickets:investigate; the rest, and `instruction` too, need tickets:manage. Tickets that can't change are listed in `failed`; the others still do.","x-required-scope":["tickets:manage","tickets:investigate"],"security":[{"bearer":["tickets:manage"]},{"bearer":["tickets:investigate"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"numbers":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The tickets to change, by number: up to 50."},"status":{"description":"CLOSED closes a ticket without replying; a proposed reply stays on it, unsendable until it's reopened. OPEN reopens a closed ticket.","type":"string","enum":["OPEN","CLOSED"]},"spam":{"description":"true moves the ticket to Spam, which closes it. false takes it out of Spam and has answerable's agent investigate it.","type":"boolean"},"assignee":{"description":"A teammate's email address, to give them the ticket: the agent's replies to it then wait for their approval. null gives it back to the agent.","anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"note":{"description":"A note for the team, added to each ticket as yours. Customers never see notes; answerable's agent reads them.","type":"string","minLength":1,"maxLength":10000},"mergeInto":{"description":"Merge each ticket into this one, by number: it closes without a reply, its messages move there, and later replies to its email go there too. Use it when a customer wrote in again about the same thing. Another customer's ticket works too. If the merged ticket still waited for an answer, the other is investigated again with both. null takes a merged ticket back out: its messages return and it reopens.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},{"type":"null"}]},"relatedTo":{"description":"Link each ticket to this one as related, such as two people reporting the same problem. Nothing else changes.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"notRelatedTo":{"description":"Remove the related link between each ticket and this one.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sender":{"description":"What happens to the email of each ticket's customer from now on. blocked: it's ignored, with no ticket. spam: it goes straight to Spam, and so do their open tickets. normal: undoes either. Their other tickets stay as they are.","type":"string","enum":["blocked","spam","normal"]},"investigate":{"description":"true has answerable's agent investigate the ticket again from scratch, with its latest settings. The ticket's investigation (get_tickets) says when it's done. Needs the Investigate permission.","type":"boolean"},"instruction":{"description":"Hand the ticket back to answerable's agent with what to do next, e.g. \"Ask which plan they're on\". It's added as your note, and the ticket is reopened, unassigned, taken out of Spam and investigated; the agent's reply then goes out or waits for approval under its settings, or always waits with draftOnly. Needs the Investigate permission too.","type":"string","minLength":1,"maxLength":2000},"draftOnly":{"default":false,"description":"With investigate or instruction: the agent's reply waits for approval as a draft, even where its settings would send it. Read it with get_tickets, then send or edit it.","type":"boolean"},"wait":{"default":false,"description":"With investigate or instruction: wait up to 50 seconds for answerable's agent to finish, so the tickets come back with its draft or decision. Those still investigating then are in stillInvestigating; read them again with get_tickets and wait.","type":"boolean"}},"required":["numbers"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"state":{"type":"string","description":"Where it stands, e.g. \"Awaiting approval\" or \"Needs a person\"."},"typeId":{"description":"The ticket's type, by id (see get_agent).","type":["string","null"]},"type":{"description":"The ticket's type, by name, e.g. \"Billing and subscriptions\".","type":["string","null"]},"spam":{"type":"boolean"},"automatic":{"type":"boolean","description":"Sent by a system rather than a person, e.g. a notification."},"customer":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate the ticket is assigned to, if anyone."},"summary":{"description":"The agent's summary of the request.","type":["string","null"]},"preview":{"type":"string"},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"],"description":"APPROVAL: a reply waits for approval. PERSON: the agent handed the ticket to a person. SPAM_REVIEW: possible spam to confirm. FAILED: an investigation failed."},"reason":{"description":"Why, when answerable knows: the safeguard that held the reply, what the agent couldn't do, or what failed.","type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What the ticket waits on a person for, when it does."},"draft":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["ANSWER","FOLLOW_UP"]}},"required":["kind"],"additionalProperties":false},{"type":"null"}],"description":"The reply waiting for approval, if one is: an ANSWER, or a FOLLOW_UP question. Read it with get_tickets."},"lastMessageAt":{"type":"string"},"changedAt":{"type":"string","description":"When anything about the ticket last changed: a message, the agent, or a teammate."},"url":{"type":"string","description":"The ticket in answerable."}},"required":["number","subject","status","state","typeId","type","spam","automatic","customer","assignee","summary","preview","waiting","draft","lastMessageAt","changedAt","url"],"additionalProperties":false},"description":"The tickets that changed, or already were as asked, as they are now."},"failed":{"type":"array","items":{"type":"object","properties":{"number":{"type":"number"},"error":{"type":"string"}},"required":["number","error"],"additionalProperties":false},"description":"Tickets left as they were, and why."},"stillInvestigating":{"description":"With wait: tickets answerable's agent was still investigating when the wait ended. Read them with get_tickets and wait.","type":"array","items":{"type":"number"}}},"required":["tickets","failed"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"startTicket","summary":"Email a customer first","description":"Start a ticket by emailing a customer, new or known. It starts closed, and their reply reopens it. Send an `Idempotency-Key` header so a retried request can't send twice.","x-required-scope":"tickets:send","security":[{"bearer":["tickets:send"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Repeating a request with the same key sends nothing new."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"The customer's email address. Their reply comes back to the new ticket."},"name":{"description":"The customer's name, if answerable doesn't know it yet.","type":"string","maxLength":200},"subject":{"type":"string","minLength":1,"maxLength":300,"description":"The email's subject."},"body":{"type":"string","minLength":1,"maxLength":50000,"description":"The email, with greeting and sign-off. Plain text, or Markdown's **bold**, _italic_, [links](https://…), and - or 1. lists, used sparingly; every line break is kept and the rest of Markdown shows as typed."}},"required":["to","subject","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"number","description":"The ticket, e.g. a new ticket's number."},"messageId":{"description":"null for a duplicate, or for a draft with actions: it goes out once they've run.","type":["string","null"]},"duplicate":{"type":"boolean","description":"true when this was sent already, so nothing new went out."},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["QUEUED","SENT","DELIVERED","HELD","FAILED"],"description":"QUEUED: going out now. HELD: kept in the conversation and not emailed, e.g. in test mode. FAILED: couldn't be sent."},"reason":{"description":"Why it was held or failed, e.g. \"test mode\".","type":["string","null"]}},"required":["status","reason"],"additionalProperties":false},{"type":"null"}],"description":"What happens to the email; null for a duplicate or a draft with actions. Tell the person when it was held: the customer didn't get it."},"url":{"type":"string"}},"required":["number","messageId","duplicate","delivery","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/tickets/{number}":{"get":{"operationId":"getTicket","summary":"Get a ticket","description":"The conversation with links to its files, what answerable's agent found, the current draft, the team's notes, the history, and the customer's earlier tickets. `include` (comma-separated) also looks up the customer's account or billing; `wait=true` first waits for an investigation to finish.","x-required-scope":"tickets:read","security":[{"bearer":["tickets:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The ticket's number, e.g. 42 for #42."},{"name":"include","in":"query","required":false,"schema":{"default":[],"description":"Also look up the customer's account (from the agent's account lookup) or their billing (from Stripe), as the ticket screen shows them. Each asks the company's systems, so only include what you need.","maxItems":2,"type":"array","items":{"type":"string","enum":["account","billing"]}},"description":"Also look up the customer's account (from the agent's account lookup) or their billing (from Stripe), as the ticket screen shows them. Each asks the company's systems, so only include what you need."},{"name":"wait","in":"query","required":false,"schema":{"default":false,"description":"Wait up to 50 seconds for answerable's agent to finish investigating before answering, instead of reading the ticket again later. If it's still investigating then, wait again.","type":"boolean"},"description":"Wait up to 50 seconds for answerable's agent to finish investigating before answering, instead of reading the ticket again later. If it's still investigating then, wait again."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"state":{"type":"string","description":"Where it stands, e.g. \"Awaiting approval\" or \"Needs a person\"."},"typeId":{"description":"The ticket's type, by id (see get_agent).","type":["string","null"]},"type":{"description":"The ticket's type, by name, e.g. \"Billing and subscriptions\".","type":["string","null"]},"spam":{"type":"boolean"},"automatic":{"type":"boolean","description":"Sent by a system rather than a person, e.g. a notification."},"customer":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate the ticket is assigned to, if anyone."},"summary":{"description":"The agent's summary of the request.","type":["string","null"]},"preview":{"type":"string"},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"],"description":"APPROVAL: a reply waits for approval. PERSON: the agent handed the ticket to a person. SPAM_REVIEW: possible spam to confirm. FAILED: an investigation failed."},"reason":{"description":"Why, when answerable knows: the safeguard that held the reply, what the agent couldn't do, or what failed.","type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What the ticket waits on a person for, when it does."},"draft":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"},"kind":{"type":"string","enum":["ANSWER","FOLLOW_UP"]},"body":{"type":"string"},"stale":{"type":"boolean","description":"The customer wrote after it; it can't be sent."},"by":{"type":"string"},"cc":{"type":"array","items":{"type":"string"},"description":"Who it copies besides the customer."},"translation":{"description":"What the agent's reply says in the team's language, when it wrote in another and the body is still its text.","type":["string","null"]}},"required":["id","version","kind","body","stale","by","cc","translation"],"additionalProperties":false},{"type":"null"}]},"lastMessageAt":{"type":"string"},"changedAt":{"type":"string","description":"When anything about the ticket last changed: a message, the agent, or a teammate."},"url":{"type":"string","description":"The ticket in answerable."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when drafting or sending."},"language":{"description":"The language the customer writes in, as an ISO 639-1 code (\"de\"), when it could be told.","type":["string","null"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string","enum":["customer","team"]},"author":{"type":"string","description":"The customer, answerable's agent, or a teammate (and the app they used)."},"sentAt":{"type":"string"},"text":{"type":"string","description":"What the sender wrote, without the earlier conversation their email quoted."},"quoted":{"type":["string","null"]},"language":{"description":"The language it's written in (ISO 639-1), when it could be told.","type":["string","null"]},"translation":{"description":"What it says in the team's language, when it's written in another and answerable translated it for the team.","type":["string","null"]},"delivery":{"anyOf":[{"type":"string","enum":["QUEUED","SENT","DELIVERED","HELD","FAILED"]},{"type":"null"}],"description":"For the team's replies: HELD was kept in the conversation, not emailed."},"deliveryReason":{"description":"Why it was held or failed, e.g. \"test mode\".","type":["string","null"]},"cc":{"type":"array","items":{"type":"string"},"description":"Who the email copied."},"site":{"anyOf":[{"type":"object","properties":{"page":{"description":"The page it was sent from, without its query.","type":["string","null"]},"context":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},{"type":"null"}],"description":"What the site said about the customer (answerable.setContext), by the site's own names."},"browser":{"description":"The customer's browser and system, like \"Chrome 141 on macOS\".","type":["string","null"]}},"required":["page","context","browser"],"additionalProperties":false},{"type":"null"}],"description":"For a message sent through the widget on the company's site: where it came from."},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"type":{"type":"string"},"size":{"type":"number","description":"In bytes."},"url":{"description":"Downloads the file, without signing in, for 10 minutes; read the ticket again for a new one. null while it's still being stored, or if it couldn't be.","type":["string","null"]}},"required":["id","filename","type","size","url"],"additionalProperties":false},"description":"Files on the email."}},"required":["id","from","author","sentAt","text","quoted","language","translation","delivery","deliveryReason","cc","site","attachments"],"additionalProperties":false}},"replyCopies":{"type":"array","items":{"type":"string"},"description":"Who a new reply copies besides the customer unless you pass cc: everyone else on the latest email."},"findings":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"}},"required":["title","url"],"additionalProperties":false}}},"required":["text","sources"],"additionalProperties":false}},"missingInformation":{"type":"array","items":{"type":"string"}},"recommendedAction":{"type":["string","null"]},"customerHistory":{"type":"array","items":{"type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"lastMessageAt":{"type":"string"}},"required":["number","subject","status","lastMessageAt"],"additionalProperties":false}},"links":{"type":"object","properties":{"mergedInto":{"description":"The ticket this one was merged into, which has its messages now.","type":["number","null"]},"mergedIn":{"type":"array","items":{"type":"number"},"description":"Tickets merged into this one."},"suggestedMerge":{"description":"answerable's agent found this ticket asks the same as that open one, and suggests merging it into it (mergeInto with update_tickets).","type":["number","null"]},"related":{"type":"array","items":{"type":"number"},"description":"Tickets linked as related."}},"required":["mergedInto","mergedIn","suggestedMerge","related"],"additionalProperties":false,"description":"Links to other tickets, by number."},"notes":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string","description":"Who wrote it, and the app they used."},"text":{"type":"string"},"at":{"type":"string"},"edited":{"type":"boolean"}},"required":["author","text","at","edited"],"additionalProperties":false},"description":"The team's notes, oldest first. Customers never see them; answerable's agent reads them."},"investigation":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["QUEUED","RUNNING","SUCCEEDED","FAILED","CANCELLED"],"description":"While QUEUED or RUNNING, the findings and draft can still change. CANCELLED: the ticket changed first."},"requestedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["status","requestedAt","finishedAt"],"additionalProperties":false},{"type":"null"}],"description":"answerable's latest investigation of the ticket."},"history":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CLOSED","REOPENED","MARKED_SPAM","MARKED_NOT_SPAM","ASSIGNED","HANDED_OFF","DELIVERY_FAILED","NOT_INVESTIGATED","TYPE_CHANGED","IMPORTED","NOTIFIED","TRASHED","RESTORED","MERGED","MERGED_IN","UNMERGED","LINKED","UNLINKED","ACTION_TAKEN","ACTION_FAILED","ACTION_DECLINED"]},"at":{"type":"string"},"by":{"type":"string","description":"answerable's agent, a teammate (and the app they used), the customer's reply, or answerable itself."},"assignee":{"description":"ASSIGNED: who got the ticket; null when it went back to the agent.","type":["string","null"]},"reason":{"description":"Why, when answerable recorded it. NOTIFIED: why the agent found the rule matched.","type":["string","null"]},"told":{"description":"NOTIFIED: the teammates the rule let know.","type":"string"},"rule":{"description":"NOTIFIED: the rule's words.","type":"string"},"ticket":{"description":"MERGED: the ticket it was merged into. MERGED_IN: the ticket merged into it. UNMERGED, LINKED, UNLINKED: the other ticket.","type":"number"}},"required":["type","at","by","reason"],"additionalProperties":false},"description":"What happened to the ticket besides messages, oldest first: closing, reopening, spam decisions, assignments, handoffs, and teammates a rule let know (NOTIFIED)."},"account":{"description":"With include account: the customer's account, or null when there's no account lookup. verified false means the sender may not be the account holder.","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"billing":{"description":"With include billing: the customer's billing from Stripe, or null when Stripe isn't connected. verified false means the sender may not be the account holder.","anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["number","subject","status","state","typeId","type","spam","automatic","customer","assignee","summary","preview","waiting","draft","lastMessageAt","changedAt","url","revision","language","messages","replyCopies","findings","missingInformation","recommendedAction","customerHistory","links","notes","investigation","history"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/knowledge":{"get":{"operationId":"searchKnowledge","summary":"Search the knowledge","description":"Search the knowledge answerable's agent answers from with `query`, or read one article in full with `url`.","x-required-scope":"tickets:read","security":[{"bearer":["tickets:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"query","in":"query","required":false,"schema":{"description":"Words to search the agent's knowledge for: imported docs sites and files, and live docs searches.","type":"string","minLength":1,"maxLength":500},"description":"Words to search the agent's knowledge for: imported docs sites and files, and live docs searches."},{"name":"url","in":"query","required":false,"schema":{"description":"Instead of query: an article to read in full, by the url a search returned.","type":"string","maxLength":2000},"description":"Instead of query: an article to read in full, by the url a search returned."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"description":"For a query: matching articles with an excerpt. Read one in full with its url before relying on it.","type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"excerpt":{"type":"string"},"section":{"type":"string"}},"required":["source","title","url","excerpt"],"additionalProperties":false}},"unavailable":{"description":"Knowledge sources that couldn't be searched just now.","type":"array","items":{"type":"string"}},"article":{"description":"For a url: the article.","type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"content":{"type":"string"},"truncated":{"type":"boolean"}},"required":["title","url","content","truncated"],"additionalProperties":false}},"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/tickets/{number}/draft":{"post":{"operationId":"draftReply","summary":"Draft a reply","description":"Propose a reply for a teammate to review and send. It replaces the current draft; nothing is emailed. Returns 409 if the customer wrote since `revision`.","x-required-scope":"tickets:draft","security":[{"bearer":["tickets:draft"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The ticket's number, e.g. 42 for #42."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":50000,"description":"The complete email to the customer, with greeting and sign-off. Plain text, or Markdown's **bold**, _italic_, [links](https://…), and - or 1. lists, used sparingly; every line break is kept and the rest of Markdown shows as typed."},"revision":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's revision when you read it (from get_tickets). If the customer wrote since, nothing is saved."},"kind":{"default":"ANSWER","description":"ANSWER closes the ticket once sent; FOLLOW_UP asks something and waits.","type":"string","enum":["ANSWER","FOLLOW_UP"]},"cc":{"description":"Who the reply copies besides the customer, e.g. [\"sam@example.com\"]; [] for the customer alone. Left out, everyone else on the ticket's latest email (replyCopies in get_tickets).","maxItems":49,"type":"array","items":{"type":"string","maxLength":320}}},"required":["body","revision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"draftId":{"type":"string"},"version":{"type":"number"},"url":{"type":"string"}},"required":["draftId","version","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/tickets/{number}/replies":{"post":{"operationId":"sendReply","summary":"Send a reply","description":"Email the customer: the current draft (`draftId` and `draftVersion`, with `body` to send it with your edits), or a reply you wrote (`body` and `revision`). It goes out right away, without answerable's safeguards. Send an `Idempotency-Key` header so a retried request can't send twice.","x-required-scope":"tickets:send","security":[{"bearer":["tickets:send"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The ticket's number, e.g. 42 for #42."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Repeating a request with the same key sends nothing new."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"description":"The email, with greeting and sign-off. Plain text, or Markdown's **bold**, _italic_, [links](https://…), and - or 1. lists, used sparingly; every line break is kept and the rest of Markdown shows as typed. With draftId, it replaces the draft's text: the draft is approved with your edits.","type":"string","minLength":1,"maxLength":50000},"revision":{"description":"With body and no draftId: the ticket's revision when you read it.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"draftId":{"description":"To approve the ticket's draft: its id, from get_tickets. It's sent as is, or with your body.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"draftVersion":{"description":"With draftId: the draft's version you read.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"close":{"default":true,"description":"With body and no draftId: close the ticket (an answer), or wait for the customer (a question). A draft closes or waits by its kind.","type":"boolean"},"cc":{"description":"Who the reply copies besides the customer, e.g. [\"sam@example.com\"]; [] for the customer alone. Left out, a reply you wrote copies everyone else on the ticket's latest email (replyCopies in get_tickets), and a draft keeps its own. Not for a new ticket.","maxItems":49,"type":"array","items":{"type":"string","maxLength":320}}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"number","description":"The ticket, e.g. a new ticket's number."},"messageId":{"description":"null for a duplicate, or for a draft with actions: it goes out once they've run.","type":["string","null"]},"duplicate":{"type":"boolean","description":"true when this was sent already, so nothing new went out."},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["QUEUED","SENT","DELIVERED","HELD","FAILED"],"description":"QUEUED: going out now. HELD: kept in the conversation and not emailed, e.g. in test mode. FAILED: couldn't be sent."},"reason":{"description":"Why it was held or failed, e.g. \"test mode\".","type":["string","null"]}},"required":["status","reason"],"additionalProperties":false},{"type":"null"}],"description":"What happens to the email; null for a duplicate or a draft with actions. Tell the person when it was held: the customer didn't get it."},"url":{"type":"string"}},"required":["number","messageId","duplicate","delivery","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/tickets/{number}/actions":{"get":{"operationId":"listActions","summary":"List actions","description":"What can be done for the ticket's customer in the systems the workspace connected, such as a refund in Stripe or the company's own actions in its product, with the customer's own choices, and whether the latest email is verified as theirs.","x-required-scope":"tickets:read","security":[{"bearer":["tickets:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The ticket's number, e.g. 42 for #42."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"senderVerified":{"type":"boolean","description":"false when the latest email isn't verified as the customer's: make sure it's them before changing their account."},"actions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Pass it as action to take_action."},"name":{"type":"string"},"where":{"type":"string","description":"The system it runs in, such as Stripe."},"description":{"type":"string"},"kind":{"type":"string","enum":["CHANGE","MONEY","DESTRUCTIVE"],"description":"MONEY moves money; DESTRUCTIVE can't be undone."},"unavailable":{"description":"Why it can't be taken for this customer now.","type":["string","null"]},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","number","boolean","choice","money","json"]},"required":{"type":"boolean"},"description":{"type":"string"},"options":{"description":"For a choice: the customer's own options. Pass one's value.","type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string"},"amount":{"description":"What's left of it, for money taken from it.","type":"object","properties":{"amount":{"type":"number","description":"In the currency's smallest unit, such as cents."},"currency":{"type":"string"}},"required":["amount","currency"],"additionalProperties":false}},"required":["value","label"],"additionalProperties":false}},"of":{"description":"For money: the choice it's taken from. Pass it in the smallest unit, at most that option's amount.","type":"string"},"currency":{"description":"For money that isn't taken from a choice: its currency. Pass it in the smallest unit.","type":"string"},"min":{"type":"number"},"max":{"type":"number"},"maxLength":{"type":"number"},"schema":{"description":"For json: the JSON Schema of its value. Pass it as JSON text.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","label","type","required"],"additionalProperties":false}}},"required":["key","name","where","description","kind","unavailable","inputs"],"additionalProperties":false}}},"required":["senderVerified","actions"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"takeAction","summary":"Take an action","description":"Take one of the ticket's actions now: it runs in the other system right away, checked again against the customer's data, and the ticket's history keeps it. A failure is in the response, with `status` FAILED and why in `error`. Send an `Idempotency-Key` header so a retried request can't take it twice; without one, the same action with the same inputs within ten minutes counts as a repeat, unless it failed.","x-required-scope":"tickets:act","security":[{"bearer":["tickets:act"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"number","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The ticket's number, e.g. 42 for #42."},"description":"The ticket's number, e.g. 42 for #42."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Repeating a request with the same key takes nothing new, and answers with the action it took."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","minLength":1,"maxLength":200,"description":"The action's key, from get_actions."},"inputs":{"default":{},"description":"Each input by name: a choice's value, a number, true or false, text, money in the smallest unit, or JSON text.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["action"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"where":{"type":"string"},"summary":{"type":"string","description":"Its inputs in words."},"status":{"type":"string","enum":["DONE","FAILED","RUNNING","APPROVED","PROPOSED","DECLINED","DISCARDED"]},"result":{"anyOf":[{"type":"object","properties":{"message":{"type":"string"},"url":{"type":"string"}},"required":["message"],"additionalProperties":false},{"type":"null"}],"description":"What the other system said, when it's DONE."},"error":{"description":"Why it didn't go through, when it FAILED. One that may have gone through says to check first.","type":["string","null"]},"duplicate":{"type":"boolean","description":"True when the same request took it before (the same Idempotency-Key, or the same action and inputs within ten minutes), so nothing new ran: this is that action, as it is now."}},"required":["id","name","where","summary","status","result","error","duplicate"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/messages":{"post":{"operationId":"receiveMessage","summary":"Receive a customer's message","description":"Bring in a message from your own form, app, or channel: it opens a ticket, or with `ticket` continues one, and answerable's agent investigates it like an email. Replies go to the customer's `email`. Send an `Idempotency-Key` header, such as your own id for the message, so a retried request adds nothing.","x-required-scope":"tickets:receive","security":[{"bearer":["tickets:receive"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Repeating a request with the same key adds nothing new."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"description":"The customer's email address. answerable's replies go to it.","type":"string","maxLength":320},"name":{"description":"The customer's name. Kept only with verified.","type":"string","maxLength":100},"verified":{"default":false,"description":"Set when your system confirmed the customer owns the address, e.g. they're signed in. Otherwise the message counts as from an unverified sender, and the agent's safeguards for those apply.","type":"boolean"},"subject":{"description":"A new ticket's subject. Without it, the message's first line.","type":"string","maxLength":200},"body":{"type":"string","minLength":1,"maxLength":20000,"description":"What the customer wrote, as plain text."},"ticket":{"description":"Add the message to this ticket, which must be the same customer's, instead of opening a new one.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"attachments":{"default":[],"description":"Files the customer sent.","maxItems":10,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri","description":"A public https address answerable downloads the file from, once, right away."},"filename":{"type":"string","maxLength":255}},"required":["url"]}}},"required":["email","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"number","description":"The ticket the message is on."},"messageId":{"type":"string"},"status":{"type":"string","enum":["created","appended","duplicate"],"description":"created: a new ticket. appended: the next message on a ticket. duplicate: received before, with the same Idempotency-Key, so nothing was added."},"investigating":{"type":"boolean","description":"Whether answerable's agent is investigating it. It isn't for a blocked or spam sender, past the hourly limits, or with AI paused."},"url":{"type":"string","description":"The ticket in answerable."}},"required":["number","messageId","status","investigating","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/articles":{"get":{"operationId":"listArticles","summary":"List help center articles","description":"The help center's articles in its order, with their state, category, address on the help site, the languages each is written in (`languages`, each with its own title, state and address), reads over the last 30 days, and answers to \"Was this helpful?\", filtered by `state`, `category`, title words (`query`), `changedSince`, a `language` they're written in, or one they're `missing`. Follow nextCursor for more.","x-required-scope":"help:read","security":[{"bearer":["help:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"state","in":"query","required":false,"schema":{"description":"Only articles in this state.","type":"string","enum":["DRAFT","PUBLISHED","CHANGED"]},"description":"Only articles in this state."},{"name":"category","in":"query","required":false,"schema":{"description":"Only articles in this category, by name. \"\" for articles in none.","type":"string","maxLength":80},"description":"Only articles in this category, by name. \"\" for articles in none."},{"name":"query","in":"query","required":false,"schema":{"description":"Only articles whose title has these words. To search their text, use search_knowledge.","type":"string","maxLength":200},"description":"Only articles whose title has these words. To search their text, use search_knowledge."},{"name":"changedSince","in":"query","required":false,"schema":{"description":"Only articles changed after this time (ISO 8601).","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"Only articles changed after this time (ISO 8601)."},{"name":"language","in":"query","required":false,"schema":{"description":"With ids, read each article in this language (one it's written in); left out, in its first language (the main one when it's written in it). Listing, only articles written in this language.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"description":"With ids, read each article in this language (one it's written in); left out, in its first language (the main one when it's written in it). Listing, only articles written in this language."},{"name":"missing","in":"query","required":false,"schema":{"description":"Only articles not written in this language yet, to translate.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"description":"Only articles not written in this language yet, to translate."},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"description":"From the previous page's nextCursor.","type":"string","maxLength":20},"description":"From the previous page's nextCursor."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"articles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful"],"additionalProperties":false}},"categories":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"articles":{"type":"number"}},"required":["name","articles"],"additionalProperties":false},"description":"The help center's categories, in order, with how many articles each has."},"site":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"},"on":{"type":"boolean"}},"required":["url","on"],"additionalProperties":false},{"type":"null"}],"description":"The help site; null before the first article."},"nextCursor":{"type":["string","null"]}},"required":["articles","categories","site","nextCursor"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addArticle","summary":"Add an article","description":"Add an article as a draft, in a category by name (made when there's none), in the main customer language or the `language` given. With `publish: true` it goes on the help center right away, which also needs help:publish.","x-required-scope":"help:write","security":[{"bearer":["help:write"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"description":"The language version to change: one it's written in, or one of the workspace's customer languages it isn't in yet, which adds it (with title and body, or translateFrom). Left out: a new article is in the main customer language, and a change goes to the article's first language, except publish: false, which takes every language off.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"title":{"type":"string","maxLength":200},"body":{"description":"The whole text, as Markdown: headings (##), lists, links, https images, code, tables, and :::note, :::tip, :::warning callouts.","type":"string","maxLength":100000},"category":{"description":"Move it to this category, by name; it's made when there's none by that name. null takes it out of its category.","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"publish":{"description":"true puts it on the help center as written (after the other changes), so readers and answerable's agent see it. false takes it off. Needs Publish help center articles.","type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."},"baseId":{"description":"Pass it with the next change.","type":["string","null"]}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful","baseId"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/articles/{id}":{"get":{"operationId":"getArticle","summary":"Get an article","description":"An article in full, in one of its languages (`language`; its first when left out, and 404 when it isn't written in it): its Markdown (the draft if there is one), what's published when that differs, what readers said was missing, and the `baseId` to send when changing it.","x-required-scope":"help:read","security":[{"bearer":["help:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The article's id (see get_articles)."},"description":"The article's id (see get_articles)."},{"name":"language","in":"query","required":false,"schema":{"description":"The language to read, publish or unpublish: one the article is written in. Left out: its first language to read and publish; every language to unpublish.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"description":"The language to read, publish or unpublish: one the article is written in. Left out: its first language to read and publish; every language to unpublish."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."},"body":{"type":"string","description":"The text to edit, as Markdown: the draft if there is one, otherwise what's published."},"baseId":{"description":"The version that text is. Pass it with a change, so nothing is overwritten if someone saved since.","type":["string","null"]},"published":{"anyOf":[{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"}},"required":["title","body"],"additionalProperties":false},{"type":"null"}],"description":"What's live, when it differs from the draft or there's no draft."},"readersSaid":{"type":"array","items":{"type":"object","properties":{"comment":{"type":"string"},"at":{"type":"string"}},"required":["comment","at"],"additionalProperties":false},"description":"The latest of what readers who said it didn't help were looking for."}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful","body","baseId","published","readersSaid"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"changeArticle","summary":"Change an article","description":"Change an article's title or text in one of its languages (`language`; its first when left out; saved as that language's draft; send the `baseId` you read, and it returns 409 if someone saved since), move it to a category by name (`null` for none), or throw its draft away (`discardDraft`). A `language` it isn't written in yet adds it, from your title and body or from answerable's translation of another (`translateFrom`); `removeLanguage` takes one away. Only the fields sent change. Nothing goes live until it's published.","x-required-scope":"help:write","security":[{"bearer":["help:write"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The article's id (see get_articles)."},"description":"The article's id (see get_articles)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"description":"The language version to change: one it's written in, or one of the workspace's customer languages it isn't in yet, which adds it (with title and body, or translateFrom). Left out: a new article is in the main customer language, and a change goes to the article's first language, except publish: false, which takes every language off.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"translateFrom":{"description":"With a new language: start it from answerable's translation of the article in this language, as a draft. Don't pass title or body with it.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"},"removeLanguage":{"description":"Remove this language version, with its history, from the site and the agent. An article's only language can't be removed.","type":"boolean"},"baseId":{"description":"The baseId you read with get_articles, needed to change the title or text. If someone saved since, the article isn't changed.","type":["string","null"]},"title":{"type":"string","maxLength":200},"body":{"description":"The whole text, as Markdown: headings (##), lists, links, https images, code, tables, and :::note, :::tip, :::warning callouts.","type":"string","maxLength":100000},"category":{"description":"Move it to this category, by name; it's made when there's none by that name. null takes it out of its category.","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"discardDraft":{"description":"Throw away its draft, back to what's published.","type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."},"baseId":{"description":"Pass it with the next change.","type":["string","null"]}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful","baseId"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/articles/{id}/publish":{"post":{"operationId":"publishArticle","summary":"Publish an article","description":"Put the article on the help center as written, in one language (`language`; its first when left out), its draft in place of what was published there, where readers and answerable's agent see it.","x-required-scope":"help:publish","security":[{"bearer":["help:publish"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The article's id (see get_articles)."},"description":"The article's id (see get_articles)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"description":"The language to read, publish or unpublish: one the article is written in. Left out: its first language to read and publish; every language to unpublish.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."},"baseId":{"description":"Pass it with the next change.","type":["string","null"]}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful","baseId"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/articles/{id}/unpublish":{"post":{"operationId":"unpublishArticle","summary":"Unpublish an article","description":"Take the article off the help center: in one `language`, or in every language when none is given. Its text stays, to change and publish again.","x-required-scope":"help:publish","security":[{"bearer":["help:publish"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The article's id (see get_articles)."},"description":"The article's id (see get_articles)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"language":{"description":"The language to read, publish or unpublish: one the article is written in. Left out: its first language to read and publish; every language to unpublish.","type":"string","pattern":"^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language the title, state and url (and when read in full, the text) are in."},"title":{"type":"string"},"category":{"description":"Its category's name; null when it's in none.","type":["string","null"]},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"description":"Where it is on the help site; null when it isn't live or the site is off.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"language":{"type":"string"},"title":{"type":"string"},"state":{"type":"string","enum":["DRAFT","PUBLISHED","CHANGED"],"description":"DRAFT: not on the help center (never published, or taken off). PUBLISHED: live as written. CHANGED: live, with changes waiting in its draft."},"url":{"type":["string","null"]}},"required":["language","title","state","url"],"additionalProperties":false},"description":"Every language it's written in, the main customer language first, each with its own title, state and address."},"changedAt":{"type":"string","description":"When its text last changed."},"changedBy":{"description":"Who changed it last.","type":["string","null"]},"publishedAt":{"type":["string","null"]},"views":{"type":"number","description":"Reads on the help site over the last 30 days, in every language."},"helpful":{"type":"number","description":"Readers who answered \"Was this helpful?\" with yes."},"notHelpful":{"type":"number","description":"Readers who answered no."},"baseId":{"description":"Pass it with the next change.","type":["string","null"]}},"required":["id","language","title","category","state","url","languages","changedAt","changedBy","publishedAt","views","helpful","notHelpful","baseId"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/knowledge-sources":{"get":{"operationId":"getKnowledgeSources","summary":"List the knowledge sources","description":"What answerable's agent answers from: imported docs sites, uploaded files, docs searches, the help center, and lessons from the team's replies, whether it reads each, and where each one's import stands. With the plan's limits.","x-required-scope":"agent:read","security":[{"bearer":["agent:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["DOCS_SITE","FILES","DOCS_SEARCH","LEARNED","HELP_CENTER"],"description":"DOCS_SITE (a docs site answerable imports and keeps fresh), FILES (the files uploaded), DOCS_SEARCH (a search endpoint asked live), HELP_CENTER (the help center's published articles), or LEARNED (lessons from the team's replies)."},"name":{"type":"string"},"url":{"description":"A docs site's or docs search's address.","type":["string","null"]},"on":{"type":"boolean","description":"answerable's agent reads it. Turned on and off with update_agent's knowledgeSources."},"status":{"type":"string","enum":["READY","IMPORTING","WAITING_TO_IMPORT","NOT_IMPORTED","FAILED"],"description":"READY: the agent can use it. IMPORTING: finding or reading a site's pages, or reading files. WAITING_TO_IMPORT: a site's pages were found; tell the person how many, then import them (import: true). NOT_IMPORTED: nothing read yet. FAILED: the latest import failed and nothing is indexed."},"documents":{"description":"For a site and files: pages or files the agent can search, still being read, left out (empty or duplicate), and failed.","type":"object","properties":{"indexed":{"type":"number"},"inProgress":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["indexed","inProgress","skipped","failed"],"additionalProperties":false},"import":{"description":"For a docs site: its latest import, which finds the site's pages, waits for them to be confirmed, then reads them.","anyOf":[{"type":"object","properties":{"status":{"type":"string"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"pagesFound":{"type":"number"},"pageLimit":{"type":"number"},"message":{"type":["string","null"]}},"required":["status","startedAt","finishedAt","pagesFound","pageLimit","message"],"additionalProperties":false},{"type":"null"}]},"lastImportedAt":{"description":"For a docs site: when its pages were last read. It's read again daily.","type":["string","null"]},"files":{"description":"For the files: each one, newest first, up to 100.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"bytes":{"type":"number"}},"required":["id","name","status","bytes"],"additionalProperties":false}},"mode":{"description":"For lessons: AUTOMATIC uses what it learns right away, APPROVAL waits for someone to approve each, OFF learns nothing new.","type":"string","enum":["AUTOMATIC","APPROVAL","OFF"]}},"required":["id","kind","name","url","on","status"],"additionalProperties":false}},"limits":{"type":"object","properties":{"sites":{"type":"number"},"files":{"type":"number"},"fileBytes":{"type":"number"},"storageBytes":{"type":"number"},"sitePages":{"type":"number"}},"required":["sites","files","fileBytes","storageBytes","sitePages"],"additionalProperties":false,"description":"The workspace's plan: docs sites, files, the largest file, all files together, and pages a site may have."},"url":{"type":"string","description":"Knowledge in answerable."}},"required":["sources","limits","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateKnowledgeSources","summary":"Change the knowledge sources","description":"Add, change or remove up to 10 knowledge sources, shaped as the GET returns them: an item without `id` adds one (a docs site to import, a docs search, files to upload), one with `id` changes the fields sent, and `remove: true` removes it. Every change is checked first, and nothing changes unless all are valid. Files go to the upload addresses in `uploads`; send their ids in `uploaded` once their bytes are there. Admins only.","x-required-scope":"agent:configure","security":[{"bearer":["agent:configure"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"description":"The source to change, from get_knowledge_sources. Leave it out to add one.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"description":"With no id, what to add: DOCS_SITE (with url), DOCS_SEARCH (with name and url), or FILES (with upload).","type":"string","enum":["DOCS_SITE","DOCS_SEARCH","FILES"]},"name":{"type":"string","maxLength":60},"url":{"description":"A docs site's address (where its import starts) or a docs search's endpoint; https.","type":"string","maxLength":2000},"import":{"description":"A docs site: read the pages it found (when WAITING_TO_IMPORT), or import it again now.","type":"boolean"},"stop":{"description":"A docs site: stop importing after the page it's reading.","type":"boolean"},"upload":{"description":"Files to upload, up to 20: each gets an address to PUT its bytes to. Then send uploaded with their ids.","maxItems":20,"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":1000},"size":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"In bytes."}},"required":["filename","size"]}},"uploaded":{"description":"Files whose bytes were PUT to their upload address: answerable reads them.","maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"removeFiles":{"description":"Files to remove, by id.","maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"mode":{"description":"Lessons: how answerable learns from the team's replies.","type":"string","enum":["AUTOMATIC","APPROVAL","OFF"]},"remove":{"description":"true removes a docs site or docs search, with everything indexed from it, or the files source with every file.","type":"boolean"}}},"description":"Up to 10 changes, applied in order. Each is checked first, and nothing changes unless all are valid. If one fails as it's saved, the ones before it stay saved."}},"required":["sources"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["DOCS_SITE","FILES","DOCS_SEARCH","LEARNED","HELP_CENTER"],"description":"DOCS_SITE (a docs site answerable imports and keeps fresh), FILES (the files uploaded), DOCS_SEARCH (a search endpoint asked live), HELP_CENTER (the help center's published articles), or LEARNED (lessons from the team's replies)."},"name":{"type":"string"},"url":{"description":"A docs site's or docs search's address.","type":["string","null"]},"on":{"type":"boolean","description":"answerable's agent reads it. Turned on and off with update_agent's knowledgeSources."},"status":{"type":"string","enum":["READY","IMPORTING","WAITING_TO_IMPORT","NOT_IMPORTED","FAILED"],"description":"READY: the agent can use it. IMPORTING: finding or reading a site's pages, or reading files. WAITING_TO_IMPORT: a site's pages were found; tell the person how many, then import them (import: true). NOT_IMPORTED: nothing read yet. FAILED: the latest import failed and nothing is indexed."},"documents":{"description":"For a site and files: pages or files the agent can search, still being read, left out (empty or duplicate), and failed.","type":"object","properties":{"indexed":{"type":"number"},"inProgress":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["indexed","inProgress","skipped","failed"],"additionalProperties":false},"import":{"description":"For a docs site: its latest import, which finds the site's pages, waits for them to be confirmed, then reads them.","anyOf":[{"type":"object","properties":{"status":{"type":"string"},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"pagesFound":{"type":"number"},"pageLimit":{"type":"number"},"message":{"type":["string","null"]}},"required":["status","startedAt","finishedAt","pagesFound","pageLimit","message"],"additionalProperties":false},{"type":"null"}]},"lastImportedAt":{"description":"For a docs site: when its pages were last read. It's read again daily.","type":["string","null"]},"files":{"description":"For the files: each one, newest first, up to 100.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"bytes":{"type":"number"}},"required":["id","name","status","bytes"],"additionalProperties":false}},"mode":{"description":"For lessons: AUTOMATIC uses what it learns right away, APPROVAL waits for someone to approve each, OFF learns nothing new.","type":"string","enum":["AUTOMATIC","APPROVAL","OFF"]}},"required":["id","kind","name","url","on","status"],"additionalProperties":false},"description":"The sources added or changed, as they are now."},"removed":{"type":"array","items":{"type":"string"}},"uploads":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":"string"},"filename":{"type":"string"},"url":{"type":"string"},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expiresAt":{"type":"string"}},"required":["fileId","filename","url","method","headers","expiresAt"],"additionalProperties":false},"description":"Where to send each file's bytes: PUT them to url with these headers (curl -T <file> -H 'Content-Type: application/octet-stream' '<url>'), before expiresAt. Then call again with uploaded: their fileIds, for answerable to read them."},"failed":{"anyOf":[{"type":"object","properties":{"index":{"type":"number"},"message":{"type":"string"}},"required":["index","message"],"additionalProperties":false},{"type":"null"}],"description":"A change that failed as it was saved: those before it were saved, it and the rest weren't."},"url":{"type":"string"}},"required":["sources","removed","uploads","failed","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/connectors":{"get":{"operationId":"getConnectors","summary":"List the connectors","description":"The systems answerable's agent looks things up in and acts in (your product, Stripe, APIs and MCP servers): whether it uses each, whether each is ready or waits for a key or a sign-in, how its latest calls went, and its operations with how each is set. No secrets.","x-required-scope":"agent:read","security":[{"bearer":["agent:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["YOUR_PRODUCT","STRIPE","API","MCP"],"description":"YOUR_PRODUCT (the company's own account lookup and actions), STRIPE (billing), API, or MCP (a remote MCP server)."},"name":{"type":"string"},"on":{"type":"boolean","description":"answerable's agent uses it. Turned on and off with update_agent's connectors."},"status":{"type":"string","enum":["READY","KEY_NEEDED","SIGN_IN_NEEDED","BROKEN"],"description":"READY: the agent can use it. KEY_NEEDED: it waits for its key or token, which an admin adds at keyUrl. SIGN_IN_NEEDED: someone needs to sign in to it, at signInUrl. BROKEN: its credentials can't be read anymore; set it up again on its page."},"url":{"description":"Your product's lookup endpoint, an API's base address its operations' paths go after, or an MCP server's address; null for Stripe.","type":["string","null"]},"actionsUrl":{"description":"Your product's actions endpoint, if it has one.","type":["string","null"]},"auth":{"anyOf":[{"anyOf":[{"type":"object","properties":{"in":{"type":"string","enum":["none","bearer","header","query"]},"name":{"description":"With header or query: the header or query parameter the key goes in, e.g. \"X-API-Key\" or \"api_key\".","type":"string","maxLength":64}},"required":["in"],"additionalProperties":false,"description":"How an API takes its key: none, bearer (Authorization: Bearer), its own header, or in the query."},{"type":"string","enum":["none","token","oauth"],"description":"How an MCP server signs in: none, a token (Authorization: Bearer), or oauth (an admin signs in to it in their browser)."}]},{"type":"null"}],"description":"An API's or MCP server's way of signing in; null for your product and Stripe."},"keyHint":{"description":"The last characters of its key or token, to tell which one it is.","type":["string","null"]},"keyUrl":{"description":"For one that takes a key or token (Stripe, an API, an MCP server): where an admin adds or replaces it. Give it to the person: keys never go through you.","type":["string","null"]},"signInUrl":{"description":"For an MCP server that's signed in to: where an admin signs in to it, or again. Give it to the person.","type":["string","null"]},"signedIn":{"anyOf":[{"type":"object","properties":{"by":{"type":"string"},"at":{"type":["string","null"]}},"required":["by","at"],"additionalProperties":false},{"type":"null"}],"description":"Who last signed in to it, and when. The agent uses it as them."},"stripeMode":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"For Stripe: which of the company's Stripe modes its key reads."},"lastCall":{"type":"object","properties":{"workedAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["workedAt","failedAt","error"],"additionalProperties":false,"description":"How the latest calls through it went."},"toolsCheckedAt":{"description":"For an MCP server: when its tools were last listed.","type":["string","null"]},"operations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Its id within the connector: the operation's or tool's."},"key":{"type":"string","description":"<connector id>:<id>, its key in update_agent's tools."},"name":{"type":"string"},"description":{"type":"string"},"effect":{"type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"],"description":"READ: Only looks something up. CHANGE: A change that can be undone. DESTRUCTIVE: Can't be undone, like a delete. MONEY: Moves money, like a refund."},"setting":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["ON","TEAM","APPROVAL","AUTO"]},"when":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"limit":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]}},"required":["mode","when","limit"],"additionalProperties":false},{"type":"null"}],"description":"Its setting in the agent's settings, or null while it's off. Set with update_agent's tools."},"method":{"description":"An API's operation: its method.","type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"description":"An API's operation: its path after the connector's url, with {placeholders}.","type":"string"},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","description":"text, number, boolean, choice or money for an API's operation; MCP tools also have json."},"required":{"type":"boolean"},"description":{"type":"string"}},"required":["name","type","required"],"additionalProperties":{}},"description":"What it takes. An API's operation's inputs are as update_connectors takes them (with in, fill, and type's options); an MCP tool's are as its server lists them."},"fills":{"description":"An MCP tool's inputs answerable fills from the ticket, never the agent: customer_email (Customer's email), account_id (Their account in your product), stripe_customer_id (Their Stripe customer), ticket_number (Ticket number).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["customer_email","account_id","stripe_customer_id","ticket_number"]}},"review":{"description":"An MCP tool its server changed since it was approved: the agent reads it as it was until someone approves this (update_connectors with approve: the fingerprint). Show the person the change first.","anyOf":[{"type":"object","properties":{"fingerprint":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"effect":{"type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"]},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","description":"text, number, boolean, choice or money for an API's operation; MCP tools also have json."},"required":{"type":"boolean"},"description":{"type":"string"}},"required":["name","type","required"],"additionalProperties":{}}}},"required":["fingerprint","name","description","effect","inputs"],"additionalProperties":false},{"type":"null"}]},"gone":{"description":"Its server doesn't list it anymore; its setting is kept for when it's back.","type":"boolean"},"unavailable":{"description":"Why it can't be taken now, such as a key without write access.","type":["string","null"]},"builtIn":{"description":"answerable's own (Stripe's), which can't be changed here.","type":"boolean"}},"required":["id","key","name","description","effect","setting","inputs"],"additionalProperties":false},"description":"Its reads and actions: an API's operations, an MCP server's tools, your product's listed actions, or Stripe's."},"page":{"type":"string","description":"Its page in answerable."}},"required":["id","kind","name","on","status","url","auth","keyHint","keyUrl","signInUrl","signedIn","stripeMode","lastCall","toolsCheckedAt","operations","page"],"additionalProperties":false}},"url":{"type":"string","description":"Integrations in answerable."}},"required":["connectors","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateConnectors","summary":"Change the connectors","description":"Add, change or remove up to 10 connectors and their operations, shaped as the GET returns them: an item without `id` adds one, one with `id` changes the fields sent, and `remove: true` removes it. Every change is checked first, and nothing changes unless all are valid. Keys, tokens and sign-ins are never sent: a connector that needs one comes back with `keyUrl` or `signInUrl`, for an admin to open. `try` runs one operation afterwards, the way the agent would. Admins only.","x-required-scope":"agent:configure","security":[{"bearer":["agent:configure"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"connectors":{"description":"Up to 10 changes, applied in order. Each is checked first, and nothing changes unless all are valid. Checks that reach the other system (an API's address, an MCP server's tools or sign-in) happen as each is saved: if one fails, the ones before it stay saved.","maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"description":"The connector to change, from get_connectors. Leave it out to add one.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"description":"With no id, what to add: YOUR_PRODUCT, API or MCP. Stripe is connected in answerable, with a restricted key.","type":"string","enum":["YOUR_PRODUCT","STRIPE","API","MCP"]},"name":{"type":"string","maxLength":60},"url":{"description":"Your product's lookup endpoint, an API's base address, or an MCP server's address; https.","type":"string","maxLength":2000},"actionsUrl":{"description":"Your product's actions endpoint; empty to remove it.","type":"string","maxLength":2000},"auth":{"description":"How an API takes its key, or how an MCP server signs in. A key or token is never sent here: the answer links to where an admin adds it.","anyOf":[{"type":"object","properties":{"in":{"type":"string","enum":["none","bearer","header","query"]},"name":{"description":"With header or query: the header or query parameter the key goes in, e.g. \"X-API-Key\" or \"api_key\".","type":"string","maxLength":64}},"required":["in"],"description":"How an API takes its key: none, bearer (Authorization: Bearer), its own header, or in the query."},{"type":"string","enum":["none","token","oauth"],"description":"How an MCP server signs in: none, a token (Authorization: Bearer), or oauth (an admin signs in to it in their browser)."}]},"clientId":{"description":"An MCP server with oauth that doesn't let apps register: the client ID of an OAuth app made there for answerable.","type":"string","maxLength":500},"anyway":{"description":"Connect an API even though its address refused the request without a key (only its operations may need one).","type":"boolean"},"refresh":{"description":"An MCP server: list its tools again now. Your product: ask its lookup for all its actions now (it also does when an address changes).","type":"boolean"},"remove":{"description":"true removes the connector, its tools and their settings.","type":"boolean"},"operations":{"description":"Operations to add, change or remove (an API's), or tools to set (an MCP server's: effect, fills, approve). Only those sent change.","maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"description":"The operation's or tool's id, from get_connectors. Leave it out to add an operation to an API.","type":"string","maxLength":100},"remove":{"description":"true removes an API's operation, and its setting.","type":"boolean"},"name":{"description":"An API's operation: what it's called, for the team and the agent.","type":"string","maxLength":80},"description":{"description":"An API's operation: what it does and when to use it, for the agent.","type":"string","maxLength":1000},"effect":{"description":"What it does. READ: Only looks something up. CHANGE: A change that can be undone. DESTRUCTIVE: Can't be undone, like a delete. MONEY: Moves money, like a refund. An API's operation, or an MCP tool whose server says it wrongly.","type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"]},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"description":"An API's operation: its path after the connector's url, such as /orders/{order_id}, each {placeholder} an input in the path.","type":"string","maxLength":500},"inputs":{"description":"An API's operation: what it takes, the whole list. A fill (customer_email (Customer's email), account_id (Their account in your product), stripe_customer_id (Their Stripe customer), ticket_number (Ticket number)) is filled by answerable from the ticket, never the agent; the rest the agent gives, as text, number, boolean, choice (with options) or money (with currency, sent in the smallest unit, only for MONEY).","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_.-]{0,63}$"},"in":{"type":"string","enum":["path","query","body","header"],"description":"Where it goes: path, query, body (JSON), or header."},"description":{"default":"","type":"string","maxLength":1000},"fill":{"default":null,"anyOf":[{"type":"string","enum":["customer_email","account_id","stripe_customer_id","ticket_number"]},{"type":"null"}]},"type":{"default":"text","type":"string","enum":["text","number","boolean","choice","money"]},"required":{"default":true,"type":"boolean"},"options":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":100},"label":{"default":"","type":"string","maxLength":100}},"required":["value"]}},"min":{"default":null,"type":["number","null"]},"max":{"default":null,"type":["number","null"]},"maxLength":{"default":null,"anyOf":[{"type":"integer","minimum":1,"maximum":2000},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Za-z]{3}$"},{"type":"null"}]}},"required":["name","in"]}},"fills":{"description":"An MCP tool: its inputs answerable fills from the ticket, by name, the whole map.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["customer_email","account_id","stripe_customer_id","ticket_number"]}},"approve":{"description":"An MCP tool its server changed: the review's fingerprint from get_connectors, to approve the change as it was shown.","type":"string","maxLength":200}}}}}}},"try":{"description":"Try one operation after the changes, the way the agent would: a read runs and returns what came back.","type":"object","properties":{"connector":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"integer","minimum":0,"maximum":9007199254740991}],"description":"The connector's id, or its place in connectors for one added in this call."},"operation":{"type":"string","maxLength":100,"description":"The operation's or tool's id, or its name for one added in this call."},"inputs":{"default":{},"description":"What it takes, by name, including the ones answerable fills.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"send":{"default":false,"description":"For an action: false (the default) shows the request without sending it; true really sends it to the other system, as Try it does in answerable. Ask the person first.","type":"boolean"}},"required":["connector","operation"]}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["YOUR_PRODUCT","STRIPE","API","MCP"],"description":"YOUR_PRODUCT (the company's own account lookup and actions), STRIPE (billing), API, or MCP (a remote MCP server)."},"name":{"type":"string"},"on":{"type":"boolean","description":"answerable's agent uses it. Turned on and off with update_agent's connectors."},"status":{"type":"string","enum":["READY","KEY_NEEDED","SIGN_IN_NEEDED","BROKEN"],"description":"READY: the agent can use it. KEY_NEEDED: it waits for its key or token, which an admin adds at keyUrl. SIGN_IN_NEEDED: someone needs to sign in to it, at signInUrl. BROKEN: its credentials can't be read anymore; set it up again on its page."},"url":{"description":"Your product's lookup endpoint, an API's base address its operations' paths go after, or an MCP server's address; null for Stripe.","type":["string","null"]},"actionsUrl":{"description":"Your product's actions endpoint, if it has one.","type":["string","null"]},"auth":{"anyOf":[{"anyOf":[{"type":"object","properties":{"in":{"type":"string","enum":["none","bearer","header","query"]},"name":{"description":"With header or query: the header or query parameter the key goes in, e.g. \"X-API-Key\" or \"api_key\".","type":"string","maxLength":64}},"required":["in"],"additionalProperties":false,"description":"How an API takes its key: none, bearer (Authorization: Bearer), its own header, or in the query."},{"type":"string","enum":["none","token","oauth"],"description":"How an MCP server signs in: none, a token (Authorization: Bearer), or oauth (an admin signs in to it in their browser)."}]},{"type":"null"}],"description":"An API's or MCP server's way of signing in; null for your product and Stripe."},"keyHint":{"description":"The last characters of its key or token, to tell which one it is.","type":["string","null"]},"keyUrl":{"description":"For one that takes a key or token (Stripe, an API, an MCP server): where an admin adds or replaces it. Give it to the person: keys never go through you.","type":["string","null"]},"signInUrl":{"description":"For an MCP server that's signed in to: where an admin signs in to it, or again. Give it to the person.","type":["string","null"]},"signedIn":{"anyOf":[{"type":"object","properties":{"by":{"type":"string"},"at":{"type":["string","null"]}},"required":["by","at"],"additionalProperties":false},{"type":"null"}],"description":"Who last signed in to it, and when. The agent uses it as them."},"stripeMode":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"description":"For Stripe: which of the company's Stripe modes its key reads."},"lastCall":{"type":"object","properties":{"workedAt":{"type":["string","null"]},"failedAt":{"type":["string","null"]},"error":{"type":["string","null"]}},"required":["workedAt","failedAt","error"],"additionalProperties":false,"description":"How the latest calls through it went."},"toolsCheckedAt":{"description":"For an MCP server: when its tools were last listed.","type":["string","null"]},"operations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Its id within the connector: the operation's or tool's."},"key":{"type":"string","description":"<connector id>:<id>, its key in update_agent's tools."},"name":{"type":"string"},"description":{"type":"string"},"effect":{"type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"],"description":"READ: Only looks something up. CHANGE: A change that can be undone. DESTRUCTIVE: Can't be undone, like a delete. MONEY: Moves money, like a refund."},"setting":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["ON","TEAM","APPROVAL","AUTO"]},"when":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"limit":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]}},"required":["mode","when","limit"],"additionalProperties":false},{"type":"null"}],"description":"Its setting in the agent's settings, or null while it's off. Set with update_agent's tools."},"method":{"description":"An API's operation: its method.","type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"description":"An API's operation: its path after the connector's url, with {placeholders}.","type":"string"},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","description":"text, number, boolean, choice or money for an API's operation; MCP tools also have json."},"required":{"type":"boolean"},"description":{"type":"string"}},"required":["name","type","required"],"additionalProperties":{}},"description":"What it takes. An API's operation's inputs are as update_connectors takes them (with in, fill, and type's options); an MCP tool's are as its server lists them."},"fills":{"description":"An MCP tool's inputs answerable fills from the ticket, never the agent: customer_email (Customer's email), account_id (Their account in your product), stripe_customer_id (Their Stripe customer), ticket_number (Ticket number).","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["customer_email","account_id","stripe_customer_id","ticket_number"]}},"review":{"description":"An MCP tool its server changed since it was approved: the agent reads it as it was until someone approves this (update_connectors with approve: the fingerprint). Show the person the change first.","anyOf":[{"type":"object","properties":{"fingerprint":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"effect":{"type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"]},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","description":"text, number, boolean, choice or money for an API's operation; MCP tools also have json."},"required":{"type":"boolean"},"description":{"type":"string"}},"required":["name","type","required"],"additionalProperties":{}}}},"required":["fingerprint","name","description","effect","inputs"],"additionalProperties":false},{"type":"null"}]},"gone":{"description":"Its server doesn't list it anymore; its setting is kept for when it's back.","type":"boolean"},"unavailable":{"description":"Why it can't be taken now, such as a key without write access.","type":["string","null"]},"builtIn":{"description":"answerable's own (Stripe's), which can't be changed here.","type":"boolean"}},"required":["id","key","name","description","effect","setting","inputs"],"additionalProperties":false},"description":"Its reads and actions: an API's operations, an MCP server's tools, your product's listed actions, or Stripe's."},"page":{"type":"string","description":"Its page in answerable."}},"required":["id","kind","name","on","status","url","auth","keyHint","keyUrl","signInUrl","signedIn","stripeMode","lastCall","toolsCheckedAt","operations","page"],"additionalProperties":false},"description":"The connectors added or changed, as they are now. Ones waiting for a key or a sign-in say where in keyUrl or signInUrl: give the person that link."},"removed":{"type":"array","items":{"type":"string"},"description":"Connectors removed, by id."},"failed":{"anyOf":[{"type":"object","properties":{"index":{"type":"number"},"message":{"type":"string"}},"required":["index","message"],"additionalProperties":false},{"type":"null"}],"description":"A change that failed as it was saved: those before it were saved, it and the rest weren't. Fix it and send it and the rest again."},"tried":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean"},"kind":{"description":"read: what came back. preview: the request an action would send. sent: what the system said.","type":"string","enum":["read","preview","sent"]},"result":{},"request":{"type":"string"},"message":{"description":"What went wrong, or what the system said.","type":"string"},"url":{"type":["string","null"]},"ms":{"type":["number","null"]}},"required":["ok"],"additionalProperties":false},{"type":"null"}]},"url":{"type":"string"}},"required":["connectors","removed","failed","tried","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/imports/format":{"get":{"operationId":"getImportFormat","summary":"Get the import format","description":"The format past tickets are imported in, with an example, the rules, the workspace's remaining limits, and an upload address a script can post batches to for an hour. Admins only.","x-required-scope":"tickets:import","security":[{"bearer":["tickets:import"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The JSON Schema of one ticket."},"example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"A ticket in the format."},"rules":{"type":"array","items":{"type":"string"},"description":"What happens to imported tickets."},"limits":{"type":"object","properties":{"ticketsPerCall":{"type":"number"},"requestBytes":{"type":"number"},"messagesPerTicket":{"type":"number"},"charactersPerMessage":{"type":"number"},"attachmentMonths":{"type":"number"}},"required":["ticketsPerCall","requestBytes","messagesPerTicket","charactersPerMessage","attachmentMonths"],"additionalProperties":false},"remaining":{"type":"object","properties":{"tickets":{"type":"number"},"messages":{"type":"number"}},"required":["tickets","messages"],"additionalProperties":false,"description":"What's left of the workspace's import limits."},"imported":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"tickets":{"type":"number"},"messages":{"type":"number"}},"required":["source","tickets","messages"],"additionalProperties":false},"description":"What's already imported, by source."},"upload":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string"}},"required":["url","expiresAt"],"additionalProperties":false,"description":"An address to POST batches to from a script, without signing in: a JSON body like import_tickets' (source, tickets, dryRun, keepOpen) with no workspace. It works for an hour; get a new one after."},"docs":{"type":"string","description":"The import guide."}},"required":["format","example","rules","limits","remaining","imported","upload","docs"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/imports":{"post":{"operationId":"importTickets","summary":"Import past tickets","description":"Import up to 100 tickets from another support tool. A ticket already imported from the same source only gets what it doesn't have yet, so a batch can be sent again. Imported tickets are never answered or emailed. Admins only.","x-required-scope":"tickets:import","security":[{"bearer":["tickets:import"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[\\p{L}\\p{N}][\\p{L}\\p{N} ._-]*$","description":"The tool the tickets come from, such as \"UserVoice\" or \"Zendesk\". Tickets are identified by source and externalId."},"tickets":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Up to 100 tickets in answerable's import format (see get_import_format). Each is checked on its own: invalid ones are rejected with the reason, and the rest are imported."},"dryRun":{"default":false,"description":"Check the tickets and preview the first few as they'd look, without importing anything.","type":"boolean"},"keepOpen":{"default":true,"description":"Import open tickets as needing a person and waiting ones as waiting on the customer (the default). false closes them all. Nothing is sent either way.","type":"boolean"}},"required":["source","tickets"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string"},"dryRun":{"type":"boolean"},"imported":{"type":"number","description":"Tickets imported, or in a dry run, that would be."},"updated":{"type":"number","description":"Already imported from this source, and given the messages or notes they didn't have."},"skipped":{"type":"number","description":"Already imported from this source in full, so left as they are."},"rejected":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"externalId":{"type":["string","null"]},"reason":{"type":"string"}},"required":["index","externalId","reason"],"additionalProperties":false},"description":"Invalid tickets, by their place in the batch."},"messages":{"type":"number"},"notes":{"type":"number"},"attachments":{"type":"object","properties":{"fetching":{"type":"number"},"tooOld":{"type":"number"}},"required":["fetching","tooOld"],"additionalProperties":false,"description":"Files fetched in the background, and ones left out as too old."},"remaining":{"type":"object","properties":{"tickets":{"type":"number"},"messages":{"type":"number"}},"required":["tickets","messages"],"additionalProperties":false,"description":"What's left of the workspace's import limits."},"preview":{"description":"In a dry run, the first few tickets as they'd be imported. Show them to the person before importing the rest.","type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"subject":{"type":"string"},"customer":{"type":"string"},"status":{"type":"string","enum":["open","waiting","closed"]},"createdAt":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string"},"sentAt":{"type":"string"},"text":{"type":"string"},"attachments":{"type":"number"}},"required":["author","sentAt","text","attachments"],"additionalProperties":false}},"notes":{"type":"number"}},"required":["externalId","subject","customer","status","createdAt","messages","notes"],"additionalProperties":false}}},"required":["source","dryRun","imported","updated","skipped","rejected","messages","notes","attachments","remaining"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/export":{"get":{"operationId":"exportTickets","summary":"Export tickets","description":"Every ticket in the workspace, a page at a time, oldest first, in the import format: its messages, notes, and links to its files. Deleted and sample tickets are left out. Admins only.","x-required-scope":"tickets:import","security":[{"bearer":["tickets:import"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"after","in":"query","required":false,"schema":{"description":"The nextCursor from the page before. Leave it out for the first page.","type":"integer","minimum":0,"maximum":9007199254740991},"description":"The nextCursor from the page before. Leave it out for the first page."},{"name":"limit","in":"query","required":false,"schema":{"default":50,"description":"Tickets on this page.","type":"integer","minimum":1,"maximum":100},"description":"Tickets on this page."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tickets":{"type":"array","items":{"type":"object","properties":{"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"number"}],"description":"The ticket's id in the tool. A ticket already imported from the same source only gets the messages and notes it doesn't have yet."},"subject":{"type":"string","maxLength":1000},"status":{"description":"Its status in the tool: open when it waits on the team, waiting when it waits on the customer, closed when it's done. Give it whenever the tool has one: open and waiting tickets stay that way unless keepOpen is false. Without it a ticket arrives closed. Leave out spam and deleted tickets.","type":"string","enum":["open","waiting","closed"]},"createdAt":{"description":"When it was opened. Defaults to its first message.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"url":{"description":"The ticket's page in the tool, linked from answerable.","type":"string","maxLength":2000,"format":"uri"},"customer":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","description":"Customers are matched by email."},"name":{"type":"string","maxLength":200}},"required":["email"],"additionalProperties":false},"messages":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"externalId":{"description":"The message's id in the tool, if it has one. A message already imported with it isn't added again.","anyOf":[{"type":"string","maxLength":200},{"type":"number"}]},"author":{"type":"string","enum":["customer","team","bot","note"],"description":"customer: the customer wrote it. team: someone on the team replied (matched to a member by email when there is one). bot: the tool's own automation replied. note: an internal note the customer never saw."},"from":{"description":"Who wrote it. For customer messages it defaults to the ticket's customer.","type":"object","properties":{"email":{"description":"Their email address.","type":"string","maxLength":320},"name":{"description":"Their name.","type":"string","maxLength":200}},"additionalProperties":false},"sentAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When it was sent, in ISO 8601 with a time zone."},"text":{"description":"The body as plain text, when that's all the tool has. Give text or html. Runs of blank lines become one. HTML escapes in it (&gt;) are unescaped, and text with HTML tags is read as html.","type":"string"},"html":{"description":"The body as HTML, exactly as the tool gives it, read as an arriving email is: shown with its paragraphs and formatting (links, lists, bold), and as text to the agent. Better than text when the tool has it. Don't strip its tags or turn it into text yourself: that loses its blank lines and leaves escapes like &gt; in the text.","type":"string"},"messageId":{"description":"The email's Message-ID header, when it was an email. A customer replying to that email later lands in this ticket.","type":"string","maxLength":998},"attachments":{"description":"Files, fetched in the background for messages from the last 12 months only, once, when the message is first imported. A file that can't be fetched is listed as unavailable, and sending the ticket again doesn't fetch it again.","maxItems":20,"type":"array","items":{"type":"object","properties":{"url":{"type":"string","maxLength":4000,"format":"uri","description":"A public https address answerable's servers download the file from, once, without signing in, not a path on your computer. Check that it downloads without credentials before importing."},"filename":{"type":"string","maxLength":255},"contentType":{"type":"string","maxLength":255}},"required":["url"],"additionalProperties":false}}},"required":["author","sentAt"],"additionalProperties":false},"description":"Oldest first or in any order; they're sorted by sentAt. Only the most recent 500 are kept."},"number":{"type":"number","description":"The ticket's number in answerable, also its externalId."},"type":{"description":"Its ticket type, e.g. \"Billing and subscriptions\".","type":["string","null"]},"spam":{"type":"boolean"}},"required":["externalId","customer","messages","number","type","spam"],"additionalProperties":false},"description":"Oldest first, in the import format. Files' links work for 7 days. Notes are messages by \"note\"."},"nextCursor":{"description":"Pass as after for the next page; null on the last.","type":["number","null"]}},"required":["tickets","nextCursor"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}/agent":{"get":{"operationId":"getAgent","summary":"Get the agent's settings","description":"The agent's instructions, reply style, spam handling, rules, ticket types, and safeguards at the current version, or at `version`, with the latest versions and what each changed, and the workspace's people by id.","x-required-scope":"agent:read","security":[{"bearer":["agent:read"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},{"name":"version","in":"query","required":false,"schema":{"description":"An earlier version to read, from history. Leave it out for the current settings.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"An earlier version to read, from history. Leave it out for the current settings."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","description":"The version shown."},"currentVersion":{"type":"number","description":"The latest version. Pass it as expectedVersion to update_agent."},"savedAt":{"type":"string"},"savedBy":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"Who saved it; null if their account was deleted."},"via":{"description":"The app or key they used, e.g. \"Claude Code\"; null in answerable itself.","type":["string","null"]},"restoredFrom":{"description":"The earlier version it brought back, if it was a restore.","type":["number","null"]},"document":{"type":"object","properties":{"instructions":{"type":"string","maxLength":20000,"description":"What the agent should know and do, in the team's words, beyond answerable's own rules. Up to 20,000 characters."},"replyStyle":{"type":"object","properties":{"name":{"type":"string","maxLength":40,"description":"The name replies are signed with, such as \"Abel\". Empty to sign as the team."},"signOff":{"type":"string","maxLength":200,"description":"How every reply ends, exactly as written, lines separated by \\n, such as \"Best,\\nAva\\nCustomer support, Slides\". Empty to let the agent write a short, plain one."},"tone":{"type":"string","enum":["FRIENDLY","NEUTRAL","FORMAL"],"description":"FRIENDLY (Friendly): Warm and plain, like a helpful person on the team. NEUTRAL (Neutral): Polite and matter-of-fact, without small talk. FORMAL (Formal): Courteous full sentences, no contractions or slang."},"length":{"type":"string","enum":["SHORT","BALANCED","DETAILED"],"description":"SHORT (Short): A few sentences, plus steps when they're needed. BALANCED (Balanced): A short paragraph or two that covers the answer fully. DETAILED (Detailed): Explains the why and gives complete steps."},"examples":{"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000},"description":"Up to 3 replies the team likes, as models for voice and length."}},"required":["name","signOff","tone","length","examples"],"additionalProperties":false,"description":"How the agent writes to customers (the Replies tab)."},"spamHandling":{"type":"string","enum":["CLOSE_WHEN_SURE","REVIEW"],"description":"Clear spam: CLOSE_WHEN_SURE closes it, REVIEW leaves it for a person."},"safeguards":{"type":"object","properties":{"repliesPerCustomerPerDay":{"type":"number","description":"Replies the agent may send one address in a day, across tickets: 3, 5, or 10."},"repliesPerTicket":{"type":"number","description":"Replies of any kind the agent may send on a ticket before a person acts on it: 2, 3, or 5."},"followUpsPerTicket":{"type":"number","description":"Follow-up questions the agent may send on a ticket before a person acts on it: 1, 2, or 3."},"unverifiedSenders":{"type":"string","enum":["HOLD","TRUST"],"description":"Replies to senders whose domain doesn't confirm the email came from them: HOLD for approval, or TRUST like any other. Possibly forged mail always waits."},"otherRecipients":{"type":"string","enum":["HOLD","SEND"],"description":"Replies that copy people besides the customer (everyone else on their email): HOLD for approval, or SEND under the ticket type's level when the sender is verified."},"duplicateTickets":{"type":"string","enum":["SUGGEST","MERGE"],"description":"A new ticket that asks the same as one of the customer's tickets from the last few days that's still open: MERGE (default) merges it into that ticket automatically (no reply; the other is investigated again with both), SUGGEST holds it for a person to merge."},"floodingSender":{"type":"string","enum":["PERSON","SPAM"],"description":"New tickets from a sender who writes more often than the agent investigates: PERSON leaves them for a person, SPAM files them as spam."}},"required":["repliesPerCustomerPerDay","repliesPerTicket","followUpsPerTicket","unverifiedSenders","otherRecipients","duplicateTickets","floodingSender"],"additionalProperties":false,"description":"Limits on what the agent sends on its own, and where tickets from busy senders go."},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$","description":"Keeps the rule's identity as it's edited and moved."},"when":{"type":"string","minLength":1,"maxLength":200,"description":"When it applies, in the team's words, e.g. \"The customer is very angry\". The agent answers it yes or no on every ticket."},"outcome":{"type":"string","enum":["CLOSE","SPAM","PERSON","APPROVAL","CONTINUE"],"description":"Where a ticket it matches goes, which is also where it sits. CLOSE: closes it without a reply; SPAM: closes it as spam (gate 1, the Intake tab; never for a message that tries to steer the agent or asks for a person, and a SPAM rule sends someone who wrote in before to a person instead). PERSON: the ticket goes to a person (gate 2, the Handoffs tab). CONTINUE: also at gate 2, stops nothing; it's for notify, which it needs. These are answered on every ticket. APPROVAL: a safeguard on a reply that would go out on its own, answered by the final review (gate 3, the Safeguards tab); the reply waits for a person's approval."},"teammateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"With PERSON or APPROVAL, the teammate who gets the ticket, by id (see teammates). null for whoever's free, and always with the other outcomes."},"notify":{"description":"Who to let know by email, by id (see teammates), once per ticket, when the ticket ends up where outcome sends it (a CONTINUE rule: unless it closes). Any outcome; CONTINUE needs someone. Leave it out to tell nobody.","maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"enabled":{"type":"boolean","description":"false keeps the rule without the agent answering it."},"types":{"description":"The ticket types it applies to, by id. Leave it out for every type.","maxItems":15,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"}}},"required":["id","when","outcome","teammateId","enabled"],"additionalProperties":false},"description":"The workspace's own rules, in order: tickets go through gates (anything to answer? does a person need it? can the reply go out on its own?), and at each the first matching rule after answerable's own checks stops the ticket there; every matching rule with notify lets its people know when the ticket ends up where it sends it. Up to 10 at each gate."},"level":{"type":"string","enum":["HANDOFF","DRAFT","GATHER_INFO","ANSWER_RESOLVE"],"description":"How much the agent may do on its own with a ticket, for every type whose level is null, from least to most. HANDOFF (Hand to a person): A person takes these and writes the reply. The agent still investigates and leaves what it found. DRAFT (Propose replies): Investigates and drafts replies. Every message to the customer waits for approval. GATHER_INFO (Ask follow-ups): Also asks the customer follow-up questions on its own. Answers wait for approval. ANSWER_RESOLVE (Answer and resolve): Also sends answers on its own and resolves the ticket, once they pass the checks before sending. A type set to this level follows it."},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$","description":"Tickets keep their type by this id, so a renamed type keeps its tickets and stats."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"What the type is called. The agent sorts tickets by the name and description."},"description":{"type":"string","maxLength":300,"description":"What belongs in the type, and what doesn't. Can be empty."},"level":{"anyOf":[{"type":"string","enum":["HANDOFF","DRAFT","GATHER_INFO","ANSWER_RESOLVE"]},{"type":"null"}],"description":"How much the agent may do on its own with these tickets, as for the agent's level. null follows the agent's level."},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Who gets these tickets when they wait on a person, by id (see teammates); null for anyone. A rule that names someone wins."},"instructions":{"default":"","description":"How to answer these tickets, on top of the company's instructions: what to include, link, or avoid. The agent follows them when it writes a reply to a ticket of this type. Can be empty.","type":"string","maxLength":2000}},"required":["id","name","description","level","ownerId","instructions"],"additionalProperties":false},"description":"What the agent sorts tickets into, in order, up to 15, with \"OTHER\" (Other or unclear) last."},"knowledgeSources":{"type":"array","items":{"type":"string"},"description":"The knowledge sources the agent reads, by id (see knowledgeSources)."},"connectors":{"type":"array","items":{"type":"string"},"description":"The connectors that are on, by id (see connectors): your product, Stripe, APIs and MCP servers."},"tools":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"mode":{"type":"string","enum":["ON","TEAM","APPROVAL","AUTO"]},"when":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"limit":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]}},"required":["mode","when","limit"],"additionalProperties":false,"description":"A read that's on is { mode: \"ON\" }; an action that's on has who may take it: TEAM (people take it from a ticket), APPROVAL (the agent proposes it, someone approves), or AUTO (the agent takes it on its own when its reply goes out on its own). when is the company's rule for using it; limit, for money actions only, is the most it moves on its own, in the currency's main unit."},"description":"Each tool's setting, by key (<connector id>:<tool id>, see tools). A tool with none is off."}},"required":["instructions","replyStyle","spamHandling","safeguards","rules","level","types","knowledgeSources","connectors","tools"],"additionalProperties":false,"description":"The settings at this version."},"teammates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"description":"The workspace's people, for the teammateId of rules and the ownerId of types."},"knowledgeSources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","description":"DOCS_SITE, FILES, DOCS_SEARCH, LEARNED or HELP_CENTER."},"name":{"type":"string"}},"required":["id","kind","name"],"additionalProperties":false},"description":"The workspace's knowledge sources (get_knowledge_sources), for the agent's knowledgeSources."},"connectors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["YOUR_PRODUCT","STRIPE","API","MCP"]},"name":{"type":"string"}},"required":["id","kind","name"],"additionalProperties":false},"description":"The workspace's connectors (get_connectors), for the agent's connectors."},"tools":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"connectorId":{"type":"string"},"name":{"type":"string"},"effect":{"type":"string","enum":["READ","CHANGE","DESTRUCTIVE","MONEY"],"description":"READ checks something; CHANGE, MONEY and DESTRUCTIVE act."}},"required":["key","connectorId","name","effect"],"additionalProperties":false},"description":"Every tool the connectors offer, by key, for the agent's tools."},"history":{"type":"array","items":{"type":"object","properties":{"version":{"type":"number"},"savedAt":{"type":"string"},"savedBy":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"Who saved it; null if their account was deleted."},"via":{"description":"The app or key they used, e.g. \"Claude Code\"; null in answerable itself.","type":["string","null"]},"restoredFrom":{"description":"The earlier version it brought back, if it was a restore.","type":["number","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"tab":{"type":"string","enum":["Instructions","Replies","Intake","Handoffs","Autonomy","Safeguards","Knowledge","Integrations"],"description":"Where the setting is in answerable."},"text":{"type":"string","description":"The change, e.g. \"Billing and subscriptions: Propose replies to Answer and resolve\"."},"lines":{"description":"For rewritten text, the lines taken out and put in.","type":"object","properties":{"removed":{"type":"array","items":{"type":"string"}},"added":{"type":"array","items":{"type":"string"}}},"required":["removed","added"],"additionalProperties":false}},"required":["tab","text"],"additionalProperties":false},"description":"What it changed from the version before."}},"required":["version","savedAt","savedBy","via","restoredFrom","changes"],"additionalProperties":false},"description":"The latest versions, newest first."},"url":{"type":"string","description":"The agent's settings in answerable."}},"required":["version","currentVersion","savedAt","savedBy","via","restoredFrom","document","teammates","knowledgeSources","connectors","tools","history","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAgent","summary":"Change the agent's settings","description":"Save `changes` (the parts of the settings to change, shaped as the GET returns them) or `restoreVersion` (an earlier version to bring back) as a new version. `rules` and `types` replace the whole list. Returns 409 if someone saved since `expectedVersion`. Admins only.","x-required-scope":"agent:configure","security":[{"bearer":["agent:configure"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The current version, from get_agent. If someone saved since, nothing changes: read the settings again and redo the change."},"changes":{"description":"The settings to change, in the shape get_agent returns them. Only the parts you send change. Send either changes or restoreVersion.","type":"object","properties":{"instructions":{"type":"string","maxLength":20000,"description":"What the agent should know and do, in the team's words, beyond answerable's own rules. Up to 20,000 characters."},"replyStyle":{"type":"object","properties":{"name":{"type":"string","maxLength":40,"description":"The name replies are signed with, such as \"Abel\". Empty to sign as the team."},"signOff":{"type":"string","maxLength":200,"description":"How every reply ends, exactly as written, lines separated by \\n, such as \"Best,\\nAva\\nCustomer support, Slides\". Empty to let the agent write a short, plain one."},"tone":{"type":"string","enum":["FRIENDLY","NEUTRAL","FORMAL"],"description":"FRIENDLY (Friendly): Warm and plain, like a helpful person on the team. NEUTRAL (Neutral): Polite and matter-of-fact, without small talk. FORMAL (Formal): Courteous full sentences, no contractions or slang."},"length":{"type":"string","enum":["SHORT","BALANCED","DETAILED"],"description":"SHORT (Short): A few sentences, plus steps when they're needed. BALANCED (Balanced): A short paragraph or two that covers the answer fully. DETAILED (Detailed): Explains the why and gives complete steps."},"examples":{"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":4000},"description":"Up to 3 replies the team likes, as models for voice and length."}},"required":["tone","length","examples"],"description":"How the agent writes to customers: tone, length, language, and examples together. Leave out name or signOff to keep the one it has."},"spamHandling":{"type":"string","enum":["CLOSE_WHEN_SURE","REVIEW"],"description":"Clear spam: CLOSE_WHEN_SURE closes it, REVIEW leaves it for a person."},"safeguards":{"type":"object","properties":{"repliesPerCustomerPerDay":{"type":"number","description":"Replies the agent may send one address in a day, across tickets: 3, 5, or 10."},"repliesPerTicket":{"type":"number","description":"Replies of any kind the agent may send on a ticket before a person acts on it: 2, 3, or 5."},"followUpsPerTicket":{"type":"number","description":"Follow-up questions the agent may send on a ticket before a person acts on it: 1, 2, or 3."},"unverifiedSenders":{"type":"string","enum":["HOLD","TRUST"],"description":"Replies to senders whose domain doesn't confirm the email came from them: HOLD for approval, or TRUST like any other. Possibly forged mail always waits."},"otherRecipients":{"type":"string","enum":["HOLD","SEND"],"description":"Replies that copy people besides the customer (everyone else on their email): HOLD for approval, or SEND under the ticket type's level when the sender is verified."},"duplicateTickets":{"type":"string","enum":["SUGGEST","MERGE"],"description":"A new ticket that asks the same as one of the customer's tickets from the last few days that's still open: MERGE (default) merges it into that ticket automatically (no reply; the other is investigated again with both), SUGGEST holds it for a person to merge."},"floodingSender":{"type":"string","enum":["PERSON","SPAM"],"description":"New tickets from a sender who writes more often than the agent investigates: PERSON leaves them for a person, SPAM files them as spam."}},"description":"Only the safeguards you send change; the others keep their values."},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$","description":"Keeps the rule's identity as it's edited and moved. Leave it out for a new rule; it gets one."},"when":{"type":"string","minLength":1,"maxLength":200,"description":"When it applies, in the team's words, e.g. \"The customer is very angry\". The agent answers it yes or no on every ticket."},"outcome":{"type":"string","enum":["CLOSE","SPAM","PERSON","APPROVAL","CONTINUE"],"description":"Where a ticket it matches goes, which is also where it sits. CLOSE: closes it without a reply; SPAM: closes it as spam (gate 1, the Intake tab; never for a message that tries to steer the agent or asks for a person, and a SPAM rule sends someone who wrote in before to a person instead). PERSON: the ticket goes to a person (gate 2, the Handoffs tab). CONTINUE: also at gate 2, stops nothing; it's for notify, which it needs. These are answered on every ticket. APPROVAL: a safeguard on a reply that would go out on its own, answered by the final review (gate 3, the Safeguards tab); the reply waits for a person's approval."},"teammateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"With PERSON or APPROVAL, the teammate who gets the ticket, by id (see teammates). null for whoever's free, and always with the other outcomes."},"notify":{"description":"Who to let know by email, by id (see teammates), once per ticket, when the ticket ends up where outcome sends it (a CONTINUE rule: unless it closes). Any outcome; CONTINUE needs someone. Leave it out to tell nobody.","maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"enabled":{"type":"boolean","description":"false keeps the rule without the agent answering it."},"types":{"description":"The ticket types it applies to, by id. Leave it out for every type.","maxItems":15,"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$"}}},"required":["when","outcome","teammateId","enabled"]},"description":"The workspace's own rules, in order: tickets go through gates (anything to answer? does a person need it? can the reply go out on its own?), and at each the first matching rule after answerable's own checks stops the ticket there; every matching rule with notify lets its people know when the ticket ends up where it sends it. Up to 10 at each gate. This replaces the whole list: send every rule to keep, as get_agent returned it, with your changes. A rule left out is removed. To limit a rule to a type you're adding, add the type first."},"level":{"type":"string","enum":["HANDOFF","DRAFT","GATHER_INFO","ANSWER_RESOLVE"],"description":"How much the agent may do on its own with a ticket, for every type whose level is null, from least to most. HANDOFF (Hand to a person): A person takes these and writes the reply. The agent still investigates and leaves what it found. DRAFT (Propose replies): Investigates and drafts replies. Every message to the customer waits for approval. GATHER_INFO (Ask follow-ups): Also asks the customer follow-up questions on its own. Answers wait for approval. ANSWER_RESOLVE (Answer and resolve): Also sends answers on its own and resolves the ticket, once they pass the checks before sending. A type set to this level follows it."},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,40}$","description":"Tickets keep their type by this id, so a renamed type keeps its tickets and stats. Leave it out for a new type; it gets one. \"OTHER\" is \"Other or unclear\"."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"What the type is called. The agent sorts tickets by the name and description."},"description":{"type":"string","maxLength":300,"description":"What belongs in the type, and what doesn't. Can be empty."},"level":{"anyOf":[{"type":"string","enum":["HANDOFF","DRAFT","GATHER_INFO","ANSWER_RESOLVE"]},{"type":"null"}],"description":"How much the agent may do on its own with these tickets, as for the agent's level. null follows the agent's level."},"ownerId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"Who gets these tickets when they wait on a person, by id (see teammates); null for anyone. A rule that names someone wins."},"instructions":{"default":"","description":"How to answer these tickets, on top of the company's instructions: what to include, link, or avoid. The agent follows them when it writes a reply to a ticket of this type. Can be empty.","type":"string","maxLength":2000}},"required":["name","description","level","ownerId"]},"description":"What the agent sorts tickets into, in order, up to 15, with \"OTHER\" (Other or unclear) last. This replaces the whole list: send every type to keep, with its id, so its tickets stay with it. A type left out is removed, and its tickets count as Other or unclear."},"knowledgeSources":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The knowledge sources the agent reads, by id (see knowledgeSources). This replaces the whole list: a source left out is turned off. Add and set them up with update_knowledge_sources."},"connectors":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"The connectors that are on, by id (see connectors). This replaces the whole list: a connector left out is turned off, with its tools."},"tools":{"type":"object","propertyNames":{"type":"string","pattern":"^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}):([A-Za-z0-9_.-]{1,128})$"},"additionalProperties":{"type":"object","properties":{"mode":{"type":"string","enum":["ON","TEAM","APPROVAL","AUTO"]},"when":{"default":null,"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"limit":{"default":null,"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000},{"type":"null"}]}},"required":["mode"]},"description":"Each tool's setting, by key (<connector id>:<tool id>, see tools). A tool with none is off. This replaces the whole map: send every setting to keep, as get_agent returned it. A tool left out is turned off."}}},"restoreVersion":{"description":"Instead of changes: an earlier version to bring back, from get_agent's history. It's saved as a new version, so it can be undone the same way.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["expectedVersion"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"number","description":"The version now current: a new one, or expectedVersion when nothing changed."},"changed":{"type":"boolean","description":"false when the settings already were as asked, and no version was saved."},"changes":{"type":"array","items":{"type":"object","properties":{"tab":{"type":"string","enum":["Instructions","Replies","Intake","Handoffs","Autonomy","Safeguards","Knowledge","Integrations"],"description":"Where the setting is in answerable."},"text":{"type":"string","description":"The change, e.g. \"Billing and subscriptions: Propose replies to Answer and resolve\"."},"lines":{"description":"For rewritten text, the lines taken out and put in.","type":"object","properties":{"removed":{"type":"array","items":{"type":"string"}},"added":{"type":"array","items":{"type":"string"}}},"required":["removed","added"],"additionalProperties":false}},"required":["tab","text"],"additionalProperties":false},"description":"What changed, in words."},"url":{"type":"string","description":"The agent's settings in answerable."}},"required":["version","changed","changes","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspaces/{workspace}":{"get":{"operationId":"getWorkspace","summary":"Get the workspace's settings","description":"Its name, test mode, plan and credits, members, where connecting its support address stands (with the DNS records to add), the contact form, and its webhooks. No secrets. Admins only.","x-required-scope":"workspace:configure","security":[{"bearer":["workspace:configure"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string","description":"The workspace's address."},"languages":{"type":"object","properties":{"team":{"type":"string"},"customers":{"type":"array","items":{"type":"string"}},"replyInCustomerLanguage":{"type":"boolean"}},"required":["team","customers","replyInCustomerLanguage"],"additionalProperties":false,"description":"The team's language, the customers' languages (the main one first), and whether customers are answered in their own language (ISO 639-1 codes)."},"testMode":{"type":"object","properties":{"on":{"type":"boolean"},"changedAt":{"type":["string","null"]},"changedBy":{"type":["string","null"]}},"required":["on","changedAt","changedBy"],"additionalProperties":false,"description":"In test mode, replies are emailed only to the workspace's members. Only a person can turn it off, in answerable."},"plan":{"type":"object","properties":{"plan":{"type":"string"},"state":{"type":"string","description":"trial, subscribed or expired."},"endsAt":{"description":"When the trial or plan ends; null for no end.","type":["string","null"]},"credits":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":["number","null"]},"resets":{"type":["string","null"]}},"required":["used","limit","resets"],"additionalProperties":false,"description":"AI credits used this period."},"paused":{"description":"Why answerable's agent is paused, when it is.","type":["string","null"]}},"required":["plan","state","endsAt","credits","paused"],"additionalProperties":false},"members":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"type":"string","description":"ADMIN or MEMBER."}},"required":["name","email","role"],"additionalProperties":false}},"invitations":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string"},"expired":{"type":"boolean"}},"required":["email","role","expired"],"additionalProperties":false},"description":"People invited who haven't joined yet."},"email":{"type":"object","properties":{"step":{"type":"string","enum":["address","domain","forwarding","connected"],"description":"Where connecting the support address stands: address (none yet), domain (DNS records to add), forwarding, or connected."},"senderName":{"type":"string"},"from":{"description":"The address replies come from now; null where email isn't set up on this server.","type":["string","null"]},"supportAddress":{"description":"The company's own support address, connected or being connected.","type":["string","null"]},"forwardTo":{"type":"string","description":"Where the support address's mail is to be forwarded."},"domain":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","description":"PENDING, VERIFIED or FAILED."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","description":"DKIM, SPF or DMARC."},"type":{"type":"string","description":"TXT, MX or CNAME."},"name":{"type":"string","description":"Relative to the domain."},"value":{"type":"string"},"priority":{"type":"number"},"status":{"description":"pending, verified or failed.","type":"string"}},"required":["purpose","type","name","value"],"additionalProperties":false},"description":"The DNS records to add."},"checkedAt":{"type":["string","null"]}},"required":["name","status","records","checkedAt"],"additionalProperties":false},{"type":"null"}]},"forwarding":{"type":"object","properties":{"verifiedAt":{"type":["string","null"]},"testSentAt":{"type":["string","null"]}},"required":["verifiedAt","testSentAt"],"additionalProperties":false,"description":"Whether mail sent to the support address has arrived."}},"required":["step","senderName","from","supportAddress","forwardTo","domain","forwarding"],"additionalProperties":false},"widget":{"type":"object","properties":{"enabled":{"type":"boolean"},"mode":{"type":"string","description":"CHAT or FORM: what the widget's button opens."},"chat":{"type":"object","properties":{"greeting":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}},"signedInAccess":{"type":"boolean"},"verifyEmail":{"type":"boolean"},"budgetShare":{"type":"number"}},"required":["greeting","suggestions","signedInAccess","verifyEmail","budgetShare"],"additionalProperties":false},"allowedOrigins":{"type":"array","items":{"type":"string"}},"embed":{"type":"string","description":"The script tag that adds the widget to a site. More options are in the docs."}},"required":["enabled","mode","chat","allowedOrigins","embed"],"additionalProperties":false},"webhooks":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Where events are posted. A Slack address shows only its host."},"events":{"type":"array","items":{"type":"string"},"description":"The events it gets, e.g. \"ticket.needs_attention\"."},"paused":{"description":"Why nothing is being sent, when deliveries kept failing and it was paused.","type":["string","null"]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"event":{"type":"string"},"status":{"type":"string"},"at":{"type":"string"}},"required":["event","status","at"],"additionalProperties":false},{"type":"null"}]}},"required":["url","events","paused","lastDelivery"],"additionalProperties":false},"description":"Read only: webhooks are added and changed in answerable."},"url":{"type":"string","description":"The workspace's settings in answerable."}},"required":["name","slug","languages","testMode","plan","members","invitations","email","widget","webhooks","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWorkspace","summary":"Change the workspace's settings","description":"Change its name, sender name, support address (or check its DNS records, or send a forwarding test), and contact form. Only the fields sent change. Members, webhooks, and turning test mode off stay in answerable. Admins only.","x-required-scope":"workspace:configure","security":[{"bearer":["workspace:configure"]}],"parameters":[{"name":"workspace","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."},"description":"The workspace's address, e.g. \"acme\" (see list_workspaces)."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The workspace's name. Its address stays the same.","type":"string","maxLength":100},"senderName":{"description":"The name replies are sent under, e.g. \"Slides Support\".","type":"string","maxLength":80},"supportAddress":{"description":"Start connecting the company's own support address, e.g. support@slides.com, or change it, so replies come from it. Returns the DNS records to add and where to forward its mail. Until it's connected, replies come from answerable's address.","type":"string","maxLength":254},"checkEmail":{"description":"true asks the email provider to look for the domain's DNS records again. The email setup that comes back says what it found.","type":"boolean"},"sendForwardingTest":{"description":"true emails the support address, to check its mail is forwarded to answerable. Read the workspace again in a minute to see whether it arrived.","type":"boolean"},"languages":{"description":"The workspace's languages (Workspace → General → Languages).","type":"object","properties":{"team":{"description":"The language the team works in (ISO 639-1): the agent writes for the team in it, and customers' messages in other languages are translated into it. One of en, es, fr, de, pt, it, nl, sv, no, da, fi, pl, ja, zh, ko.","type":"string","enum":["en","es","fr","de","pt","it","nl","sv","no","da","fi","pl","ja","zh","ko"]},"customers":{"description":"The languages customers are served in, the main one first: the widget, help site and emails to customers speak them, and new help articles are written in the main one. Any of en, sv, es. This replaces the whole list.","minItems":1,"type":"array","items":{"type":"string","enum":["en","sv","es"]}},"replyInCustomerLanguage":{"description":"Whether customers are answered in the language they write in; false answers them in the main customer language.","type":"boolean"}},"additionalProperties":false},"widget":{"description":"The widget on the company's site: a live chat or a contact form, whose messages become tickets.","type":"object","properties":{"enabled":{"description":"Whether the widget is on.","type":"boolean"},"mode":{"description":"What its button opens: CHAT, the AI assistant answering from the knowledge (it offers to send the chat to the team when it can't help), or FORM, the contact form.","type":"string","enum":["CHAT","FORM"]},"chat":{"type":"object","properties":{"greeting":{"description":"The chat's first message, in Markdown. Empty uses a default welcome: how can we help, ask anything about <name>, or it's passed on to the team.","type":"string","maxLength":600},"suggestions":{"description":"Up to 3 questions visitors can ask with a tap. This replaces the whole list.","maxItems":3,"type":"array","items":{"type":"string","maxLength":80}},"signedInAccess":{"description":"Whether visitors the site signs in can ask about their own account, billing, and tickets.","type":"boolean"},"verifyEmail":{"description":"Whether visitors the site doesn't sign in confirm their email address with an emailed code before they can start a chat.","type":"boolean"},"budgetShare":{"description":"The percentage of each period's AI credits the chat may use; past it, the button opens the form.","anyOf":[{"type":"number","const":10},{"type":"number","const":30},{"type":"number","const":50},{"type":"number","const":100}]}},"additionalProperties":false},"allowedOrigins":{"description":"The sites the widget may be used on, e.g. [\"https://slides.com\", \"https://*.slides.com\"] (any one subdomain, https only). This replaces the whole list.","maxItems":20,"type":"array","items":{"type":"string"}}}}},"required":[]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string","description":"The workspace's address."},"languages":{"type":"object","properties":{"team":{"type":"string"},"customers":{"type":"array","items":{"type":"string"}},"replyInCustomerLanguage":{"type":"boolean"}},"required":["team","customers","replyInCustomerLanguage"],"additionalProperties":false,"description":"The team's language, the customers' languages (the main one first), and whether customers are answered in their own language (ISO 639-1 codes)."},"testMode":{"type":"object","properties":{"on":{"type":"boolean"},"changedAt":{"type":["string","null"]},"changedBy":{"type":["string","null"]}},"required":["on","changedAt","changedBy"],"additionalProperties":false,"description":"In test mode, replies are emailed only to the workspace's members. Only a person can turn it off, in answerable."},"plan":{"type":"object","properties":{"plan":{"type":"string"},"state":{"type":"string","description":"trial, subscribed or expired."},"endsAt":{"description":"When the trial or plan ends; null for no end.","type":["string","null"]},"credits":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":["number","null"]},"resets":{"type":["string","null"]}},"required":["used","limit","resets"],"additionalProperties":false,"description":"AI credits used this period."},"paused":{"description":"Why answerable's agent is paused, when it is.","type":["string","null"]}},"required":["plan","state","endsAt","credits","paused"],"additionalProperties":false},"members":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"},"role":{"type":"string","description":"ADMIN or MEMBER."}},"required":["name","email","role"],"additionalProperties":false}},"invitations":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string"},"expired":{"type":"boolean"}},"required":["email","role","expired"],"additionalProperties":false},"description":"People invited who haven't joined yet."},"email":{"type":"object","properties":{"step":{"type":"string","enum":["address","domain","forwarding","connected"],"description":"Where connecting the support address stands: address (none yet), domain (DNS records to add), forwarding, or connected."},"senderName":{"type":"string"},"from":{"description":"The address replies come from now; null where email isn't set up on this server.","type":["string","null"]},"supportAddress":{"description":"The company's own support address, connected or being connected.","type":["string","null"]},"forwardTo":{"type":"string","description":"Where the support address's mail is to be forwarded."},"domain":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","description":"PENDING, VERIFIED or FAILED."},"records":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","description":"DKIM, SPF or DMARC."},"type":{"type":"string","description":"TXT, MX or CNAME."},"name":{"type":"string","description":"Relative to the domain."},"value":{"type":"string"},"priority":{"type":"number"},"status":{"description":"pending, verified or failed.","type":"string"}},"required":["purpose","type","name","value"],"additionalProperties":false},"description":"The DNS records to add."},"checkedAt":{"type":["string","null"]}},"required":["name","status","records","checkedAt"],"additionalProperties":false},{"type":"null"}]},"forwarding":{"type":"object","properties":{"verifiedAt":{"type":["string","null"]},"testSentAt":{"type":["string","null"]}},"required":["verifiedAt","testSentAt"],"additionalProperties":false,"description":"Whether mail sent to the support address has arrived."}},"required":["step","senderName","from","supportAddress","forwardTo","domain","forwarding"],"additionalProperties":false},"widget":{"type":"object","properties":{"enabled":{"type":"boolean"},"mode":{"type":"string","description":"CHAT or FORM: what the widget's button opens."},"chat":{"type":"object","properties":{"greeting":{"type":"string"},"suggestions":{"type":"array","items":{"type":"string"}},"signedInAccess":{"type":"boolean"},"verifyEmail":{"type":"boolean"},"budgetShare":{"type":"number"}},"required":["greeting","suggestions","signedInAccess","verifyEmail","budgetShare"],"additionalProperties":false},"allowedOrigins":{"type":"array","items":{"type":"string"}},"embed":{"type":"string","description":"The script tag that adds the widget to a site. More options are in the docs."}},"required":["enabled","mode","chat","allowedOrigins","embed"],"additionalProperties":false},"webhooks":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Where events are posted. A Slack address shows only its host."},"events":{"type":"array","items":{"type":"string"},"description":"The events it gets, e.g. \"ticket.needs_attention\"."},"paused":{"description":"Why nothing is being sent, when deliveries kept failing and it was paused.","type":["string","null"]},"lastDelivery":{"anyOf":[{"type":"object","properties":{"event":{"type":"string"},"status":{"type":"string"},"at":{"type":"string"}},"required":["event","status","at"],"additionalProperties":false},{"type":"null"}]}},"required":["url","events","paused","lastDelivery"],"additionalProperties":false},"description":"Read only: webhooks are added and changed in answerable."},"url":{"type":"string","description":"The workspace's settings in answerable."}},"required":["name","slug","languages","testMode","plan","members","invitations","email","widget","webhooks","url"],"additionalProperties":false}}}},"400":{"description":"The request isn't valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key or token is missing, revoked, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key or connection doesn't have the permission this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such workspace or ticket, or no access to it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The ticket or the agent's settings changed since they were read (e.g. the customer wrote again).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"A limit was reached. Retry-After says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"ticket.needs_attention":{"post":{"summary":"Needs attention","description":"A ticket starts waiting for a person: a reply to approve, a handoff, a failed investigation, or a reply that wasn't delivered. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"ticket.answered":{"post":{"summary":"Answered by the agent","description":"The agent replied on its own, and resolved the ticket or asked the customer something. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"message.received":{"post":{"summary":"Customer wrote","description":"A customer's message arrives, new ticket or reply, before the agent looks at it. Spam and automatic email are left out. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"message.sent":{"post":{"summary":"Reply sent","description":"A reply goes out to the customer, from the agent, a teammate, or an app. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"message.failed":{"post":{"summary":"Reply not delivered","description":"A reply to a customer couldn't be sent, or bounced. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"article.published":{"post":{"summary":"Article published","description":"A help center article goes live, for the first time or with changes. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}},"article.unpublished":{"post":{"summary":"Article taken down","description":"A help center article is unpublished, or deleted while it was live. Signed the Standard Webhooks way: webhook-id, webhook-timestamp, and webhook-signature headers, an HMAC-SHA256 with the endpoint's secret. Answer with any 2xx within 10 seconds; failures are retried for about a day. Set up in Integrations → Webhooks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"The event, e.g. \"message.received\"."},"timestamp":{"type":"string","description":"When it happened."},"data":{"type":"object","properties":{"workspace":{"type":"string","description":"The workspace's address."},"ticket":{"description":"Ticket and message events. Never what the customer wrote: read the ticket with the API for that.","type":"object","properties":{"number":{"type":"number"},"subject":{"type":"string"},"url":{"type":"string","description":"The ticket in answerable."},"apiUrl":{"type":"string","description":"The ticket in the REST API, to read it with a key."},"state":{"type":"string","description":"Where it stands, as the inbox shows it, e.g. \"Awaiting approval\"."},"status":{"type":"string","enum":["OPEN","WAITING","CLOSED"]},"type":{"description":"The ticket's type, by name.","type":["string","null"]},"customer":{"type":"string","description":"The customer's name, or their address when there's no name."},"summary":{"description":"The agent's one-line summary, or why it needs a person.","type":["string","null"]},"new":{"type":"boolean","description":"The event is about the ticket's first message."},"revision":{"type":"number","description":"Increases with each customer message. Pass it when replying."},"waiting":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["APPROVAL","PERSON","SPAM_REVIEW","FAILED"]},"reason":{"type":["string","null"]}},"required":["kind","reason"],"additionalProperties":false},{"type":"null"}],"description":"What it waits on a person for, if anything."},"assignee":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The teammate it's assigned to, if anyone."}},"required":["number","subject","url","apiUrl","state","status","type","customer","summary","new","revision","waiting","assignee"],"additionalProperties":false},"message":{"description":"Message events: the message, by id.","type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["EMAIL","WIDGET","API"]},"sentAt":{"type":"string"},"author":{"description":"message.sent: who sent it, \"answerable's agent\" or a teammate and the app they used.","type":"string"},"error":{"description":"message.failed: why it couldn't be delivered.","type":"string"}},"required":["id","channel","sentAt"],"additionalProperties":false},"article":{"description":"Help center events: the article, without its text.","type":"object","properties":{"id":{"type":"string"},"language":{"type":"string","description":"The language version that was published or taken off."},"title":{"type":"string"},"category":{"type":["string","null"]},"url":{"description":"Where it is on the help site in that language; null when it isn't on it.","type":["string","null"]},"apiUrl":{"type":"string","description":"The article in the REST API, in that language."}},"required":["id","language","title","category","url","apiUrl"],"additionalProperties":false}},"required":["workspace"],"additionalProperties":false}},"required":["type","timestamp","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Received."}}}}}}