{"openapi":"3.1.0","info":{"title":"Hollerback API","version":"1.0.0","description":"Hand a phone task to a voice agent and get a structured result back. The companion page the person opens answers its own taps with `screen_replaced` (409, the voice agent showed a newer screen), `call_ended` (410, the call is over), `companion_link_expired` (410, the link is more than 30 minutes past the end of the call), and `too_many_selections` (429, the person tapped faster than once a second or more than 20 times on one screen). These codes reach the person's browser, not API clients."},"servers":[{"url":"https://hollerback.dev/api"}],"security":[{"bearer":[]}],"paths":{"/v1/tasks":{"get":{"operationId":"listTasks","parameters":[{"name":"state","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTask","description":"A task with `companion` options needs a call channel, `consent.texts` true, a number where `get_texting_status` shows `companion` on, and the support, employee, or account_notice purpose. `companion_not_enabled` (403) means the service, the task, or the number cannot use a companion. `companion_image_unreachable` (422) means Hollerback could not fetch or accept an option's image. The message names the option.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreateInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance or daily limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"companion_not_enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or opted-out phone, or companion_image_unreachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"get":{"operationId":"getTask","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateTask","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdateInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/cancel":{"post":{"operationId":"cancelTask","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/answers":{"post":{"operationId":"answerQuestion","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/knowledge":{"get":{"operationId":"getKnowledge","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Knowledge"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addKnowledge","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeAddInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeCounts"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The task has ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/knowledge/remove":{"post":{"operationId":"removeKnowledge","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeRemoveInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeCounts"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The task has ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/events":{"get":{"operationId":"watchTaskEvents","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Where to resume. The Last-Event-ID header takes precedence."},{"name":"Last-Event-ID","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Server-Sent Events. Each `turn` event carries one turn: `callId`, `index`, `speaker`, `text`, and `at`. Each `state` event carries one live state change: `callId`, `type` (ringing, answered, takeover_started, handed_back, operator_call_failed, or ended), `at`, and `operator` for takeovers. While a task has companion options, `state` events also carry `companion_sent` (the link text went out), `companion_opened` (the person opened the page), `companion_screen` (a screen is current, with `screenId`, `optionIds`, and `title`), and `companion_selected` (the person confirmed `optionIds` on `screenId`). These events never carry the link token. The stream writes `ended` and closes when the call ends. It also closes after about 290 seconds. Each event's `id` is a cursor. Reconnect with the Last-Event-ID header, or the `cursor` query parameter, to get only what you missed.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"204":{"description":"Nothing more will come: the call ended and you have every event. For a task, the task also ended. EventSource stops reconnecting on a 204."},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/live-links":{"post":{"operationId":"createLiveLink","description":"Create a link that lets a person listen to the task's call while it runs, or take it over with mode takeover. The link follows the task's current call and waits for it if it has not started. It expires when the task ends or after 24 hours, whichever is first. The url appears only in this response.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveLinkCreateInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveLinkCreated"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The organization turned live links off, or allows only listen links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The task has ended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/live-links/{linkId}":{"delete":{"operationId":"revokeLiveLink","description":"Revoke a live link. The live page stops working, and anyone listening with the link leaves the call.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"linkId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/operator-calls":{"post":{"operationId":"callOperator","description":"Call a person from your organization into the task's live call. When they answer, the voice agent hands the call to them. They press * to hand it back and # to end the call. Their phone leg costs the same per minute as a call, as its own ledger line. If they do not answer, the call's live events get operator_call_failed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorCallInput"}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorCall"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The organization does not allow takeovers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No call is live, or an operator already has the call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/data":{"delete":{"operationId":"deleteTaskData","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskDataDeletion"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/attempts/{attemptId}/recording":{"get":{"operationId":"getRecording","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"attemptId","in":"path","required":true,"schema":{"type":"string"}},{"name":"redact","in":"query","schema":{"enum":["true","false"]},"description":"true returns the redacted recording: a tone replaces sensitive details. The first request starts redaction, which costs 2.5 cents per call minute. Entity redaction works in English only. Other languages get number redaction only."}],"responses":{"200":{"description":"MP3 audio. A Range header gets part of it with status 206.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"202":{"description":"With redact=true: redaction is running. Ask again after the Retry-After header's seconds.","content":{"application/json":{"schema":{"type":"object","required":["redaction"],"properties":{"redaction":{"enum":["pending"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"With redact=true: the redaction failed (redaction_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/numbers":{"get":{"operationId":"listNumbers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"buyNumber","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberCreateInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/numbers/{id}":{"patch":{"operationId":"updateNumber","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberUpdateInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"releaseNumber","description":"Give the number back. It stops working at once and is no longer charged. The current period's fee is not refunded.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Number"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Open tasks or a call in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls":{"get":{"operationId":"listCalls","parameters":[{"name":"numberId","in":"query","schema":{"type":"string"}},{"name":"direction","in":"query","schema":{"enum":["outbound","inbound"]}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}":{"get":{"operationId":"getCall","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Call"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/events":{"get":{"operationId":"watchCallEvents","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Where to resume. The Last-Event-ID header takes precedence."},{"name":"Last-Event-ID","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"Server-Sent Events. Each `turn` event carries one turn: `callId`, `index`, `speaker`, `text`, and `at`. Each `state` event carries one live state change: `callId`, `type` (ringing, answered, takeover_started, handed_back, operator_call_failed, or ended), `at`, and `operator` for takeovers. While a task has companion options, `state` events also carry `companion_sent` (the link text went out), `companion_opened` (the person opened the page), `companion_screen` (a screen is current, with `screenId`, `optionIds`, and `title`), and `companion_selected` (the person confirmed `optionIds` on `screenId`). These events never carry the link token. The stream writes `ended` and closes when the call ends. It also closes after about 290 seconds. Each event's `id` is a cursor. Reconnect with the Last-Event-ID header, or the `cursor` query parameter, to get only what you missed.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"204":{"description":"Nothing more will come: the call ended and you have every event. For a task, the task also ended. EventSource stops reconnecting on a 204."},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording":{"get":{"operationId":"getCallRecording","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"redact","in":"query","schema":{"enum":["true","false"]},"description":"true returns the redacted recording: a tone replaces sensitive details. The first request starts redaction, which costs 2.5 cents per call minute. Entity redaction works in English only. Other languages get number redaction only."}],"responses":{"200":{"description":"MP3 audio. A Range header gets part of it with status 206.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"202":{"description":"With redact=true: redaction is running. Ask again after the Retry-After header's seconds.","content":{"application/json":{"schema":{"type":"object","required":["redaction"],"properties":{"redaction":{"enum":["pending"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"With redact=true: the redaction failed (redaction_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording/shares":{"get":{"operationId":"listRecordingShares","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"shareRecording","description":"Create a link that plays the call's recording and transcript. Links are redacted by default: a tone replaces sensitive details. Redaction costs 2.5 cents per call minute. Set redact to false for the recording as it was recorded. Links last 7 days by default and 30 days at most. The url appears only in this response.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareCreateInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareCreated"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The organization allows only redacted share links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"expiresInSeconds is over 30 days","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calls/{id}/recording/shares/{shareId}":{"delete":{"operationId":"revokeRecordingShare","description":"Revoke a share link. It answers 410 from then on.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"shareId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Share"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAccount","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUpdateInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ledger":{"get":{"operationId":"listLedger","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/opt-outs":{"get":{"operationId":"listOptOuts","description":"List the phones that are blocked now. Pass includeRemoved=true to also list removed opt-outs, which have removedAt set.","parameters":[{"name":"includeRemoved","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addOptOut","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutCreateInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOut"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/opt-outs/{phone}":{"delete":{"operationId":"removeOptOut","description":"Unblock a phone. Only do this when the person has asked to be contacted again.","parameters":[{"name":"phone","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Removed"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/texting":{"get":{"operationId":"getTexting","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Texting"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/texting/registration":{"post":{"operationId":"registerTexting","description":"Start the 10DLC registration that turns on texting. Charges the setup fee once. Twilio reviews take days to weeks. Needs the legal business name and tax ID on file.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextingRegistrationInput"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Texting"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient balance for the setup fee","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already registered, or business details missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages":{"get":{"operationId":"listMessages","parameters":[{"name":"numberId","in":"query","schema":{"type":"string"}},{"name":"taskId","in":"query","schema":{"type":"string"}},{"name":"direction","in":"query","schema":{"enum":["outbound","inbound"]}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages/{id}":{"get":{"operationId":"getMessage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/deliveries":{"get":{"operationId":"listWebhookDeliveries","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/deliveries/{id}/retry":{"post":{"operationId":"retryWebhookDelivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/test":{"post":{"operationId":"sendTestWebhook","responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No webhook URL set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key from the dashboard (hb_live_...)"}},"schemas":{"TaskCreateInput":{"type":"object","properties":{"numberId":{"type":"string","minLength":1},"person":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"phone":{"type":"string","minLength":1,"maxLength":40},"pronunciation":{"type":"string","maxLength":200},"language":{"type":"string","minLength":2,"maxLength":35},"timeZone":{"type":"string"}},"required":["name","phone"]},"onBehalfOf":{"type":"string","minLength":1,"maxLength":100},"goal":{"type":"string","minLength":1,"maxLength":1000},"context":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"authority":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"resultSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"consent":{"type":"object","properties":{"confirmed":{"type":"boolean","const":true},"source":{"type":"string","minLength":1,"maxLength":500},"texts":{"type":"boolean","const":true}},"required":["confirmed","source"]},"purpose":{"type":"string","enum":["support","employee","account_notice"]},"channel":{"default":"call","type":"string","enum":["call","text","text_then_call"]},"maxAttempts":{"default":3,"type":"integer","minimum":1,"maximum":5},"expiresInHours":{"default":168,"type":"integer","minimum":1,"maximum":720},"callAnytime":{"default":false,"type":"boolean"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"knowledge":{"type":"object","properties":{"entities":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"type":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":200},"aliases":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"facts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":1000}}},"required":["id","type","name","facts"]}},"links":{"default":[],"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"relation":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"required":["from","relation","to"]}},"documents":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":50000}},"required":["id","title","text"]}}}},"live":{"type":"object","properties":{"turnWebhooks":{"default":false,"type":"boolean"}}},"companion":{"type":"object","properties":{"options":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":300},"detail":{"type":"string","minLength":1,"maxLength":80},"imageUrl":{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"}},"required":["id","title"]}}},"required":["options"]}},"required":["numberId","person","goal","context","consent","purpose"]},"TaskUpdateInput":{"type":"object","properties":{"addContext":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"authority":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}}}},"AnswerInput":{"type":"object","properties":{"questionId":{"type":"string","minLength":1},"answer":{"type":"string","minLength":1,"maxLength":2000}},"required":["questionId","answer"]},"KnowledgeAddInput":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"type":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":200},"aliases":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"facts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":1000}}},"required":["id","type","name","facts"]}},"links":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"relation":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"required":["from","relation","to"]}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":50000}},"required":["id","title","text"]}}}},"KnowledgeRemoveInput":{"type":"object","properties":{"entityIds":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"documentIds":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"links":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"relation":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"required":["from","relation","to"]}}}},"Knowledge":{"type":"object","properties":{"entities":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"type":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":200},"aliases":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"facts":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":1000}}},"required":["id","type","name","facts"],"additionalProperties":false}},"links":{"default":[],"type":"array","items":{"type":"object","properties":{"from":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"relation":{"type":"string","minLength":1,"maxLength":100},"to":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"}},"required":["from","relation","to"],"additionalProperties":false}},"documents":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z0-9_.:-]{1,100}$"},"title":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":50000}},"required":["id","title","text"],"additionalProperties":false}}},"required":["entities","links","documents"],"additionalProperties":false},"KnowledgeCounts":{"type":"object","required":["entities","links","documents"],"properties":{"entities":{"type":"integer"},"links":{"type":"integer"},"documents":{"type":"integer"}}},"Lookup":{"type":"object","required":["query","result","at"],"properties":{"query":{"type":"string"},"result":{"type":"string"},"at":{"type":"string"}}},"NumberCreateInput":{"type":"object","properties":{"company":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100},"defaultInstructions":{"type":"string","minLength":1,"maxLength":2000},"areaCode":{"type":"string","pattern":"^\\d{3}$"}},"required":["company","label","defaultInstructions"]},"NumberUpdateInput":{"type":"object","properties":{"company":{"type":"string","minLength":1,"maxLength":100},"label":{"type":"string","minLength":1,"maxLength":100},"defaultInstructions":{"type":"string","minLength":1,"maxLength":2000}}},"AccountUpdateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"webhookUrl":{"anyOf":[{"type":"string","format":"starts_with","pattern":"^https:\\/\\/.*"},{"type":"null"}]},"redactEveryCall":{"type":"boolean"}},"additionalProperties":false},"OptOutCreateInput":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":40}},"required":["phone"]},"ShareCreateInput":{"type":"object","properties":{"redact":{"default":true,"type":"boolean"},"expiresInSeconds":{"default":604800,"type":"integer","minimum":60,"maximum":9007199254740991},"label":{"type":"string","minLength":1,"maxLength":100}}},"LiveLinkCreateInput":{"type":"object","properties":{"mode":{"type":"string","enum":["listen","takeover"]}},"required":["mode"]},"OperatorCallInput":{"type":"object","properties":{"phone":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","minLength":1,"maxLength":60}},"required":["phone","name"]},"TextingRegistrationInput":{"type":"object","properties":{"businessType":{"type":"string","enum":["Sole Proprietorship","Partnership","Limited Liability Corporation","Co-operative","Non-profit Corporation","Corporation"]},"industry":{"type":"string","enum":["AUTOMOTIVE","AGRICULTURE","BANKING","CONSTRUCTION","CONSUMER","EDUCATION","ENGINEERING","ENERGY","OIL_AND_GAS","FAST_MOVING_CONSUMER_GOODS","FINANCIAL","FINTECH","FOOD_AND_BEVERAGE","GOVERNMENT","HEALTHCARE","HOSPITALITY","INSURANCE","LEGAL","MANUFACTURING","MEDIA","ONLINE","PROFESSIONAL_SERVICES","RAW_MATERIALS","REAL_ESTATE","RELIGION","RETAIL","JEWELRY","TECHNOLOGY","TELECOMMUNICATIONS","TRANSPORTATION","TRAVEL","ELECTRONICS","NOT_FOR_PROFIT"]},"companyType":{"type":"string","enum":["private","public","non-profit","government"]},"stockExchange":{"type":"string","minLength":1,"maxLength":20},"stockTicker":{"type":"string","minLength":1,"maxLength":10},"websiteUrl":{"type":"string","maxLength":500,"format":"uri"},"address":{"type":"object","properties":{"street":{"type":"string","minLength":1,"maxLength":200},"streetSecondary":{"type":"string","maxLength":200},"city":{"type":"string","minLength":1,"maxLength":100},"region":{"type":"string","pattern":"^[A-Z]{2}$"},"postalCode":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$"}},"required":["street","city","region","postalCode"]},"representative":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","maxLength":200,"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,}$"},"phone":{"type":"string","minLength":1,"maxLength":40},"title":{"type":"string","minLength":1,"maxLength":100},"jobPosition":{"type":"string","enum":["Director","GM","VP","CEO","CFO","General Counsel","Other"]}},"required":["firstName","lastName","email","phone","title","jobPosition"]},"messageFlow":{"type":"string","minLength":40,"maxLength":2048},"privacyPolicyUrl":{"type":"string","maxLength":500,"format":"uri"},"termsUrl":{"type":"string","maxLength":500,"format":"uri"}},"required":["businessType","industry","companyType","websiteUrl","address","representative","messageFlow","privacyPolicyUrl","termsUrl"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"SalesChecks":{"type":"object","required":["at","states"],"properties":{"at":{"type":"string"},"states":{"type":"array","items":{"type":"string"},"description":"The US states that applied to the person and the number."},"dnc":{"type":"object","required":["national","states","dataDate","responseId"],"properties":{"national":{"type":"boolean"},"states":{"type":"object","additionalProperties":{"type":"boolean"}},"dataDate":{"type":"string"},"responseId":{"type":"string"}}},"reassigned":{"type":"object","required":["answer","responseId"],"properties":{"answer":{"type":"string"},"responseId":{"type":"string"}}}}},"Turn":{"type":"object","required":["speaker","text","at"],"properties":{"speaker":{"enum":["agent","person","operator"]},"text":{"type":"string"},"at":{"type":"string"}}},"Correction":{"type":"object","required":["about","was","now"],"properties":{"about":{"type":"string"},"was":{"type":"string"},"now":{"type":"string"}}},"OpenQuestion":{"type":"object","required":["id","question","blocking","answer","askedAt","answeredAt"],"properties":{"id":{"type":"string"},"question":{"type":"string"},"blocking":{"type":"boolean"},"answer":{"type":["string","null"]},"askedAt":{"type":"string"},"answeredAt":{"type":["string","null"]}}},"AttemptSummary":{"type":"object","required":["id","channel","direction","kind","startedAt","endedAt","billableSeconds","costCents","transcript","lookups","hasRecording","checks"],"properties":{"id":{"type":"string"},"channel":{"enum":["call","text"],"description":"A call, or a text thread. A text thread's transcript lists its texts in order."},"direction":{"enum":["outbound","inbound"]},"kind":{"enum":["in_progress","conversation","voicemail","no_answer","wrong_person","opted_out","failed"],"description":"What happened. \"in_progress\" until the call ends or the text thread closes."},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"billableSeconds":{"type":"integer"},"costCents":{"type":"integer"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/Turn"}},"lookups":{"type":"array","items":{"$ref":"#/components/schemas/Lookup"}},"hasRecording":{"type":"boolean"},"checks":{"oneOf":[{"$ref":"#/components/schemas/SalesChecks"},{"type":"null"}],"description":"What the compliance checks found before this sales attempt. Null for other attempts."}}},"TaskResult":{"type":"object","required":["state","summary","fields","declineReason","humanRequest","corrections","openQuestions","billedSeconds","billedCents"],"properties":{"state":{"enum":["goal_met","declined","unreachable","needs_human","expired","cancelled"]},"summary":{"type":"string"},"fields":{"type":["object","null"],"additionalProperties":true},"declineReason":{"type":["string","null"]},"humanRequest":{"type":["string","null"]},"corrections":{"type":"array","items":{"$ref":"#/components/schemas/Correction"}},"openQuestions":{"type":"array","items":{"$ref":"#/components/schemas/OpenQuestion"}},"billedSeconds":{"type":"integer"},"billedCents":{"type":"integer"}}},"ConsentRecord":{"type":"object","required":["formId","formText","phone","capturedAt","reference","ipAddress","pageUrl"],"properties":{"formId":{"type":"string"},"formText":{"type":"string"},"phone":{"type":"string"},"capturedAt":{"type":"string"},"reference":{"type":"string"},"ipAddress":{"type":["string","null"]},"pageUrl":{"type":["string","null"]}}},"Task":{"type":"object","required":["id","state","numberId","person","onBehalfOf","goal","purpose","offer","consentRecord","cancelReason","channel","context","authority","openQuestions","corrections","attempts","result","nextAttemptAt","expiresAt","followUpOf","knowledgeCounts","metadata","companion","createdAt","updatedAt"],"properties":{"id":{"type":"string"},"state":{"enum":["queued","in_progress","waiting_for_reply","waiting_for_answer","goal_met","declined","unreachable","needs_human","expired","cancelled"]},"numberId":{"type":"string"},"person":{"type":"object","required":["name","phone"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"pronunciation":{"type":"string"},"language":{"type":"string"},"timeZone":{"type":"string"},"state":{"type":"string"}}},"onBehalfOf":{"type":["string","null"]},"goal":{"type":"string"},"purpose":{"enum":["support","employee","account_notice","sales"]},"offer":{"type":["string","null"]},"consentRecord":{"anyOf":[{"$ref":"#/components/schemas/ConsentRecord"},{"type":"null"}]},"cancelReason":{"type":["string","null"]},"channel":{"enum":["call","text","text_then_call"]},"context":{"type":"array","items":{"type":"string"}},"authority":{"type":"array","items":{"type":"string"}},"openQuestions":{"type":"array","items":{"$ref":"#/components/schemas/OpenQuestion"}},"corrections":{"type":"array","items":{"$ref":"#/components/schemas/Correction"}},"attempts":{"type":"array","items":{"$ref":"#/components/schemas/AttemptSummary"}},"result":{"anyOf":[{"$ref":"#/components/schemas/TaskResult"},{"type":"null"}]},"nextAttemptAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"followUpOf":{"type":["string","null"]},"knowledgeCounts":{"$ref":"#/components/schemas/KnowledgeCounts"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"companion":{"anyOf":[{"$ref":"#/components/schemas/TaskCompanion"},{"type":"null"}],"description":"The options you gave and what each call did with them. Null when the task has no options."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"CompanionOption":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":300},"detail":{"type":"string","minLength":1,"maxLength":80},"imageUrl":{"type":"string","maxLength":2000,"format":"starts_with","pattern":"^https:\\/\\/.*"}},"required":["id","title"],"additionalProperties":false},"CompanionScreen":{"type":"object","required":["id","kind","title","optionIds","multiple","at"],"description":"One screen the voice agent showed on the person's companion page.","properties":{"id":{"type":"string"},"kind":{"enum":["choice","details"],"description":"A choice screen takes a selection. A details screen only shows options."},"title":{"type":"string"},"optionIds":{"type":"array","items":{"type":"string"}},"multiple":{"type":"boolean","description":"True when a choice screen allows more than one selection."},"at":{"type":"string"}}},"CompanionSelection":{"type":"object","required":["screenId","optionIds","at"],"description":"What the person confirmed on one screen. A person who changes their mind adds a later selection for the same screen.","properties":{"screenId":{"type":"string"},"optionIds":{"type":"array","items":{"type":"string"}},"at":{"type":"string"}}},"CompanionRecord":{"type":"object","required":["taskId","linkSentAt","openedAt","resends","screens","selections"],"description":"The companion page of one call. It comes from the page, not from the model.","properties":{"taskId":{"type":"string"},"linkSentAt":{"type":["string","null"]},"openedAt":{"type":["string","null"]},"resends":{"type":"integer","description":"How many times the voice agent sent the link again. At most 1."},"screens":{"type":"array","items":{"$ref":"#/components/schemas/CompanionScreen"},"description":"Every screen shown, in order."},"selections":{"type":"array","items":{"$ref":"#/components/schemas/CompanionSelection"},"description":"Every selection, in order."}}},"TaskCompanion":{"type":"object","required":["options","calls"],"properties":{"options":{"type":"array","items":{"$ref":"#/components/schemas/CompanionOption"}},"calls":{"type":"array","items":{"$ref":"#/components/schemas/CompanionRecord"},"description":"One record for each call that served this task, in call order."}}},"TaskDataDeletion":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","required":["retained"],"description":"Set for a sales task. Its transcripts and consent record stay until `until`. Null for other purposes.","properties":{"retained":{"anyOf":[{"type":"object","required":["transcripts","consentRecord","until"],"properties":{"transcripts":{"type":"boolean","enum":[true]},"consentRecord":{"type":"boolean","enum":[true]},"until":{"type":"string"}}},{"type":"null"}]}}}]},"TaskList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"nextCursor":{"type":["string","null"]}}},"Number":{"type":"object","required":["id","e164","company","label","defaultInstructions","companion","createdAt","releasedAt"],"properties":{"id":{"type":"string"},"e164":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"},"defaultInstructions":{"type":"string"},"cnamStatus":{"type":["string","null"],"enum":["pending","approved","failed",null],"description":"Caller ID name registration for a sales number. Null for other numbers."},"companion":{"enum":["off","pending","on"],"description":"Whether the number can text a companion link. \"pending\" while carriers review the texting registration. \"on\" once texting is approved for the number. No separate step turns it on."},"createdAt":{"type":"string"},"releasedAt":{"type":["string","null"]}}},"NumberList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Number"}}}},"Call":{"type":"object","required":["id","channel","direction","kind","startedAt","endedAt","billableSeconds","costCents","transcript","lookups","hasRecording","checks","numberId","taskIds","from","to","answeredAt"],"properties":{"id":{"type":"string"},"channel":{"enum":["call","text"],"description":"A call, or a text thread. A text thread's transcript lists its texts in order."},"direction":{"enum":["outbound","inbound"]},"kind":{"enum":["in_progress","conversation","voicemail","no_answer","wrong_person","opted_out","failed"],"description":"What happened. \"in_progress\" until the call ends or the text thread closes."},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"billableSeconds":{"type":"integer"},"costCents":{"type":"integer"},"transcript":{"type":"array","items":{"$ref":"#/components/schemas/Turn"}},"lookups":{"type":"array","items":{"$ref":"#/components/schemas/Lookup"}},"hasRecording":{"type":"boolean"},"checks":{"oneOf":[{"$ref":"#/components/schemas/SalesChecks"},{"type":"null"}],"description":"What the compliance checks found before this sales attempt. Null for other attempts."},"numberId":{"type":"string"},"taskIds":{"type":"array","items":{"type":"string"},"description":"Empty for calls from unknown callers."},"from":{"type":"string"},"to":{"type":"string"},"answeredAt":{"type":["string","null"]}}},"CallList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"nextCursor":{"type":["string","null"]}}},"Share":{"type":"object","required":["id","callId","redact","redaction","label","expiresAt","revokedAt","views","lastViewedAt","createdAt"],"properties":{"id":{"type":"string"},"callId":{"type":"string"},"redact":{"type":"boolean","description":"True plays the redacted recording and transcript."},"redaction":{"enum":["not_requested","pending","ready","failed"],"description":"The redacted recording's state. not_requested for an unredacted share."},"label":{"type":["string","null"]},"expiresAt":{"type":"string"},"revokedAt":{"type":["string","null"]},"views":{"type":"integer"},"lastViewedAt":{"type":["string","null"]},"createdAt":{"type":"string"}}},"ShareCreated":{"description":"The new share link. The url holds the token and appears only in this response.","allOf":[{"$ref":"#/components/schemas/Share"},{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}]},"ShareList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Share"}}}},"LiveLink":{"type":"object","required":["id","taskId","mode","expiresAt","revokedAt","createdAt"],"properties":{"id":{"type":"string"},"taskId":{"type":"string"},"mode":{"enum":["listen","takeover"],"description":"takeover also listens. It drops to listen when the organization allows only listening."},"expiresAt":{"type":"string","description":"The earlier of the task's expiry and 24 hours after creation. The link also stops when the task ends."},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}}},"LiveLinkCreated":{"description":"The new live link. The url holds the token and appears only in this response.","allOf":[{"$ref":"#/components/schemas/LiveLink"},{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}]},"OperatorCall":{"type":"object","required":["status"],"properties":{"status":{"enum":["dialing"]}}},"Account":{"type":"object","required":["customerId","name","legalName","status","webhookUrl","balanceCents","spentTodayCents","pricePerMinuteCents","dailySpendLimitCents","unredactedSharesAllowed","redactEveryCall","liveLinks"],"properties":{"customerId":{"type":"string"},"name":{"type":"string"},"legalName":{"type":["string","null"]},"status":{"enum":["pending","approved","suspended"]},"webhookUrl":{"type":["string","null"]},"balanceCents":{"type":"integer"},"spentTodayCents":{"type":"integer"},"pricePerMinuteCents":{"type":"integer"},"dailySpendLimitCents":{"type":"integer"},"unredactedSharesAllowed":{"type":"boolean","description":"False allows only redacted share links."},"redactEveryCall":{"type":"boolean","description":"True redacts every recorded call when it ends."},"liveLinks":{"enum":["off","listen","listen_and_takeover"],"description":"Who may use live links."}}},"LedgerEntry":{"type":"object","required":["id","kind","amountCents","ref","createdAt"],"properties":{"id":{"type":"string"},"kind":{"enum":["topup","call","number_fee","adjustment","text","texting_fee","redaction","operator_call"]},"amountCents":{"type":"integer"},"ref":{"type":"string"},"createdAt":{"type":"string"}}},"LedgerList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntry"}},"nextCursor":{"type":["string","null"]}}},"OptOut":{"type":"object","required":["phone","createdAt","removedAt","source"],"properties":{"phone":{"type":"string"},"createdAt":{"type":"string"},"removedAt":{"type":["string","null"]},"source":{"enum":["voice","keypress","text_keyword","text_agent","api","dashboard"]}}},"OptOutList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptOut"}}}},"WebhookDelivery":{"type":"object","required":["id","type","status","attempts","lastError","nextAttemptAt","deliveredAt","createdAt","payload"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"status":{"enum":["delivered","pending","failed","skipped"]},"attempts":{"type":"integer"},"lastError":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"payload":{}}},"Texting":{"type":"object","required":["status","error","submittedAt","approvedAt","numbers","prices","sales"],"properties":{"status":{"enum":["not_registered","submitted","brand_review","campaign_review","approved","rejected","failed"]},"error":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"numbers":{"type":"array","items":{"type":"object","required":["id","e164","label","texting","textTasks","companion"],"properties":{"id":{"type":"string"},"e164":{"type":"string"},"label":{"type":"string"},"texting":{"enum":["on","pending","off"]},"textTasks":{"type":"boolean","description":"True when the number can send text tasks."},"companion":{"enum":["on","pending","off"],"description":"\"on\" when the number can text a companion link during calls."}}}},"prices":{"type":"object","required":["perTextCents","setupFeeCents","monthlyFeeCents","salesSetupFeeCents","salesMonthlyFeeCents"],"properties":{"perTextCents":{"type":"integer"},"setupFeeCents":{"type":"integer"},"monthlyFeeCents":{"type":"integer"},"salesSetupFeeCents":{"type":"integer"},"salesMonthlyFeeCents":{"type":"integer"}}},"sales":{"type":["object","null"],"description":"The marketing campaign for sales texts. Null when the organization has no sales access.","required":["status","error","dailyCapNote"],"properties":{"status":{"type":["string","null"],"description":"submitted, review, approved, rejected, or failed. Null before the campaign is created."},"error":{"type":["string","null"]},"dailyCapNote":{"type":"string"}}}}},"Message":{"type":"object","required":["id","numberId","taskIds","direction","kind","from","to","body","status","error","segments","costCents","createdAt","sentAt"],"properties":{"id":{"type":"string"},"numberId":{"type":"string"},"taskIds":{"type":"array","items":{"type":"string"}},"direction":{"enum":["outbound","inbound"]},"kind":{"enum":["voicemail_followup","callback_ack","task_text","opt_out_confirm","help_reply","inbound","companion_link"]},"from":{"type":"string"},"to":{"type":"string"},"body":{"type":"string"},"status":{"enum":["queued","sending","sent","delivered","undelivered","failed","blocked","received"]},"error":{"type":["string","null"]},"segments":{"type":"integer"},"costCents":{"type":"integer"},"createdAt":{"type":"string"},"sentAt":{"type":["string","null"]}}},"MessageList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"nextCursor":{"type":["string","null"]}}},"WebhookDeliveryList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"type":["string","null"]}}}}}}