{"openapi":"3.1.0","info":{"title":"Texa API","version":"1","description":"Build Texa AI into your own software: open conversations from your app,\nwebsite or backend, send the customer's messages and get Texa AI's replies,\nrun actions in your systems, hand over to people, and hear about everything\nthrough webhooks.\n\n**Keys.** Every request carries `Authorization: Bearer <key>`. Keys are made\nin Texa Desk, under Texa AI, Developers. A `texa_test_...` key reaches your\nsandbox (fixtures answer actions; nothing reaches a real customer); a\n`texa_live_...` key reaches your live account. Keep keys on your server:\nnever in an app or a web page.\n\n**Errors** are `{\"error\": {\"type\", \"code\", \"message\", \"field\"}}`, with the\nrequest's id in the `X-Request-Id` header. Quote it to Texa support.\n\n**Rate limits.** Each account has a limit per minute and environment\n(`X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`). Over it,\nthe answer is 429 with `Retry-After`.\n\n**Idempotency.** Any POST may carry `Idempotency-Key`. The first request\nruns; a retry with the same key and the same body gets the same answer back,\nmarked `Idempotent-Replayed: true`; the same key with a different body is a\n409. Keys are kept for 24 hours. Messages also take your own `message_id`.\n\n**Actions.** When Texa AI needs something from your systems it asks with an\n`action_request` event. Actions you connected in Texa Desk run by themselves\nand come back marked `\"handled_by\": \"texa\"`; for the others, run the action\nand answer with `POST /v1/conversations/{id}/action-results`.\n\n**Events** are in the answer to each request, and every one of them is also\non `GET /v1/events` (in order, by cursor) and sent to your webhooks.\n\n**Webhooks** are signed: `X-Texa-Signature: sha256=<hex HMAC-SHA256 of\n\"<X-Texa-Timestamp>.<raw body>\">` with the endpoint's secret. Check it and\nthat the timestamp is recent, and use `X-Texa-Event-Id` to ignore repeats.\nFailed deliveries are retried for about a day.","contact":{"name":"Texa support","email":"support@texa.ng"}},"servers":[{"url":"https://api.texadesk.com"}],"security":[{"bearer":[]}],"tags":[{"name":"conversations"},{"name":"voice"},{"name":"records"},{"name":"customers"},{"name":"events"},{"name":"media"},{"name":"agent"},{"name":"actions"},{"name":"knowledge"},{"name":"reports"},{"name":"sandbox"},{"name":"widgets"},{"name":"account"}],"paths":{"/v1/actions":{"get":{"operationId":"list_actions","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"The actions Texa AI can ask for","tags":["actions"],"description":""}},"/v1/actions/{name}":{"get":{"operationId":"get_action","parameters":[{"in":"path","name":"name","required":true,"schema":{"title":"Name","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"One action","tags":["actions"],"description":""}},"/v1/agent":{"get":{"operationId":"get_agent","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"The agent your customers meet","tags":["agent"],"description":""}},"/v1/conversations":{"post":{"operationId":"open_conversation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Open a conversation","tags":["conversations"],"description":"Connected actions in the answer run by themselves and are marked `\"handled_by\": \"texa\"`.\n\nTakes an `Idempotency-Key` header.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"description":"Newest first, by cursor. The cursor is the last conversation's id.","operationId":"list_conversations","parameters":[{"in":"query","name":"state","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"in":"query","name":"customer_ref","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Ref"}},{"description":"a cursor from `next`","in":"query","name":"after","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"a cursor from `next`","title":"After"}},{"in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"List conversations, newest first","tags":["conversations"]}},"/v1/conversations/{conversation_id}":{"get":{"operationId":"get_conversation","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Get a conversation","tags":["conversations"],"description":""}},"/v1/conversations/{conversation_id}/action-results":{"post":{"operationId":"post_action_result","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Give the result of an action you ran","tags":["conversations"],"description":"Connected actions in the answer run by themselves and are marked `\"handled_by\": \"texa\"`.\n\nTakes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/assist":{"post":{"description":"A suggested reply and action for the person holding it. Screened by the\nsame guards and gate, labelled `assist`, never sent or run by Texa AI.\n\nTakes an `Idempotency-Key` header.","operationId":"assist","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"A suggested reply for the person holding the conversation","tags":["conversations"]}},"/v1/conversations/{conversation_id}/close":{"post":{"operationId":"close_conversation","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/api__v1__conversations__CloseBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Close the conversation","tags":["conversations"],"description":"Takes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/export":{"get":{"description":"Everything, in one read: the transcript, what was established and quoted,\nevery guard evaluation and - for a support conversation - every action\nstep, which is the audit answer to \"why did it do that\" (§12).","operationId":"export_conversation","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Everything about a conversation: transcript, actions, handovers","tags":["records"]}},"/v1/conversations/{conversation_id}/handback":{"post":{"operationId":"hand_back","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandbackBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Hand the conversation back to Texa AI","tags":["conversations"],"description":"Connected actions in the answer run by themselves and are marked `\"handled_by\": \"texa\"`.\n\nTakes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/handover":{"post":{"operationId":"hand_over","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoverBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Hand the conversation to people","tags":["conversations"],"description":"Takes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/human-messages":{"post":{"operationId":"post_human_message","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Record what a person said while they hold the conversation","tags":["conversations"],"description":"Takes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/messages":{"post":{"operationId":"send_message","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Send the customer's message; the reply comes back in `events`","tags":["conversations"],"description":"Connected actions in the answer run by themselves and are marked `\"handled_by\": \"texa\"`.\n\nTakes an `Idempotency-Key` header."}},"/v1/conversations/{conversation_id}/quality":{"get":{"operationId":"get_quality","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Quality scores","tags":["records"],"description":""}},"/v1/conversations/{conversation_id}/transcript":{"get":{"operationId":"get_transcript","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"The transcript","tags":["records"],"description":""}},"/v1/conversations/{conversation_id}/voice-sessions":{"post":{"operationId":"create_voice_session","parameters":[{"in":"path","name":"conversation_id","required":true,"schema":{"title":"Conversation Id","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSessionBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"A single-use token for your app to open a voice session","tags":["voice"],"description":"`url` is where your app opens the voice session, with the `token`, once, before `expires_at`. Never put a key in the app.\n\nTakes an `Idempotency-Key` header."}},"/v1/customers/{customer_ref}":{"get":{"description":"What Texa AI remembers about one customer - each line with when and\nfrom which conversation - and their conversations with this account.","operationId":"get_customer","parameters":[{"in":"path","name":"customer_ref","required":true,"schema":{"title":"Customer Ref","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"What Texa AI remembers about a customer","tags":["customers"]}},"/v1/customers/{customer_ref}/forget":{"post":{"description":"Delete one customer: their memory, their conversations and their record\n(§6.10, §13). Cannot be undone; a row records that it happened.\n\nTakes an `Idempotency-Key` header.","operationId":"forget_customer","parameters":[{"in":"path","name":"customer_ref","required":true,"schema":{"title":"Customer Ref","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__v1__conversations__ForgetBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Delete a customer's memory and conversations","tags":["customers"]}},"/v1/customers/{customer_ref}/merge":{"post":{"description":"Two references, one person: `customer_ref`'s memory and conversations\nmove to `into`, and `customer_ref` is no more. Merging the same pair again\nanswers the first merge.\n\nTakes an `Idempotency-Key` header.","operationId":"merge_customer","parameters":[{"in":"path","name":"customer_ref","required":true,"schema":{"title":"Customer Ref","type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Two references, one person: merge them","tags":["customers"]}},"/v1/events":{"get":{"operationId":"list_events","parameters":[{"description":"evt_<n>","in":"query","name":"after","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"evt_<n>","title":"After"}},{"in":"query","name":"limit","required":false,"schema":{"default":100,"maximum":1000,"minimum":1,"title":"Limit","type":"integer"}},{"description":"comma separated","in":"query","name":"types","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"comma separated","title":"Types"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Every event, in order, after a cursor","tags":["events"],"description":""}},"/v1/kill-switch":{"get":{"operationId":"get_kill_switch","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Whether Texa AI is paused","tags":["agent"],"description":""}},"/v1/knowledge/documents":{"get":{"operationId":"list_documents","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Knowledge documents and their approval","tags":["knowledge"],"description":""},"post":{"operationId":"add_document","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentBody"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Add a document; it is used once a person approves it in Texa Desk","tags":["knowledge"],"description":"Takes an `Idempotency-Key` header.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/v1/me":{"get":{"description":"The account and key this request uses, and its rate limit.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"The account and key this request uses","tags":["account"],"operationId":"get_me"}},"/v1/media":{"post":{"description":"Sizes: audio 16 MB, image 10 MB, document 20 MB, video 64 MB (settings\nmedia.max_mb_*). A voice note is heard up to 3 minutes (media.audio_max_s).\n\nTakes an `Idempotency-Key` header.","operationId":"upload_media","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_media_v1_media_post"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Upload a voice note, photo, document or video","tags":["media"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/v1/media/{media_id}":{"get":{"operationId":"get_media","parameters":[{"in":"path","name":"media_id","required":true,"schema":{"title":"Media Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"A media item and what was understood from it","tags":["media"],"description":""}},"/v1/media/{media_id}/content":{"get":{"operationId":"get_media_content","parameters":[{"in":"path","name":"media_id","required":true,"schema":{"title":"Media Id","type":"string"}}],"responses":{"200":{"content":{"audio/ogg":{}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"The media item's bytes","tags":["media"],"description":""}},"/v1/reports/quality":{"get":{"operationId":"get_quality_report","parameters":[{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Quality report","tags":["reports"],"description":""}},"/v1/reports/support":{"get":{"operationId":"get_support_report","parameters":[{"in":"query","name":"since","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Since"}},{"in":"query","name":"until","required":false,"schema":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Until"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Support report","tags":["reports"],"description":""}},"/v1/sandbox/actions":{"get":{"operationId":"list_fixtures","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Sandbox fixtures","tags":["sandbox"],"description":"Sandbox only: use a test key (`texa_test_...`)."}},"/v1/sandbox/actions/{action}":{"put":{"operationId":"put_fixture","parameters":[{"in":"path","name":"action","required":true,"schema":{"title":"Action","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixtureBody"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Set what an action answers in the sandbox","tags":["sandbox"],"description":"Sandbox only: use a test key (`texa_test_...`)."},"delete":{"operationId":"delete_fixture","parameters":[{"in":"path","name":"action","required":true,"schema":{"title":"Action","type":"string"}},{"in":"query","name":"scenario","required":false,"schema":{"default":"default","title":"Scenario","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"$ref":"#/components/responses/Error"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Remove a sandbox fixture","tags":["sandbox"],"description":"Sandbox only: use a test key (`texa_test_...`)."}},"/v1/usage":{"get":{"description":"What has been counted this month, per meter: what draws down the account's credits. Test-key requests are counted as `sandbox_requests`.","parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"YYYY-MM; this month when left out"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"Usage this month, per meter","tags":["account"],"operationId":"get_usage"}},"/v1/widget-sessions":{"post":{"description":"A session for one of your customers, for a widget in a web page or an app. Give its `token` to the page or app: it reaches only the `/v1/widget/...` routes, for this customer, until `expires_at`. Make it on your server; never put a key in the page.\n\nTakes an `Idempotency-Key` header.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSessionBody"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSession"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"summary":"A widget session for one customer: its token is for a web page or an app","tags":["widgets"],"operationId":"create_widget_session","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/v1/widget/conversations":{"post":{"description":"Opens a conversation for the session's customer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetOpen"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetAnswer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"summary":"Open the session customer's conversation (web or voice)","tags":["widgets"],"operationId":"widget_open_conversation"}},"/v1/widget/conversations/{conversation_id}/app-results":{"post":{"description":"Your page or app ran a screen action Texa AI asked for (from `requests` on the lines): its outputs, or why it failed. Within 30 seconds; once. The answer is what Texa AI says next.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetAppResult"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetAnswer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"A screen action's answer, from the customer's page or app","tags":["widgets"],"operationId":"widget_app_result"}},"/v1/widget/conversations/{conversation_id}/cards/{card_id}/content":{"get":{"description":"A spreadsheet Texa AI sent the customer (a card of kind `sheet`), as CSV.","responses":{"200":{"description":"The CSV","content":{"text/csv":{}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"A spreadsheet Texa AI sent the customer, as CSV","tags":["widgets"],"operationId":"widget_card_content"}},"/v1/widget/conversations/{conversation_id}/files":{"post":{"description":"A photo, PDF, Word document, recording or short video from the customer (multipart: `file`, and optional `text` and `message_id`), 10 MB at most, checked by its first bytes.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"text":{"type":"string"},"message_id":{"type":"string"}},"required":["file"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetAnswer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"A photo, PDF or recording from the customer","tags":["widgets"],"operationId":"widget_send_file"}},"/v1/widget/conversations/{conversation_id}/lines":{"get":{"description":"What was said after line `after`: replies that came later and people's answers; documents Texa AI sent after card `after_card`; screen actions this page should run now (`requests`). Poll it every few seconds while the chat is open. Pass the last `changed` as `seen`: a poll with nothing new is then cheap; `fresh=1` reads everything (after a send, and every few polls).","parameters":[{"name":"after","in":"query","required":false,"schema":{"type":"integer"}},{"name":"after_card","in":"query","required":false,"schema":{"type":"integer"}},{"name":"seen","in":"query","required":false,"schema":{"type":"string"}},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetLines"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"summary":"What was said since a line: late replies, people's answers","tags":["widgets"],"operationId":"widget_lines"}},"/v1/widget/conversations/{conversation_id}/messages":{"post":{"description":"The customer's message. The answer shows only what a customer may see: replies, a handover, a close.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetMessage"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetAnswer"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"The customer's message, from the widget","tags":["widgets"],"operationId":"widget_send_message"}},"/v1/widget/conversations/{conversation_id}/sign-in":{"post":{"description":"Call with the session your server made once the visitor signed in, and the visitor's token: the chat carries on as the customer. `moved` says whether it carries on in a new conversation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSignIn"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetMoved"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"The visitor signed in: the chat carries on as the customer","tags":["widgets"],"operationId":"widget_sign_in"}},"/v1/widget/conversations/{conversation_id}/typing":{"post":{"description":"What the customer is typing, for the people who see the chat in Texa Desk: mask it first (digits and anything after pin, otp, code or password, as the guide shows), at most one every 300 ms; an empty `draft` clears it. Never stored or logged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetDraft"}}}},"responses":{"204":{"description":"Taken"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"What the customer is typing, masked, for the team","tags":["widgets"],"operationId":"widget_typing"}},"/v1/widget/conversations/{conversation_id}/voice-sessions":{"post":{"description":"A single-use token for the widget's voice line (a voice conversation).","responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetVoice"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[{"widgetSession":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}}],"summary":"A single-use token for the widget's voice line","tags":["widgets"],"operationId":"widget_voice_session"}},"/v1/widget/visitor-sessions":{"post":{"description":"A session for a visitor who hasn't signed in, from the account's site key (Texa Desk, Developers, Website and app). Live, only from the account's allowed websites; 20 an hour per address. A visitor is never verified, and actions kept for signed-in customers are refused for them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitorSessionBody"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetSession"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}},"security":[],"summary":"A signed-out visitor's session, from the account's site key","tags":["widgets"],"operationId":"widget_visitor_session"}}},"webhooks":{"call.ended":{"post":{"summary":"A call ended","operationId":"webhook_call_ended","description":"A call ended. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"call.started":{"post":{"summary":"A call started","operationId":"webhook_call_started","description":"A call started. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.action_request":{"post":{"summary":"Texa AI asked for an action to be run","operationId":"webhook_conversation_action_request","description":"Texa AI asked for an action to be run. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.closed":{"post":{"summary":"The conversation was closed","operationId":"webhook_conversation_closed","description":"The conversation was closed. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.handback":{"post":{"summary":"People handed the conversation back to Texa AI","operationId":"webhook_conversation_handback","description":"People handed the conversation back to Texa AI. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.handover":{"post":{"summary":"Texa AI handed the conversation to people","operationId":"webhook_conversation_handover","description":"Texa AI handed the conversation to people. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.human_message":{"post":{"summary":"A person answered the customer from Texa Desk (headless handover): show it in your app","operationId":"webhook_conversation_human_message","description":"A person answered the customer from Texa Desk (headless handover): show it in your app. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.opened":{"post":{"summary":"A conversation was opened","operationId":"webhook_conversation_opened","description":"A conversation was opened. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"conversation.reply":{"post":{"summary":"Texa AI replied to the customer","operationId":"webhook_conversation_reply","description":"Texa AI replied to the customer. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"interview.completed":{"post":{"summary":"A research interview was completed","operationId":"webhook_interview_completed","description":"A research interview was completed. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"media.failed":{"post":{"summary":"A media item could not be understood","operationId":"webhook_media_failed","description":"A media item could not be understood. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"media.understood":{"post":{"summary":"A voice note, photo, document or video was understood","operationId":"webhook_media_understood","description":"A voice note, photo, document or video was understood. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"monitor.finding":{"post":{"summary":"A monitor found something in a conversation","operationId":"webhook_monitor_finding","description":"A monitor found something in a conversation. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"quality.scored":{"post":{"summary":"A closed conversation was scored","operationId":"webhook_quality_scored","description":"A closed conversation was scored. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"report.ready":{"post":{"summary":"A report is ready","operationId":"webhook_report_ready","description":"A report is ready. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}},"survey.response":{"post":{"summary":"A customer completed a survey","operationId":"webhook_survey_response","description":"A customer completed a survey. Signed: check `X-Texa-Signature` before trusting it.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds is delivered; anything else is retried."}}}}},"components":{"schemas":{"Body_upload_media_v1_media_post":{"properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"file":{"contentMediaType":"application/octet-stream","description":"the bytes","title":"File","type":"string"},"purpose":{"default":"message","description":"message | research_answer","title":"Purpose","type":"string"}},"required":["file"],"title":"Body_upload_media_v1_media_post","type":"object"},"DocumentBody":{"properties":{"body":{"title":"Body","type":"string"},"kind":{"default":"other","title":"Kind","type":"string"},"title":{"title":"Title","type":"string"},"uploaded_by":{"default":"","title":"Uploaded By","type":"string"}},"required":["title","body"],"title":"DocumentBody","type":"object"},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"field":{"type":["string","null"]}}}}},"FixtureBody":{"additionalProperties":false,"properties":{"fault":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fault"},"response":{"additionalProperties":true,"title":"Response","type":"object"},"scenario":{"default":"default","maxLength":80,"title":"Scenario","type":"string"}},"required":["response"],"title":"FixtureBody","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"HandbackBody":{"additionalProperties":false,"properties":{"by":{"default":"","maxLength":120,"title":"By","type":"string"},"note":{"default":"","description":"what the person did and said, for Texa AI","maxLength":1000,"title":"Note","type":"string"}},"title":"HandbackBody","type":"object"},"HandoverBody":{"additionalProperties":false,"properties":{"reason":{"default":"","maxLength":200,"title":"Reason","type":"string"},"shadow":{"default":false,"description":"people answer by design and Texa AI drafts (/assist): kept out of every handover rate","title":"Shadow","type":"boolean"},"taken_by":{"default":"","maxLength":120,"title":"Taken By","type":"string"}},"title":"HandoverBody","type":"object"},"HumanBody":{"additionalProperties":false,"properties":{"author":{"default":"","maxLength":120,"title":"Author","type":"string"},"message_id":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"title":"Message Id"},"text":{"maxLength":10000,"minLength":1,"title":"Text","type":"string"}},"required":["text"],"title":"HumanBody","type":"object"},"Me":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"currency":{"type":"string"},"timezone":{"type":"string"}}},"environment":{"type":"string","enum":["live","test"]},"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"}}},"limits":{"type":"object","properties":{"requests_per_minute":{"type":"integer"}}}}},"MergeBody":{"additionalProperties":false,"properties":{"by":{"default":"","maxLength":120,"title":"By","type":"string"},"into":{"description":"the reference that stays","maxLength":200,"minLength":1,"title":"Into","type":"string"}},"required":["into"],"title":"MergeBody","type":"object"},"MessageBody":{"additionalProperties":false,"properties":{"attachments":{"description":"{media_id} from POST /v1/media - the turn waits for it to be understood; {type: location, latitude, longitude, name}; {type: contact, name, phone}; {type: sticker|reaction, emoji} - a mood, never a yes; or a description of a file","items":{"additionalProperties":true,"type":"object"},"maxItems":20,"title":"Attachments","type":"array"},"headers":{"additionalProperties":true,"description":"email: Message-ID, In-Reply-To","title":"Headers","type":"object"},"message_id":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"description":"your id for this message: a redelivery is answered, not re-run","title":"Message Id"},"reply_audio":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"from now on, replies also as voice notes (true) or not (false)","title":"Reply Audio"},"sender_name":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Sender Name"},"sent_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Sent At"},"subject":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"title":"Subject"},"text":{"default":"","maxLength":50000,"title":"Text","type":"string"}},"title":"MessageBody","type":"object"},"OpenBody":{"additionalProperties":false,"properties":{"channel":{"enum":["whatsapp","web","sms","instagram","facebook","telegram","line","tiktok","email","voice","phone"],"title":"Channel","type":"string"},"customer_ref":{"description":"your own reference for this customer","maxLength":200,"minLength":1,"title":"Customer Ref","type":"string"},"first_name":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"title":"First Name"},"known_facts":{"default":"","description":"what your record says about them","maxLength":2000,"title":"Known Facts","type":"string"},"language":{"default":"en","title":"Language","type":"string"},"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"objective: e.g. checkin","title":"Objective"},"outbound":{"default":false,"description":"objective over a thread: the business writes first","title":"Outbound","type":"boolean"},"procedure_set":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"support: which set","title":"Procedure Set"},"procedure_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"SANDBOX ONLY: run this version instead of the live one","title":"Procedure Version"},"purpose":{"default":"support","enum":["support","objective"],"title":"Purpose","type":"string"},"reply_audio":{"default":false,"description":"each reply also carries `audio_media_id`: an OGG/Opus voice note of it","title":"Reply Audio","type":"boolean"},"scenario":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}],"description":"SANDBOX: which fixtures answer actions","title":"Scenario"},"shadow":{"default":false,"description":"your shadow mode: people answer and Texa AI drafts (/assist); its handovers stay out of handover rates","title":"Shadow","type":"boolean"},"subject":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}],"description":"email: the subject","title":"Subject"}},"required":["channel","customer_ref"],"title":"OpenBody","type":"object"},"ResultBody":{"additionalProperties":false,"properties":{"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"error":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Error"},"request_id":{"title":"Request Id","type":"string"},"status":{"enum":["succeeded","failed"],"title":"Status","type":"string"}},"required":["request_id","status"],"title":"ResultBody","type":"object"},"Usage":{"type":"object","properties":{"month":{"type":"string"},"meters":{"type":"array","items":{"type":"object","properties":{"meter":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"}}}}}},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"VisitorSessionBody":{"type":"object","properties":{"site_key":{"type":"string"},"language":{"type":"string"}},"required":["site_key"]},"VoiceSessionBody":{"additionalProperties":false,"properties":{"options":{"additionalProperties":true,"description":"mode (voice|text), brain, listens, speaks, voice, agent_name, agent_gender - chosen here, never by the app","title":"Options","type":"object"},"ttl_s":{"default":120,"maximum":900.0,"minimum":15.0,"title":"Ttl S","type":"integer"}},"title":"VoiceSessionBody","type":"object"},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"environment":{"type":"string","enum":["live","test"]},"conversation_id":{"type":["string","null"]},"data":{"type":"object"}},"required":["id","type","created_at","environment","data"]},"WidgetAnswer":{"type":"object","properties":{"conversation_id":{"type":"string"},"state":{"type":"string"},"events":{"type":"array","items":{"type":"object"}}}},"WidgetAppResult":{"type":"object","properties":{"request_id":{"type":"string"},"status":{"type":"string","enum":["succeeded","failed"]},"data":{"type":"object"},"error":{"type":"string"}},"required":["request_id","status"]},"WidgetDraft":{"type":"object","properties":{"draft":{"type":"string"}}},"WidgetLines":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"n":{"type":"integer"},"text":{"type":"string"},"from":{"type":"string","enum":["customer","texa","person"]}}}},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["file","sheet"]},"name":{"type":"string"},"url":{"type":"string"},"rows":{"type":"integer"},"content":{"type":"string"}}}},"requests":{"type":"array","items":{"type":"object","properties":{"request_id":{"type":"string"},"action":{"type":"string"},"inputs":{"type":"object"},"expires_at":{"type":["string","null"]}}}},"changed":{"type":"string"},"preview":{"type":"boolean"},"with":{"type":["string","null"]}}},"WidgetMessage":{"type":"object","properties":{"text":{"type":"string"},"message_id":{"type":"string"}},"required":["text"]},"WidgetMoved":{"type":"object","properties":{"conversation_id":{"type":"string"},"moved":{"type":"boolean"}}},"WidgetOpen":{"type":"object","properties":{"channel":{"type":"string","enum":["web","voice"]}}},"WidgetSession":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"},"customer_ref":{"type":"string"},"environment":{"type":"string"},"signed_in":{"type":"boolean"},"allowed_origins":{"type":"array","items":{"type":"string"}}}},"WidgetSessionBody":{"type":"object","properties":{"customer_ref":{"type":"string"},"first_name":{"type":"string"},"known_facts":{"type":"string"},"language":{"type":"string"},"ttl_s":{"type":"integer","minimum":60,"maximum":86400},"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"customer_token":{"type":"string","description":"the customer's own token for your API, sent by a connector signed in with the signed-in customer's own token; sealed, never logged, never shown"}},"required":["customer_ref"]},"WidgetSignIn":{"type":"object","properties":{"visitor_token":{"type":"string"}},"required":["visitor_token"]},"WidgetVoice":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"},"url":{"type":"string"}}},"api__v1__conversations__CloseBody":{"additionalProperties":false,"properties":{"reason":{"default":"closed_by_product","maxLength":80,"title":"Reason","type":"string"}},"title":"CloseBody","type":"object"},"api__v1__conversations__ForgetBody":{"additionalProperties":false,"properties":{"requested_by":{"maxLength":120,"minLength":2,"title":"Requested By","type":"string"}},"required":["requested_by"],"title":"ForgetBody","type":"object"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"texa_live_... or texa_test_..."},"widgetSession":{"type":"http","scheme":"bearer","description":"wst_...: a widget session's token"}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Run this request once; a retry with the same key and body gets the same answer."}},"responses":{"Error":{"description":"400: The request is not valid; `error.field` names the part / 401: No key, or not a live one / 402: The account's prepaid credits are used up; top up in Texa Desk / 403: The key cannot do this (a sandbox route needs a test key) / 404: No such route, or nothing with that id in this account / 409: A conflict: the conversation's state, or an Idempotency-Key reused / 422: The body is not what this route takes / 429: Too many requests: wait `Retry-After` seconds / 503: Texa AI is not answering right now: retry after `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}