{"openapi":"3.0.3","info":{"title":"Callstorm API","version":"1.0.0","description":"Server-to-server API of Callstorm (outbound voice campaigns: audio, voicebot and conversational AI agent).\n\n**Authentication.** Create an API key in *Settings › Integrations › API keys* and send it in the `X-Api-Key` header\n(`Authorization: Bearer vx_…` is also accepted). Each key carries a set of scopes; a request whose endpoint needs a scope the key lacks fails with 403.\n\n**Rate limit.** Per key and minute (default 600). Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`; exceeding it returns 429 `RATE_LIMITED`.\n\n**Idempotency.** Any POST/PUT/DELETE may carry an `Idempotency-Key` header. The first response is stored for 24 h and replayed (header `Idempotent-Replayed: true`) on repeats.\n\n**Money.** Amounts are USD as integer micro-dollars (`1 USD = 1000000` micros) unless the field name ends in `Usd`.\n\n**Webhooks.** Register HTTPS endpoints under `/integrations/webhooks`; each delivery is a JSON POST with `X-Voxcore-Event` and\n`X-Voxcore-Signature: sha256=<hex HMAC-SHA256 of the raw body with the webhook secret>`.\n\n**Typical flow.** `POST /files/presign` (kind `leads`) → upload the file with PUT to `uploadUrl` → `POST /lead-lists` → poll `GET /lead-lists/{id}` until `READY` →\n`POST /campaigns` (with `templateId` or inline `config`, plus `leadListId`) → `GET /campaigns/{id}/estimate` → `POST /campaigns/{id}/launch` → read results with `GET /calls?campaignId=…` or the `call.completed` webhook."},"servers":[{"url":"https://api.callstorm.ai/v1/ext"}],"security":[{"ApiKey":[]}],"tags":[{"name":"Campaigns"},{"name":"Templates"},{"name":"Lead lists"},{"name":"Files"},{"name":"Calls"},{"name":"Exports"},{"name":"DNC","description":"Do-not-call list of the account."},{"name":"Telephony"},{"name":"Agents","description":"Human agents of the account and the token that embeds their console in a CRM."},{"name":"Credits"},{"name":"Webhooks"},{"name":"API keys"},{"name":"Account"}],"paths":{"/me":{"get":{"tags":["Account"],"summary":"Identity of the caller (the API key) and its account","responses":{"200":{"description":"Caller","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"account":{"$ref":"#/components/schemas/Account"}}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dashboard":{"get":{"tags":["Account"],"summary":"Account dashboard (balance, activity of the day, active campaigns)","responses":{"200":{"description":"Dashboard","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":true}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns":{"get":{"tags":["Campaigns"],"summary":"List campaigns","x-required-scope":"campaign:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `nextCursor` of the previous page."},{"name":"status","in":"query","schema":{"type":"string"},"description":"Campaign statuses (comma-separated list accepted)."},{"name":"type","in":"query","schema":{"type":"string"},"description":"Service types (comma-separated list accepted)."},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Name search"}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer","description":"Size of the whole filtered set (lists served by the reports database)"}},"required":["items"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Campaigns"],"summary":"Create a campaign draft","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDraftInput"}}}},"responses":{"201":{"description":"Draft created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id (`cmp-…`)"}],"get":{"tags":["Campaigns"],"summary":"Get a campaign","x-required-scope":"campaign:read","responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Campaigns"],"summary":"Update a draft (only status DRAFT)","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignDraftInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Campaigns"],"summary":"Delete a draft (only status DRAFT)","x-required-scope":"campaign:write","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Campaigns"],"summary":"Adjust a SCHEDULED / RUNNING / PAUSED campaign","x-required-scope":"campaign:write","description":"Settings that may change while the campaign runs: trunk and caller ID (outbound only; the number must belong to the trunk), dialing rules (attempts per number, interval, concurrency, phone rotation) and, on CALL campaigns, the predictive pacing (dial level, adaptive, max level, abandon cap — the adaptive level restarts from the new value). Takes effect on the next dial.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignLivePatch"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/estimate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"get":{"tags":["Campaigns"],"summary":"Cost estimate and launch readiness","x-required-scope":"campaign:read","responses":{"200":{"description":"Estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estimate"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/launch":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Launch now or schedule (`startAt` in the future)","x-required-scope":"campaign:launch","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"startAt":{"type":"string","format":"date-time","description":"Optional explicit start; by default the campaign runs now, or is SCHEDULED for `schedule.startDate` at `windowStart` when that day is still ahead. A period already over is refused (400)."}}}}}},"responses":{"200":{"description":"Campaign RUNNING or SCHEDULED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/pause":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Pause a campaign","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"responses":{"200":{"description":"Campaign after the transition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/resume":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Resume a campaign","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"responses":{"200":{"description":"Campaign after the transition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/stop":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Stop a campaign","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"responses":{"200":{"description":"Campaign after the transition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/archive":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Archive a campaign","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"responses":{"200":{"description":"Campaign after the transition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/duplicate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"post":{"tags":["Campaigns"],"summary":"Duplicate as a new draft","x-required-scope":"campaign:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"responses":{"201":{"description":"New draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List templates","parameters":[{"name":"type","in":"query","schema":{"$ref":"#/components/schemas/ServiceType"}}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Templates"],"summary":"Create a template","x-required-scope":"templates:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Template id (`tpl-…`)"}],"get":{"tags":["Templates"],"summary":"Get a template","responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Templates"],"summary":"Update a template (partial)","x-required-scope":"templates:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Templates"],"summary":"Delete a template","x-required-scope":"templates:write","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/{id}/duplicate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Template id"}],"post":{"tags":["Templates"],"summary":"Duplicate a template","x-required-scope":"templates:write","responses":{"201":{"description":"Copy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/files/presign":{"post":{"tags":["Files"],"summary":"Pre-signed URL to upload a lead file (CSV/XLSX) or a WAV audio","x-required-scope":"leads:write","description":"Then upload the file with an HTTP PUT to `uploadUrl` (same `Content-Type`) and use `key` as `sourceFileKey` / audio key. Scope: `leads:write` for `leads`, `templates:write` for `audio`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["leads","audio"]},"fileName":{"type":"string"},"contentType":{"type":"string","example":"text/csv"},"size":{"type":"integer","description":"Bytes"}},"required":["kind","fileName","contentType","size"]}}}},"responses":{"200":{"description":"Upload target","content":{"application/json":{"schema":{"type":"object","properties":{"uploadUrl":{"type":"string","description":"Pre-signed PUT, valid 15 minutes; it signs the exact `Content-Type` and size"},"key":{"type":"string"},"method":{"type":"string","example":"PUT"},"headers":{"type":"object","properties":{},"description":"Headers to send with the upload (`Content-Type`)"}},"required":["uploadUrl","key"]}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lead-lists":{"get":{"tags":["Lead lists"],"summary":"List lead lists","responses":{"200":{"description":"Lists","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LeadList"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Lead lists"],"summary":"Create a lead list from an uploaded file (processed asynchronously)","x-required-scope":"leads:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadListInput"}}}},"responses":{"201":{"description":"List in status PROCESSING; poll until READY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadList"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lead-lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Lead list id (`lst-…`)"}],"get":{"tags":["Lead lists"],"summary":"Get a lead list (status, counters, rejected-rows file)","responses":{"200":{"description":"List","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadList"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Lead lists"],"summary":"Delete a lead list (not while an active campaign uses it)","x-required-scope":"leads:write","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lead-lists/{id}/leads":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Lead list id"}],"get":{"tags":["Lead lists"],"summary":"Leads of a list (paginated)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `nextCursor` of the previous page."}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer","description":"Size of the whole filtered set (lists served by the reports database)"}},"required":["items"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dnc":{"get":{"tags":["DNC"],"summary":"List do-not-call numbers","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `nextCursor` of the previous page."},{"name":"q","in":"query","schema":{"type":"string"},"description":"Prefix of the E.164 number"}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DncEntry"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer","description":"Size of the whole filtered set (lists served by the reports database)"}},"required":["items"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["DNC"],"summary":"Add numbers to the do-not-call list","x-required-scope":"dnc:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"phoneE164":{"type":"string","example":"+5491155550000"},"reason":{"type":"string"}},"required":["phoneE164"]}}},"required":["entries"]}}}},"responses":{"200":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"integer"}}}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/dnc/{phoneE164}":{"parameters":[{"name":"phoneE164","in":"path","required":true,"schema":{"type":"string"},"description":"Number in E.164 (URL-encode the `+`)"}],"delete":{"tags":["DNC"],"summary":"Remove a number from the do-not-call list","x-required-scope":"dnc:write","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls":{"get":{"tags":["Calls"],"summary":"List calls (results)","x-required-scope":"campaign:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `nextCursor` of the previous page."},{"name":"campaignId","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"$ref":"#/components/schemas/ServiceType"}},{"name":"direction","in":"query","schema":{"type":"string","enum":["OUTBOUND","INBOUND"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"disposition","in":"query","schema":{"type":"string"},"description":"Dispositions (comma-separated list accepted)."},{"name":"resultCode","in":"query","schema":{"type":"string"},"description":"Result codes (comma-separated list accepted)."},{"name":"phone","in":"query","schema":{"type":"string"},"description":"Exact number (E.164)."},{"name":"q","in":"query","schema":{"type":"string"},"description":"Part of the phone (digits) or of the lead name."},{"name":"agentId","in":"query","schema":{"type":"string"},"description":"Human agent who handled the call (CALL campaigns)."},{"name":"sort","in":"query","schema":{"type":"string","enum":["startedAt:desc","startedAt:asc","durationSec:desc","durationSec:asc","attemptNo:desc","attemptNo:asc"],"default":"startedAt:desc"}}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Call"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer","description":"Size of the whole filtered set (lists served by the reports database)"}},"required":["items"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls/summary":{"get":{"tags":["Calls"],"summary":"Aggregates of the whole filtered set (same filters as the list)","x-required-scope":"campaign:read","parameters":[{"name":"campaignId","in":"query","schema":{"type":"string"}},{"name":"type","in":"query","schema":{"$ref":"#/components/schemas/ServiceType"}},{"name":"direction","in":"query","schema":{"type":"string","enum":["OUTBOUND","INBOUND"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"disposition","in":"query","schema":{"type":"string"},"description":"Dispositions (comma-separated list accepted)."},{"name":"resultCode","in":"query","schema":{"type":"string"},"description":"Result codes (comma-separated list accepted)."},{"name":"phone","in":"query","schema":{"type":"string"},"description":"Exact number (E.164)."},{"name":"q","in":"query","schema":{"type":"string"},"description":"Part of the phone (digits) or of the lead name."},{"name":"agentId","in":"query","schema":{"type":"string"},"description":"Human agent who handled the call (CALL campaigns)."}],"responses":{"200":{"description":"Summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallsSummary"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/calls/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Call id"}],"get":{"tags":["Calls"],"summary":"Call detail: transcript, answers, DTMF, attempts, short-lived recording URL","x-required-scope":"campaign:read","responses":{"200":{"description":"Detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetail"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/exports":{"get":{"tags":["Exports"],"summary":"List export jobs","x-required-scope":"reports:export","responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExportJob"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Exports"],"summary":"Create an export of calls (CSV/XLSX, includes lead data); poll until READY","x-required-scope":"reports:export","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string","enum":["CSV","XLSX"]},"campaignId":{"type":"string"},"type":{"$ref":"#/components/schemas/ServiceType"},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"disposition":{"type":"array","items":{"type":"string"}},"resultCode":{"type":"array","items":{"type":"string"}},"phone":{"type":"string"}},"required":["format"]}}}},"responses":{"201":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/exports/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Export job id"}],"get":{"tags":["Exports"],"summary":"Export job status and download URL","x-required-scope":"reports:export","responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/cells":{"get":{"tags":["Telephony"],"summary":"Engine cells (regions) and the egress IPs to whitelist at the carrier","responses":{"200":{"description":"Cells","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EngineCell"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/trunks":{"get":{"tags":["Telephony"],"summary":"List SIP trunks","responses":{"200":{"description":"Trunks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SipTrunk"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Telephony"],"summary":"Create a SIP trunk","x-required-scope":"settings:telephony","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrunkInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunk"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/trunks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Trunk id"}],"get":{"tags":["Telephony"],"summary":"Get a trunk","responses":{"200":{"description":"Trunk","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunk"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Telephony"],"summary":"Update a trunk","x-required-scope":"settings:telephony","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrunkInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SipTrunk"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Telephony"],"summary":"Delete a trunk","x-required-scope":"settings:telephony","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/trunks/{id}/test":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Trunk id"}],"post":{"tags":["Telephony"],"summary":"SIP OPTIONS test against the trunk","x-required-scope":"settings:telephony","responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"},"latencyMs":{"type":"integer"}},"required":["ok"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/caller-ids":{"get":{"tags":["Telephony"],"summary":"List DIDs (caller ids)","responses":{"200":{"description":"Caller ids","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CallerId"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Telephony"],"summary":"Register a DID","x-required-scope":"settings:telephony","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"e164":{"type":"string"},"country":{"type":"string","minLength":2,"maxLength":2},"label":{"type":"string"},"trunkId":{"type":"string"}},"required":["e164","country","trunkId"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerId"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/caller-ids/{e164}":{"parameters":[{"name":"e164","in":"path","required":true,"schema":{"type":"string"},"description":"DID in E.164 (URL-encode the `+`)"}],"put":{"tags":["Telephony"],"summary":"Edit label / trunk of a DID","x-required-scope":"settings:telephony","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"trunkId":{"type":"string"}},"required":["trunkId"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerId"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Telephony"],"summary":"Remove a DID","x-required-scope":"settings:telephony","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents":{"get":{"tags":["Agents"],"summary":"List the human agents of the account (presence included)","responses":{"200":{"description":"Agents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"summary":"Create an agent (invites the e-mail as a portal user with role agent)","x-required-scope":"settings:telephony","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Agent id"}],"get":{"tags":["Agents"],"summary":"Get an agent","responses":{"200":{"description":"Agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"summary":"Update name, extension or cell","x-required-scope":"settings:telephony","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPatch"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Delete the agent and its portal user","x-required-scope":"settings:telephony","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/status":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Agent id"}],"post":{"tags":["Agents"],"summary":"Force the presence of an agent (supervisor)","x-required-scope":"settings:telephony","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/AgentStatus"},"pauseReason":{"$ref":"#/components/schemas/AgentPauseReason"}},"required":["status"]}}}},"responses":{"200":{"description":"Agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/agents/{id}/session-token":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Agent id"}],"post":{"tags":["Agents"],"summary":"Session token for the embedded agent console (CRM widget)","x-required-scope":"settings:telephony","description":"Returns a short-lived `vxa_…` token (default 8 h, max 12 h) with which the embedded console at `embedUrl` acts as this agent: presence (available / pause / disconnect), campaign (queue), incoming and outgoing calls, manual / preview dialing and dispositions — everything the agent does in the Callstorm console. Give it to the browser with the loader (`<embedUrl origin>/embed/voxcore-agent.js`, `VoxCoreAgent.mount({ token })`) or in the URL fragment (`<embedUrl>#token=…`). The token itself reaches only the console routes (`/agents/me/*`, `/calls/{id}/disposition`, `/me`). Audited.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ttlSec":{"type":"integer","minimum":300,"maximum":43200,"default":28800,"description":"Lifetime in seconds"}}}}}},"responses":{"201":{"description":"Token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSessionToken"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits/ledger":{"get":{"tags":["Credits"],"summary":"Credit ledger (purchases, consumption, adjustments)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from `nextCursor` of the previous page."},{"name":"kind","in":"query","schema":{"type":"string","enum":["PURCHASE","CONSUMPTION","ADJUSTMENT","REFUND","BONUS"]}}],"responses":{"200":{"description":"Page","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntry"}},"nextCursor":{"type":"string","nullable":true},"total":{"type":"integer","description":"Size of the whole filtered set (lists served by the reports database)"}},"required":["items"]}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits/payments":{"get":{"tags":["Credits"],"summary":"Payments (top-ups) of the account","responses":{"200":{"description":"Payments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits/packages":{"get":{"tags":["Credits"],"summary":"Credit packages on sale","responses":{"200":{"description":"Packages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditPackage"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pricing":{"get":{"tags":["Credits"],"summary":"Active price plans per service type","responses":{"200":{"description":"Plans","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":true}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits/checkout-options":{"get":{"tags":["Credits"],"summary":"Gateways available for a top-up: currency charged and, when it is not USD, the US$ rate applied to the package price","x-required-scope":"credits:buy","responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["lemonsqueezy","stripe","mercadopago"]},"currency":{"type":"string","example":"CLP"},"usdRate":{"type":"number","description":"Units of `currency` per US$ 1 (absent when the gateway charges USD)"},"rateAsOf":{"type":"string","format":"date-time"}},"required":["provider","currency"]}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/credits/checkout":{"post":{"tags":["Credits"],"summary":"Create a hosted checkout for a package (returns the payment URL)","x-required-scope":"credits:buy","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Optional. Repeating a request with the same key (per API key, 24 h) returns the first response without executing again."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"packageId":{"type":"string"},"provider":{"type":"string","enum":["lemonsqueezy","stripe","mercadopago"],"description":"One of `GET /credits/checkout-options`; omitted = the default gateway"}},"required":["packageId"]}}}},"responses":{"200":{"description":"Checkout","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Hosted checkout page of the gateway; the balance is credited when the payment is confirmed"}},"required":["url"]}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"PAYMENT_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/integrations/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook (the signing secret is returned only once)","x-required-scope":"settings:integrations","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS only"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","campaign.started","campaign.completed","campaign.paused","campaign.status_changed","lead_list.processed","balance.low","credits.low","payment.succeeded"]}}},"required":["url","events"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}]}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/integrations/webhooks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Webhook id"}],"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","x-required-scope":"settings:integrations","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys of the account (never the token)","x-required-scope":"settings:integrations","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key (JWT session only; the token is returned once)","x-required-scope":"settings:integrations","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}]}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account/api-keys/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Key id"}],"delete":{"tags":["API keys"],"summary":"Revoke an API key (JWT session only)","x-required-scope":"settings:integrations","responses":{"204":{"description":"Done (no content)."},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Account API key (`vx_live_…` / `vx_test_…`)."}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"string","example":"VALIDATION_ERROR"},"message":{"type":"string"},"details":{"type":"object","properties":{},"additionalProperties":true}},"required":["code","message"]},"ServiceType":{"type":"string","enum":["AUDIO","VOICEBOT","AI_AGENT"]},"CampaignStatus":{"type":"string","enum":["DRAFT","SCHEDULED","RUNNING","PAUSED","COMPLETED","STOPPED","ARCHIVED","ERROR"]},"Scope":{"type":"string","enum":["campaign:read","campaign:write","campaign:launch","templates:write","leads:write","dnc:write","credits:buy","settings:account","settings:users","settings:telephony","settings:integrations","reports:export"]},"User":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"}}},"Account":{"type":"object","properties":{"accountId":{"type":"string"},"companyName":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"},"defaultLocale":{"type":"string"},"balanceMicros":{"type":"integer"},"status":{"type":"string"}}},"Schedule":{"type":"object","properties":{"timezone":{"type":"string","example":"America/Santiago"},"windowStart":{"type":"string","example":"09:00"},"windowEnd":{"type":"string","example":"20:00"},"startDate":{"type":"string","format":"date","example":"2026-10-27","description":"First day of the campaign (calendar day in `timezone`). Launching before it schedules the campaign for `startDate` at `windowStart`."},"endDate":{"type":"string","format":"date","example":"2026-11-02","description":"Last day: the campaign is completed at `endDate` `windowEnd` even if leads are still pending; no call is placed after it."},"days":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6},"description":"Deprecated: weekday list of campaigns created before the period existed; ignored when `startDate`/`endDate` are set."},"startAt":{"type":"string","format":"date-time","description":"Read-only: when a SCHEDULED campaign starts."}},"required":["timezone","windowStart","windowEnd","startDate","endDate"]},"DialingRules":{"type":"object","properties":{"maxAttempts":{"type":"integer","description":"Attempts per number of the lead"},"retryIntervalMin":{"type":"integer"},"maxConcurrency":{"type":"integer"},"phoneRotation":{"type":"string","enum":["CASCADE","SEQUENTIAL"],"description":"Leads with several numbers: CASCADE (default) dials the next number right after an attempt without contact, SEQUENTIAL exhausts each number first"}},"required":["maxAttempts","retryIntervalMin","maxConcurrency"]},"CampaignConfig":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ServiceType"},"audio":{"type":"object","properties":{},"additionalProperties":true},"voicebot":{"type":"object","properties":{},"additionalProperties":true},"aiAgent":{"type":"object","properties":{},"additionalProperties":true}},"required":["type"],"description":"Template payload snapshot: `{ type, audio | voicebot | aiAgent }`. Same shape the web app stores in templates; take one from `GET /templates/{id}`."},"CampaignDraftInput":{"type":"object","properties":{"general":{"type":"object","properties":{"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ServiceType"},"language":{"type":"string","enum":["es","pt-BR","en"]},"description":{"type":"string"},"trunkId":{"type":"string"},"callerId":{"type":"string","description":"DID in E.164, must belong to `trunkId`"},"schedule":{"$ref":"#/components/schemas/Schedule"},"dialingRules":{"$ref":"#/components/schemas/DialingRules"}}},"templateId":{"type":"string","description":"Copy the design from a template…"},"config":{"$ref":"#/components/schemas/CampaignConfig","description":"…or give the design inline."},"leadListId":{"type":"string"}},"required":["general"]},"CampaignLivePatch":{"type":"object","properties":{"trunkId":{"type":"string"},"callerId":{"type":"string","description":"E.164, registered on the trunk"},"dialingRules":{"type":"object","properties":{"maxAttempts":{"type":"integer","minimum":1,"maximum":10},"retryIntervalMin":{"type":"integer","minimum":5,"maximum":1440},"maxConcurrency":{"type":"integer","minimum":1,"maximum":500},"phoneRotation":{"type":"string","enum":["CASCADE","SEQUENTIAL"]}}},"call":{"type":"object","properties":{"dialLevel":{"type":"number","minimum":1,"maximum":10},"adaptive":{"type":"boolean"},"maxDialLevel":{"type":"number","minimum":1,"maximum":10},"maxAbandonRate":{"type":"number","minimum":0,"maximum":0.2}},"description":"CALL campaigns only"}}},"CampaignStats":{"type":"object","properties":{"totalLeads":{"type":"integer"},"pending":{"type":"integer"},"dialed":{"type":"integer"},"answered":{"type":"integer"},"noAnswer":{"type":"integer"},"busy":{"type":"integer"},"voicemail":{"type":"integer"},"failed":{"type":"integer"},"transferred":{"type":"integer"},"byResultCode":{"type":"object","properties":{},"additionalProperties":{"type":"integer"}}}},"Campaign":{"type":"object","properties":{"campaignId":{"type":"string"},"accountId":{"type":"string"},"type":{"$ref":"#/components/schemas/ServiceType"},"name":{"type":"string"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/CampaignStatus"},"language":{"type":"string"},"trunkId":{"type":"string"},"callerId":{"type":"string"},"schedule":{"$ref":"#/components/schemas/Schedule"},"dialingRules":{"$ref":"#/components/schemas/DialingRules"},"leadListId":{"type":"string"},"templateId":{"type":"string"},"config":{"$ref":"#/components/schemas/CampaignConfig"},"stats":{"$ref":"#/components/schemas/CampaignStats"},"estimatedMicros":{"type":"integer"},"consumedMicros":{"type":"integer"},"errorMessage":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"launchedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"}},"required":["campaignId","type","name","status","stats"]},"Estimate":{"type":"object","properties":{"micros":{"type":"integer"},"answeredMicros":{"type":"integer"},"unansweredMicros":{"type":"integer"},"expectedAnsweredCalls":{"type":"integer"},"expectedAttempts":{"type":"integer"},"expectedUnansweredAttempts":{"type":"integer"},"perAnsweredCallMicros":{"type":"integer"},"perUnansweredAttemptMicros":{"type":"integer"},"balanceMicros":{"type":"integer"},"canLaunch":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}}}},"TemplateInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ServiceType"},"name":{"type":"string"},"description":{"type":"string"},"language":{"type":"string","enum":["es","pt-BR","en"]},"payload":{"$ref":"#/components/schemas/CampaignConfig"}},"required":["type","name","language","payload"]},"Template":{"type":"object","properties":{"templateId":{"type":"string"},"type":{"$ref":"#/components/schemas/ServiceType"},"name":{"type":"string"},"description":{"type":"string"},"language":{"type":"string"},"status":{"type":"string","enum":["DRAFT","READY"]},"payload":{"$ref":"#/components/schemas/CampaignConfig"},"variables":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["templateId","type","name"]},"LeadListInput":{"type":"object","properties":{"name":{"type":"string"},"sourceFileKey":{"type":"string","description":"`key` returned by `POST /files/presign`"},"columnMapping":{"type":"object","properties":{},"additionalProperties":{"type":"string"},"description":"file column → `phone` (required), `phone2`…`phone5` (more numbers of the same lead, dialed in order while there is no contact) or a variable name","example":{"telefono":"phone","nombre":"nombre","deuda":"monto"}},"country":{"type":"string","minLength":2,"maxLength":2,"example":"CL"},"consent":{"type":"boolean","enum":[true],"description":"Must be `true`: you declare that you hold the legal basis (consent or lawful purpose) to call every number in the file. Recorded with user and time."}},"required":["name","sourceFileKey","columnMapping","country","consent"]},"LeadList":{"type":"object","properties":{"leadListId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["UPLOADED","PROCESSING","READY","ERROR"]},"totalRows":{"type":"integer"},"validRows":{"type":"integer"},"rejectedRows":{"type":"integer"},"duplicateRows":{"type":"integer"},"columnMapping":{"type":"object","properties":{},"additionalProperties":{"type":"string"}},"variableNames":{"type":"array","items":{"type":"string"}},"progressPct":{"type":"number"},"rejectedFileUrl":{"type":"string"},"createdAt":{"type":"string"}},"required":["leadListId","name","status"]},"Lead":{"type":"object","properties":{"leadId":{"type":"string"},"phoneE164":{"type":"string","description":"Primary number"},"phones":{"type":"array","items":{"type":"string","description":"E.164"}},"name":{"type":"string"},"variables":{"type":"object","properties":{},"additionalProperties":{"type":"string"}},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","DONE","DNC","INVALID"]},"attempts":{"type":"integer"},"lastResult":{"type":"string"}}},"DncEntry":{"type":"object","properties":{"phoneE164":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string","enum":["MANUAL","IMPORT","CALL_RESULT"]},"addedAt":{"type":"string"}}},"CallsSummary":{"type":"object","properties":{"total":{"type":"integer"},"answered":{"type":"integer","description":"ANSWERED + TRANSFERRED"},"transferred":{"type":"integer"},"talkSec":{"type":"integer","description":"Seconds of talk time of the answered calls"},"byDisposition":{"type":"object","properties":{},"additionalProperties":{"type":"integer"}},"byResultCode":{"type":"object","properties":{},"additionalProperties":{"type":"integer"}},"partial":{"type":"boolean","description":"Computed on a bounded sample (fallback mode), not on the whole set"}},"required":["total","answered","transferred","talkSec","byDisposition","byResultCode"]},"Call":{"type":"object","properties":{"callId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"campaignType":{"$ref":"#/components/schemas/ServiceType"},"leadId":{"type":"string"},"leadName":{"type":"string"},"phone":{"type":"string"},"callerId":{"type":"string"},"attemptNo":{"type":"integer"},"state":{"type":"string","enum":["QUEUED","DIALING","IN_CALL","TRANSFERRING","TRANSFERRED","DONE"]},"disposition":{"type":"string","enum":["ANSWERED","NO_ANSWER","BUSY","VOICEMAIL","FAILED","TRANSFERRED"]},"resultCode":{"type":"string"},"durationSec":{"type":"integer"},"billedMicros":{"type":"integer"},"startedAt":{"type":"string"},"endedAt":{"type":"string"},"transferredTo":{"type":"string"},"hasRecording":{"type":"boolean"},"hasTranscript":{"type":"boolean"},"ai":{"type":"object","properties":{"summary":{"type":"string"},"outcome":{"type":"string"},"promise":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"}}},"callback":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"},"notes":{"type":"string"}}},"wrongNumber":{"type":"boolean"},"doNotCall":{"type":"boolean"}}},"variables":{"type":"object","properties":{},"additionalProperties":{"type":"string"}}},"required":["callId","campaignId","phone","attemptNo","state"]},"CallDetail":{"allOf":[{"$ref":"#/components/schemas/Call"},{"type":"object","properties":{"transcript":{"type":"array","items":{"type":"object","properties":{"speaker":{"type":"string","enum":["agent","customer"]},"text":{"type":"string"},"startSec":{"type":"number"},"endSec":{"type":"number"}}}},"recordingUrl":{"type":"string","description":"Pre-signed, valid 5 minutes"},"answers":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"heard":{"type":"string"},"key":{"type":"string"},"option":{"type":"string"}}}},"dtmfEvents":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"atSec":{"type":"number"}}}},"playedComplete":{"type":"boolean"},"attemptsHistory":{"type":"array","items":{"type":"object","properties":{"attemptNo":{"type":"integer"},"startedAt":{"type":"string"},"disposition":{"type":"string"},"durationSec":{"type":"integer"},"resultCode":{"type":"string"}}}}}}]},"ExportJob":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["PENDING","RUNNING","DONE","FAILED"],"description":"`fileUrl` is set once the job is DONE; files stay downloadable for seven days."},"format":{"type":"string","enum":["CSV","XLSX"]},"fileUrl":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"}},"required":["jobId","status","format"]},"EngineCell":{"type":"object","properties":{"cellId":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"egressIps":{"type":"array","items":{"type":"string"}}}},"TrunkInput":{"type":"object","properties":{"name":{"type":"string"},"cellId":{"type":"string"},"ip":{"type":"string"},"port":{"type":"integer","default":5060},"transport":{"type":"string","enum":["udp","tcp","tls"],"default":"udp"},"domain":{"type":"string"},"sipUser":{"type":"string"},"sipPass":{"type":"string"},"prefix":{"type":"string"},"channels":{"type":"integer"},"cps":{"type":"integer"}},"required":["name","ip","channels","cps"]},"SipTrunk":{"type":"object","properties":{"trunkId":{"type":"string"},"name":{"type":"string"},"cellId":{"type":"string"},"ip":{"type":"string"},"port":{"type":"integer"},"transport":{"type":"string"},"domain":{"type":"string"},"sipUser":{"type":"string"},"prefix":{"type":"string"},"channels":{"type":"integer"},"cps":{"type":"integer"},"status":{"type":"string"},"createdAt":{"type":"string"}}},"CallerId":{"type":"object","properties":{"e164":{"type":"string"},"country":{"type":"string"},"label":{"type":"string"},"trunkId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","DISABLED"]}}},"AgentStatus":{"type":"string","enum":["OFFLINE","AVAILABLE","RINGING","BUSY","WRAP_UP","PAUSED"]},"AgentPauseReason":{"type":"string","enum":["BREAK","LUNCH","TRAINING","MEETING","ADMIN","NO_ANSWER","SUPERVISOR","OTHER"]},"AgentInput":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"extension":{"type":"string"},"cellId":{"type":"string"}},"required":["name","email"]},"AgentPatch":{"type":"object","properties":{"name":{"type":"string"},"extension":{"type":"string"},"cellId":{"type":"string"}}},"Agent":{"type":"object","properties":{"agentId":{"type":"string","example":"ag-7k2pq9"},"name":{"type":"string"},"email":{"type":"string"},"extension":{"type":"string"},"cellId":{"type":"string"},"userId":{"type":"string"},"userStatus":{"type":"string","enum":["INVITED","ACTIVE","DISABLED"]},"status":{"$ref":"#/components/schemas/AgentStatus"},"statusAt":{"type":"string","format":"date-time"},"pauseReason":{"$ref":"#/components/schemas/AgentPauseReason"},"campaignId":{"type":"string","description":"Campaign (queue) the agent joined"},"currentCall":{"type":"object","properties":{"phone":{"type":"string"},"direction":{"type":"string","enum":["INBOUND","OUTBOUND","TRANSFER"]},"campaignId":{"type":"string"},"transactionId":{"type":"string"},"startedAt":{"type":"string","format":"date-time"}}},"lastCall":{"type":"object","properties":{"transactionId":{"type":"string"},"phone":{"type":"string"},"campaignId":{"type":"string"},"endedAt":{"type":"string","format":"date-time"},"talkSec":{"type":"integer"}}},"today":{"type":"object","properties":{"date":{"type":"string"},"calls":{"type":"integer"},"talkSec":{"type":"integer"},"wrapUpSec":{"type":"integer"},"pauseSec":{"type":"integer"}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["agentId","name","email","status"]},"AgentSessionToken":{"type":"object","properties":{"token":{"type":"string","example":"vxa_live_…"},"agentId":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"embedUrl":{"type":"string","description":"Page to frame in the CRM (`<iframe allow=\"microphone; autoplay\">`); the loader script is served next to it at `/embed/voxcore-agent.js`"}},"required":["token","agentId","expiresAt","embedUrl"]},"LedgerEntry":{"type":"object","properties":{"entryId":{"type":"string"},"kind":{"type":"string","enum":["PURCHASE","CONSUMPTION","ADJUSTMENT","REFUND","BONUS"]},"amountMicros":{"type":"integer"},"balanceAfterMicros":{"type":"integer"},"ref":{"type":"string"},"description":{"type":"string"},"createdAt":{"type":"string"}}},"Payment":{"type":"object","properties":{"paymentId":{"type":"string"},"packageId":{"type":"string"},"packageName":{"type":"string"},"amountUsd":{"type":"number"},"currency":{"type":"string"},"creditedMicros":{"type":"integer"},"bonusUsd":{"type":"number"},"status":{"type":"string","enum":["PENDING","PAID","FAILED","REFUNDED"]},"method":{"type":"string"},"receiptUrl":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"CreditPackage":{"type":"object","properties":{"packageId":{"type":"string"},"name":{"type":"string"},"priceUsd":{"type":"number"},"creditsUsd":{"type":"number"},"bonusUsd":{"type":"number"},"active":{"type":"boolean"}}},"Webhook":{"type":"object","properties":{"webhookId":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","campaign.started","campaign.completed","campaign.paused","campaign.status_changed","lead_list.processed","balance.low","credits.low","payment.succeeded"]}},"status":{"type":"string"},"createdAt":{"type":"string"}}},"ApiKeyInput":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"expiresAt":{"type":"string","format":"date-time"},"rateLimitPerMin":{"type":"integer","minimum":10,"maximum":6000,"default":600}},"required":["name","scopes"]},"ApiKey":{"type":"object","properties":{"keyId":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","example":"vx_live_AbC1"},"last4":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"status":{"type":"string","enum":["ACTIVE","REVOKED"]},"rateLimitPerMin":{"type":"integer"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string"},"expiresAt":{"type":"string"},"revokedAt":{"type":"string"}},"required":["keyId","name","prefix","last4","scopes","status"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","description":"Unique delivery id (also in the X-Voxcore-Delivery header); use it to drop duplicates."},"type":{"type":"string","enum":["call.completed","campaign.started","campaign.completed","campaign.paused","campaign.status_changed","lead_list.processed","balance.low","credits.low","payment.succeeded"]},"time":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{},"additionalProperties":true,"description":"Event payload; see x-webhooks for the shape of each event."}},"required":["id","type","time","data"],"description":"Body of every webhook POST. Verify `X-Voxcore-Signature` = `sha256=` + hex(HMAC-SHA256(secret, raw body))."},"WebhookCallCompleted":{"type":"object","properties":{"callId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"campaignType":{"$ref":"#/components/schemas/ServiceType"},"leadId":{"type":"string"},"leadName":{"type":"string"},"phone":{"type":"string","description":"E.164"},"callerId":{"type":"string"},"attemptNo":{"type":"integer"},"disposition":{"type":"string","enum":["ANSWERED","NO_ANSWER","BUSY","VOICEMAIL","FAILED","TRANSFERRED"]},"resultCode":{"type":"string","description":"Result code of the design (DTMF key, voicebot option or agent outcome), if any"},"durationSec":{"type":"integer"},"billedMicros":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"},"transferredTo":{"type":"string"},"hasRecording":{"type":"boolean"},"hasTranscript":{"type":"boolean"},"ai":{"type":"object","properties":{"summary":{"type":"string"},"outcome":{"type":"string"},"promise":{"type":"object","properties":{"amount":{"type":"number"},"date":{"type":"string"}}},"callback":{"type":"object","properties":{"date":{"type":"string"},"time":{"type":"string"},"notes":{"type":"string"}}},"wrongNumber":{"type":"boolean"},"doNotCall":{"type":"boolean"}},"description":"Only for the conversational AI agent"},"variables":{"type":"object","properties":{},"additionalProperties":{"type":"string"},"description":"Every column of the lead file except the phone"},"doNotCall":{"type":"boolean","description":"The callee asked not to be called again; the number was added to the DNC list"}},"required":["callId","campaignId","campaignType","leadId","phone","attemptNo","disposition","durationSec","billedMicros","startedAt","doNotCall"]},"WebhookCampaignStatusChanged":{"type":"object","properties":{"campaignId":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ServiceType"},"from":{"$ref":"#/components/schemas/CampaignStatus"},"to":{"$ref":"#/components/schemas/CampaignStatus"},"actor":{"type":"string","description":"`system`, `stripe`, `scheduler` or the user/API key that triggered it"},"pausedReason":{"type":"string","enum":["USER","NO_BALANCE"],"description":"Only when `to` is PAUSED"},"stats":{"$ref":"#/components/schemas/CampaignStats"},"consumedMicros":{"type":"integer"},"launchedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"}},"required":["campaignId","name","type","from","to","actor","stats","consumedMicros"]},"WebhookLeadListProcessed":{"type":"object","properties":{"leadListId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["READY"]},"totalRows":{"type":"integer"},"validRows":{"type":"integer"},"rejectedRows":{"type":"integer"},"duplicateRows":{"type":"integer"},"variableNames":{"type":"array","items":{"type":"string"}}},"required":["leadListId","name","status","totalRows","validRows","rejectedRows","duplicateRows"]},"WebhookBalanceLow":{"type":"object","properties":{"balanceMicros":{"type":"integer"},"thresholdMicros":{"type":"integer","description":"Threshold configured on the account"}},"required":["balanceMicros","thresholdMicros"]},"WebhookPaymentSucceeded":{"type":"object","properties":{"paymentId":{"type":"string"},"packageId":{"type":"string"},"packageName":{"type":"string"},"amountUsd":{"type":"number"},"currency":{"type":"string"},"bonusUsd":{"type":"number"},"creditedMicros":{"type":"integer"},"method":{"type":"string","description":"lemonsqueezy, card, pix, oxxo…"},"receiptUrl":{"type":"string","description":"Receipt of the payment gateway, when available"}},"required":["paymentId","amountUsd","creditedMicros"]}}},"x-webhooks":{"call.completed":{"summary":"A billable call attempt ended","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["call.completed"]},"data":{"$ref":"#/components/schemas/WebhookCallCompleted"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookCallCompleted"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"call.completed","time":"2026-10-01T14:03:11.412Z","data":{"callId":"acc-x1-cmp-a2-ld9-1","campaignId":"cmp-a2","campaignName":"Cobranza octubre","campaignType":"AI_AGENT","leadId":"ld9","leadName":"Ana Pérez","phone":"+56912345678","callerId":"+56229876543","attemptNo":1,"disposition":"ANSWERED","resultCode":"PROMISE","durationSec":74,"billedMicros":74000,"startedAt":"2026-10-01T14:01:52.000Z","endedAt":"2026-10-01T14:03:06.000Z","hasRecording":true,"hasTranscript":true,"ai":{"summary":"La cliente reconoce la deuda y se compromete a pagar el 5 de octubre.","outcome":"PROMISE","promise":{"amount":45000,"date":"2026-10-05"},"wrongNumber":false,"doNotCall":false},"variables":{"nombre":"Ana Pérez","monto":"45000","rut":"12.345.678-9"},"doNotCall":false}}},"campaign.status_changed":{"summary":"A campaign changed status","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["campaign.status_changed"]},"data":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"campaign.status_changed","time":"2026-10-01T14:03:11.412Z","data":{"campaignId":"cmp-a2","name":"Cobranza octubre","type":"AI_AGENT","from":"RUNNING","to":"PAUSED","actor":"usr-7k2p","pausedReason":"USER","stats":{"totalLeads":1200,"pending":640,"dialed":830,"answered":210,"noAnswer":480,"busy":90,"voicemail":30,"failed":20,"transferred":0,"byResultCode":{"PROMISE":120,"REFUSED":60,"CALLBACK":30}},"consumedMicros":18450000,"launchedAt":"2026-10-01T12:00:03.000Z"}}},"campaign.started":{"summary":"A campaign started running (from DRAFT or SCHEDULED)","x-alias-of":"campaign.status_changed","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["campaign.started"]},"data":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"campaign.started","time":"2026-10-01T14:03:11.412Z","data":{"campaignId":"cmp-a2","name":"Cobranza octubre","type":"AI_AGENT","from":"DRAFT","to":"RUNNING","actor":"usr-7k2p","stats":{"totalLeads":1200,"pending":640,"dialed":830,"answered":210,"noAnswer":480,"busy":90,"voicemail":30,"failed":20,"transferred":0,"byResultCode":{"PROMISE":120,"REFUSED":60,"CALLBACK":30}},"consumedMicros":18450000,"launchedAt":"2026-10-01T12:00:03.000Z"}}},"campaign.completed":{"summary":"A campaign finished all its leads","x-alias-of":"campaign.status_changed","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["campaign.completed"]},"data":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"campaign.completed","time":"2026-10-01T14:03:11.412Z","data":{"campaignId":"cmp-a2","name":"Cobranza octubre","type":"AI_AGENT","from":"RUNNING","to":"COMPLETED","actor":"usr-7k2p","stats":{"totalLeads":1200,"pending":640,"dialed":830,"answered":210,"noAnswer":480,"busy":90,"voicemail":30,"failed":20,"transferred":0,"byResultCode":{"PROMISE":120,"REFUSED":60,"CALLBACK":30}},"consumedMicros":18450000,"launchedAt":"2026-10-01T12:00:03.000Z","completedAt":"2026-10-03T19:40:00.000Z"}}},"campaign.paused":{"summary":"A campaign was paused (by the user or for lack of balance)","x-alias-of":"campaign.status_changed","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["campaign.paused"]},"data":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookCampaignStatusChanged"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"campaign.paused","time":"2026-10-01T14:03:11.412Z","data":{"campaignId":"cmp-a2","name":"Cobranza octubre","type":"AI_AGENT","from":"RUNNING","to":"PAUSED","actor":"usr-7k2p","pausedReason":"USER","stats":{"totalLeads":1200,"pending":640,"dialed":830,"answered":210,"noAnswer":480,"busy":90,"voicemail":30,"failed":20,"transferred":0,"byResultCode":{"PROMISE":120,"REFUSED":60,"CALLBACK":30}},"consumedMicros":18450000,"launchedAt":"2026-10-01T12:00:03.000Z"}}},"lead_list.processed":{"summary":"An uploaded lead list finished processing","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["lead_list.processed"]},"data":{"$ref":"#/components/schemas/WebhookLeadListProcessed"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookLeadListProcessed"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"lead_list.processed","time":"2026-10-01T14:03:11.412Z","data":{"leadListId":"lst-9q1m","name":"Deudores octubre","status":"READY","totalRows":1250,"validRows":1200,"rejectedRows":38,"duplicateRows":12,"variableNames":["nombre","monto","rut"]}}},"balance.low":{"summary":"The balance crossed below the account threshold","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["balance.low"]},"data":{"$ref":"#/components/schemas/WebhookBalanceLow"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookBalanceLow"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"balance.low","time":"2026-10-01T14:03:11.412Z","data":{"balanceMicros":4800000,"thresholdMicros":5000000}}},"credits.low":{"summary":"Alias of balance.low","x-alias-of":"balance.low","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["credits.low"]},"data":{"$ref":"#/components/schemas/WebhookBalanceLow"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookBalanceLow"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"credits.low","time":"2026-10-01T14:03:11.412Z","data":{"balanceMicros":4800000,"thresholdMicros":5000000}}},"payment.succeeded":{"summary":"A top-up was credited","post":{"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookDelivery"},{"type":"object","properties":{"type":{"type":"string","enum":["payment.succeeded"]},"data":{"$ref":"#/components/schemas/WebhookPaymentSucceeded"}}}]}}}},"responses":{"2xx":{"description":"Acknowledged. Any other status (or no answer within 8 s) is retried up to 3 times."}}},"x-data-schema":{"$ref":"#/components/schemas/WebhookPaymentSucceeded"},"x-example":{"id":"evt-3f9c1a7e-8b2d-4c11-9e4f-2a7b6d5c8e01","type":"payment.succeeded","time":"2026-10-01T14:03:11.412Z","data":{"paymentId":"pay-ls-1234567","packageId":"pkg-100","packageName":"US$ 100","amountUsd":100,"currency":"usd","bonusUsd":5,"creditedMicros":105000000,"method":"lemonsqueezy","receiptUrl":"https://app.lemonsqueezy.com/my-orders/…"}}}}}