{"openapi":"3.0.3","info":{"title":"PacketExchange API (developer subset)","description":"The PacketExchange REST API, developer subset: SMS, voice calls, the Verify API, phone numbers, route search and pricing, balance and webhooks. Generated from the same source as the full specification, so the operations here are identical to their full-spec entries.\n\nFull specification (every published operation, including the Switch, dialer and seller tools): https://packetexchange.io/openapi.json. Human reference: https://packetexchange.io/api-docs. Agent index: https://packetexchange.io/llms.txt. MCP server: https://packetexchange.io/mcp/http.\n\n## Authentication\nSend `Authorization: Bearer <api key>`, using an API key (`px_live_sk_...` live, `px_test_sk_...` test; keys issued before 18 Nov 2026 start `wmmn_live_sk_` / `wmmn_test_sk_` and keep working) created in the dashboard under **API keys**. Some account-management operations are **session-only** and refuse API keys; each operation states its access rule and, for scoped keys, the scope it needs.\n\n## Envelope\nSuccess: `{ \"success\": true, \"data\": ... }` (list endpoints may add `nextCursor` and `hasMore`). Failure: `{ \"success\": false, \"error\": { \"code\", \"message\", \"details\" } }`. For `VALIDATION_ERROR`, `details` is an array of `{ path, message }`.\n\n## Money\nEvery ledger amount is US dollars as a decimal **string** with exactly 6 places (`\"0.012500\"`). Voice prices are per minute; SMS prices are per message segment.\n\n## Rate limits\nDefault: 100 requests per second per caller (API key, session or IP address). Operations with a tighter limit state it, generated from the route's own configuration. A 429 carries `Retry-After`.\n\n## Request ids\nEvery response carries `X-Request-Id` (a UUID). Quote it when contacting support.\n\n## Errors\nEvery error is `{ \"success\": false, \"error\": { \"code\", \"message\", \"details\" } }`. The codes this subset can return are listed in `x-error-codes`.\n\n## Webhooks\nEvents are delivered as the `WebhookEvent` schema in components. Register endpoints with POST /account/webhooks.","version":"1.3.0"},"servers":[{"url":"https://packetexchange.io","description":"Production"}],"externalDocs":{"description":"Full OpenAPI specification","url":"https://packetexchange.io/openapi.json"},"tags":[{"name":"Account and balance"},{"name":"SMS"},{"name":"Voice calls"},{"name":"Verify"},{"name":"Phone numbers"},{"name":"Routes, marketplace and pricing"},{"name":"Webhooks"}],"x-error-codes":[{"code":"VALIDATION_ERROR","status":400,"meaning":"The body, query or path failed validation, or a business rule refused the input. Insufficient balance for a billable action is also reported this way, with a message that starts \"Insufficient balance\".","details":"An array of { path, message }, one per failing field. A business-rule refusal usually carries only the message; a few attach an object instead (Switch trunk activation sends { code: \"TRUNK_NOT_READY\", blockers: [...] })."},{"code":"INVALID_INPUT","status":400,"meaning":"A value passed validation but is not in a storable format, most often a malformed id (not a UUID) in the path or query, a number out of range, or text containing characters that cannot be stored (for example a NUL byte)."},{"code":"BAD_REQUEST","status":400,"meaning":"The request could not be parsed, for example malformed JSON or an unsupported content type."},{"code":"UNAUTHORIZED","status":401,"meaning":"No credential, or the token or API key is invalid, expired or revoked."},{"code":"FORBIDDEN","status":403,"meaning":"Authenticated but not allowed. For a scoped API key the message names the missing scope (\"API key missing required scope: sms:send\"); session-only endpoints answer \"This action requires an interactive session (dashboard login), not an API key.\""},{"code":"TEST_KEY_NOT_ALLOWED","status":403,"meaning":"A test key (px_test_sk_, or wmmn_test_sk_ for keys issued before 18 Nov 2026) asked for something that has no test mode: a Switch change (any non-GET request under /switch) or an x402 top-up, which settles real USDC into the live balance. Use a live key. Test keys may still read Switch data."},{"code":"KYC_REQUIRED","status":403,"meaning":"The action needs a verified identity first (Account > Verification)."},{"code":"NUMBER_APPROVAL_REQUIRED","status":403,"meaning":"Phone numbers need our approval before purchase. File a request with POST /dids/requests (with a `justification`) instead of buying directly; you are emailed when it is decided."},{"code":"REAUTH_REQUIRED","status":403,"meaning":"Creating an API key, requesting a payout, changing the payout destination and turning on 2FA need the account password (or, with 2FA on, an authenticator code) in the body as `password` or `totp`. Session only.","details":"{ totpEnabled } so a client knows whether to offer the code option."},{"code":"REAUTH_FAILED","status":403,"meaning":"The `password` or `totp` sent to confirm a sensitive action was not right.","details":"{ totpEnabled }"},{"code":"NOT_FOUND","status":404,"meaning":"The resource does not exist, or it is not visible to your account."},{"code":"CONFLICT","status":409,"meaning":"The record already exists, is referenced elsewhere, or a request with the same X-Idempotency-Key is still in progress."},{"code":"PROXY_POOL_FULL","status":409,"meaning":"The shared residential proxy capacity cannot take an order this size right now. Nothing was charged. Try a smaller amount, or contact support."},{"code":"VALIDATION_ERROR","status":422,"meaning":"An X-Idempotency-Key was reused with a different request body. Use a fresh key for a different request."},{"code":"RATE_LIMITED","status":429,"meaning":"Too many requests. Wait for the number of seconds in the Retry-After header, then retry."},{"code":"INTERNAL_ERROR","status":500,"meaning":"An unexpected server error. It has been logged; quote the X-Request-Id header when contacting support."},{"code":"UPSTREAM_ERROR","status":502,"meaning":"A service we depend on failed. Retry shortly."},{"code":"PROXY_ORDER_FAILED","status":502,"meaning":"A residential proxy order could not be placed. The amount was returned to your balance in full, and the message says what to do next."},{"code":"SERVICE_UNAVAILABLE","status":503,"meaning":"Temporarily unavailable. Retry with backoff."},{"code":"PROXIES_NOT_ON_SALE","status":503,"meaning":"Residential proxy orders and quotes cannot be taken right now. Nothing was charged. GET /proxies/status reports onSale as true once they can."},{"code":"PROXY_COUNTRIES_UNAVAILABLE","status":503,"meaning":"The residential proxy country list could not be loaded, so a country-locked order was not placed. Nothing was charged. Retry, or order Worldwide."}],"x-rate-limit-default":{"max":100,"window":"1 second"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"An API key, as `Authorization: Bearer <api key>`."},"apiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"An API key as the Authorization header value, with or without the `Bearer ` prefix."}},"schemas":{"Money":{"type":"string","pattern":"^-?\\d+\\.\\d{6}$","description":"US dollars as a decimal string with exactly 6 decimal places, e.g. \"0.012500\". Do money arithmetic with a decimal type, not floating point."},"ValidationIssue":{"type":"object","properties":{"path":{"type":"string","description":"Dot-joined path of the offending field (\"\" for the whole body)"},"message":{"type":"string"}},"required":["path","message"]},"Error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code; see the error-code reference"},"message":{"type":"string","description":"Human-readable explanation, safe to show to an operator"},"details":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"}},{"type":"object","additionalProperties":{}}],"description":"VALIDATION_ERROR: an array of { path, message }. Some codes attach a code-specific object. Usually absent otherwise."}},"required":["code","message"]},"ErrorEnvelope":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"$ref":"#/components/schemas/Error"}},"required":["success","error"]},"AccountProfile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"contactName":{"type":"string"},"companyName":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"country":{"type":"string","nullable":true,"description":"ISO-3166-1 alpha-2"},"timezone":{"type":"string"},"companyLogoUrl":{"type":"string","nullable":true},"avatarUrl":{"type":"string","nullable":true},"role":{"type":"string","enum":["user","admin"]},"status":{"type":"string","enum":["active","suspended"]},"accountKind":{"type":"string"},"balance":{"$ref":"#/components/schemas/Money"},"testCredit":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Sandbox credit, spendable only by test API keys"},"emailVerifiedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"pendingEmail":{"type":"string","nullable":true,"description":"An address change waiting for confirmation"},"verificationStatus":{"type":"string","enum":["unverified","verified"]},"kycStatus":{"type":"string","enum":["not_started","pending","verified","rejected"]},"totpEnabled":{"type":"boolean","description":"Two-factor authentication is on"},"taxId":{"type":"string","nullable":true},"taxCountry":{"type":"string","nullable":true},"payoutMethod":{"type":"string","nullable":true},"onboardingGoal":{"type":"string","nullable":true},"onboardingDismissed":{"type":"boolean"},"onboardingSeen":{"type":"boolean"},"emailNotificationsOptOut":{"type":"boolean"},"switchStatus":{"type":"string","enum":["none","active","past_due","canceled","comp"]},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["id","email","contactName","companyName","jobTitle","phone","country","timezone","companyLogoUrl","avatarUrl","role","status","accountKind","balance","testCredit","emailVerifiedAt","pendingEmail","verificationStatus","kycStatus","totpEnabled","taxId","taxCountry","payoutMethod","onboardingGoal","onboardingDismissed","onboardingSeen","emailNotificationsOptOut","switchStatus","createdAt","updatedAt"],"additionalProperties":true},"AccountBalance":{"type":"object","properties":{"balance":{"$ref":"#/components/schemas/Money"},"testCredit":{"$ref":"#/components/schemas/Money"},"total":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"balance + testCredit"}},"required":["balance","testCredit","total"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secretLast4":{"type":"string","description":"Last 4 characters of the signing secret, to tell secrets apart"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"]}},"isActive":{"type":"boolean","description":"False when you disabled it, or after sustained delivery failures"},"failureCount":{"type":"integer","description":"Consecutive failed deliveries; resets on success"},"lastDeliveryAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["id","url","secretLast4","events","isActive","failureCount","lastDeliveryAt","createdAt","updatedAt"]},"WebhookWithSecret":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secretLast4":{"type":"string","description":"Last 4 characters of the signing secret, to tell secrets apart"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"]}},"isActive":{"type":"boolean","description":"False when you disabled it, or after sustained delivery failures"},"failureCount":{"type":"integer","description":"Consecutive failed deliveries; resets on success"},"lastDeliveryAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"secret":{"type":"string","description":"The signing secret. Returned ONCE; store it now."}},"required":["id","url","secretLast4","events","isActive","failureCount","lastDeliveryAt","createdAt","updatedAt","secret"]},"MeasuredRouteQuality":{"type":"object","properties":{"window":{"type":"string","enum":["7d","30d","last"],"description":"Evidence window: the last 7 days if enough, else the last 30, else `last` = the most recent 30-day stretch that had enough"},"from":{"type":"string","description":"First UTC day of the evidence, YYYY-MM-DD"},"to":{"type":"string","description":"Last UTC day of the evidence, YYYY-MM-DD"},"sessions":{"type":"integer","description":"Call attempts on this listing the figures are built from (at least 50). For anonymous callers, floored to a band (50, 100, 250, 500, 1000, 5000, ...) with `sessionsBanded: true`"},"sessionsBanded":{"type":"boolean","description":"True when `sessions` is a band floor (anonymous callers)"},"buyers":{"type":"integer","nullable":true,"description":"Distinct buying accounts behind the figures (at least 2). Null for anonymous callers"},"asr":{"type":"number","nullable":true,"description":"Answer-seizure ratio %: answered attempts / attempts"},"acd":{"type":"number","nullable":true,"description":"Average call duration of answered attempts, seconds of talk time"},"ner":{"type":"number","nullable":true,"description":"Network effectiveness ratio %: attempts the network delivered to the handset (answered, user busy, no answer, callee rejected) / attempts"},"pddMs":{"type":"integer","nullable":true,"description":"Median post-dial delay in milliseconds (to the nearest 100 ms); null when not captured"}},"required":["window","from","to","sessions","buyers","asr","acd","ner","pddMs"],"description":"Measured from real buyer calls on this listing. Excludes platform probes and route checks, test calls, the seller's own traffic, calls our platform refused before dialling and billing-excluded calls. A call that failed over counts once on each route it tried. Null unless the window holds at least 50 attempts from at least 2 buyers."},"RouteCheckRecord":{"type":"object","properties":{"total":{"type":"integer","description":"Route checks in the last 7 days that count towards the listing's health (calls to registered test lines)"},"answered":{"type":"integer","description":"Of those, how many the test line answered through this route"},"lastAt":{"type":"string","format":"date-time","description":"When the last check completed","nullable":true},"lastResult":{"type":"string","nullable":true,"description":"The last check's verdict: working, no_capacity or not_delivered"}},"required":["total","answered","lastAt","lastResult"],"description":"Route checks on this listing in the last 7 days. Null when there were none."},"MarketplaceSellerProfile":{"type":"object","properties":{"verified":{"type":"boolean","description":"Seller identity verified"},"sellerScore":{"type":"integer","nullable":true,"description":"Average Exchange Score across the seller's trafficked routes"}},"required":["verified","sellerScore"],"description":"Trust signals only. The marketplace never names the seller behind a listing."},"MarketplaceRoute":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["single","blend"]},"type":{"type":"string","enum":["voice","sms"]},"country":{"type":"string"},"countryCode":{"type":"string","description":"E.164 country calling code, digits only"},"prefix":{"type":"array","items":{"type":"string"},"description":"Dial prefixes the route covers"},"destinationName":{"type":"string","description":"The listing name. For anyone but the seller it is GENERATED by the platform from its own data, never the seller's text: \"<Country> <Operator?> <Mobile|Fixed|All Networks>\" for one destination (e.g. \"Niger Mobile\", \"Kenya Safaricom Mobile\"), \"A-Z Voice · <tier> · <CLI> · Ref XXXX\" or \"A-Z SMS · <quality> · Ref XXXX\" for an A-Z bundle. The seller sees the name they gave it."},"cliType":{"type":"string","enum":["full_cli","ncli","partial_cli","local_cli","mixed_cli"]},"routeType":{"type":"string","enum":["direct","premium","standard","ncli"],"description":"Quality tier"},"pricePerUnit":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"USD per minute (voice) or per message segment (SMS). On an A-Z deck (rateCount > 0) the per-destination rates apply instead."},"billingIncrement":{"type":"string","nullable":true,"description":"First/subsequent increment in seconds, e.g. \"60/60\""},"capacity":{"type":"integer","description":"Channels (voice) or messages per second (SMS)"},"expectedAsr":{"type":"string","nullable":true,"description":"Seller-stated ASR %. The measured figure is in `measured.asr`"},"expectedAcd":{"type":"string","nullable":true,"description":"Seller-stated ACD in seconds"},"expectedPdd":{"type":"string","nullable":true,"description":"Seller-stated PDD in seconds"},"minAcd":{"type":"integer","nullable":true},"minAsr":{"type":"string","nullable":true,"description":"Decimal as a string, e.g. \"92.50\""},"visibility":{"type":"string","enum":["public","private"]},"status":{"type":"string","enum":["active","paused","suspended","pending_review"]},"wholesaleCompatible":{"type":"boolean"},"callcenterCompatible":{"type":"boolean"},"dialerCompatible":{"type":"boolean"},"retailCompatible":{"type":"boolean"},"otpCompatible":{"type":"boolean"},"notes":{"type":"string","nullable":true},"smsType":{"type":"string","enum":["a2p","p2p","both"],"nullable":true},"exchangeScore":{"type":"integer","nullable":true,"description":"Exchange Score 1-100, null until the route has carried real traffic. Uses the measured ASR, NER, ACD and PDD in place of the stated ones when the listing has recent measured figures"},"lastQcAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"measured":{"allOf":[{"$ref":"#/components/schemas/MeasuredRouteQuality"}],"nullable":true,"description":"Measured quality from real calls; null until the listing has enough traffic from enough buyers"},"routeChecks":{"allOf":[{"$ref":"#/components/schemas/RouteCheckRecord"}],"nullable":true,"description":"Route checks on this listing in the last 7 days. Null when there were none."},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"isOwn":{"type":"boolean","description":"True only on your own listings"},"listingRef":{"type":"string","description":"Anonymous short reference of the listing (4 characters, e.g. \"7K2Q\"): stable for the life of the listing, unique enough to tell two same-named listings apart, and derived from the listing alone (it says nothing about the seller). Absent on your own listings."},"sellerProfile":{"allOf":[{"$ref":"#/components/schemas/MarketplaceSellerProfile"}],"nullable":true,"description":"Trust signals only. The marketplace never names the seller behind a listing."},"rateCount":{"type":"integer","description":"Active per-destination deck rows; > 0 means an A-Z deck"},"priceTrend":{"type":"object","properties":{"changePct":{"type":"number"},"points":{"type":"array","items":{"type":"number"}}},"required":["changePct","points"],"nullable":true,"description":"Real 24h price movement from the price history; null when the route has not repriced"},"verification":{"type":"string","enum":["cli","ncli","connected","not_verified"],"nullable":true,"description":"Verification tier, measured by the platform on any network of the route: `cli` = International CLI (our international caller-ID test showed the exact number we sent, in full), `ncli` = NCLI (the test reached the phone with a different number or none), `connected` = Qualified (a real answered call or a passed test, no caller-ID result), `not_verified` = Untested (not tested by us yet, or the latest test failed; new listings start here). A route keeps its tier until newer evidence fails it. The values are stable keys; the names in brackets are what the marketplace shows. Every tier is listed and buyable. null on SMS routes."},"originPolicy":{"type":"string","enum":["any","dual","origin_only"],"description":"Caller ID origin, declared by the seller (separate from the verification tier). `any` = one price for every call. `dual` = two prices: the origin-group price for a call presenting a VALID caller ID from `originGroup` (judged on the caller ID the seller receives, in From and P-Asserted-Identity), and `pricePerUnit` / the deck rate for every other call (another country, no caller ID, or an invalid one). `origin_only` = carried only for caller IDs from `originGroup`; other calls go to the buyer's next route."},"originGroup":{"type":"string","nullable":true,"description":"Origin group key, e.g. `EEA` (the 27 EU countries, Iceland, Liechtenstein, Norway); null when `originPolicy` is `any`"},"originPricing":{"type":"object","properties":{"policy":{"type":"string","enum":["dual","origin_only"]},"group":{"type":"string"},"originFrom":{"type":"number","nullable":true,"description":"Lowest price for a call with a valid caller ID from the group"},"internationalFrom":{"type":"number","nullable":true,"description":"Lowest price for every other call"},"basis":{"type":"string","description":"The rule in one plain sentence"}},"required":["policy","group","originFrom","internationalFrom","basis"],"nullable":true,"description":"Caller ID origin prices; null on a one-price route"}},"required":["id","kind","type","country","countryCode","prefix","destinationName","cliType","routeType","pricePerUnit","billingIncrement","capacity","expectedAsr","expectedAcd","expectedPdd","minAcd","minAsr","visibility","status","wholesaleCompatible","callcenterCompatible","dialerCompatible","retailCompatible","otpCompatible","notes","exchangeScore","lastQcAt","createdAt","updatedAt","isOwn","sellerProfile","rateCount","verification"],"description":"A route as a buyer sees it: no seller identity, endpoints or credentials."},"OwnRoute":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["single","blend"]},"type":{"type":"string","enum":["voice","sms"]},"country":{"type":"string"},"countryCode":{"type":"string","description":"E.164 country calling code, digits only"},"prefix":{"type":"array","items":{"type":"string"},"description":"Dial prefixes the route covers"},"destinationName":{"type":"string","description":"The listing name. For anyone but the seller it is GENERATED by the platform from its own data, never the seller's text: \"<Country> <Operator?> <Mobile|Fixed|All Networks>\" for one destination (e.g. \"Niger Mobile\", \"Kenya Safaricom Mobile\"), \"A-Z Voice · <tier> · <CLI> · Ref XXXX\" or \"A-Z SMS · <quality> · Ref XXXX\" for an A-Z bundle. The seller sees the name they gave it."},"cliType":{"type":"string","enum":["full_cli","ncli","partial_cli","local_cli","mixed_cli"]},"routeType":{"type":"string","enum":["direct","premium","standard","ncli"],"description":"Quality tier"},"pricePerUnit":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"USD per minute (voice) or per message segment (SMS). On an A-Z deck (rateCount > 0) the per-destination rates apply instead."},"billingIncrement":{"type":"string","nullable":true,"description":"First/subsequent increment in seconds, e.g. \"60/60\""},"capacity":{"type":"integer","description":"Channels (voice) or messages per second (SMS)"},"expectedAsr":{"type":"string","nullable":true,"description":"Seller-stated ASR %. The measured figure is in `measured.asr`"},"expectedAcd":{"type":"string","nullable":true,"description":"Seller-stated ACD in seconds"},"expectedPdd":{"type":"string","nullable":true,"description":"Seller-stated PDD in seconds"},"minAcd":{"type":"integer","nullable":true},"minAsr":{"type":"string","nullable":true,"description":"Decimal as a string, e.g. \"92.50\""},"visibility":{"type":"string","enum":["public","private"]},"status":{"type":"string","enum":["active","paused","suspended","pending_review"]},"wholesaleCompatible":{"type":"boolean"},"callcenterCompatible":{"type":"boolean"},"dialerCompatible":{"type":"boolean"},"retailCompatible":{"type":"boolean"},"otpCompatible":{"type":"boolean"},"notes":{"type":"string","nullable":true},"smsType":{"type":"string","enum":["a2p","p2p","both"],"nullable":true},"exchangeScore":{"type":"integer","nullable":true,"description":"Exchange Score 1-100, null until the route has carried real traffic. Uses the measured ASR, NER, ACD and PDD in place of the stated ones when the listing has recent measured figures"},"lastQcAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"measured":{"allOf":[{"$ref":"#/components/schemas/MeasuredRouteQuality"}],"nullable":true,"description":"Measured quality from real calls; null until the listing has enough traffic from enough buyers"},"routeChecks":{"allOf":[{"$ref":"#/components/schemas/RouteCheckRecord"}],"nullable":true,"description":"Route checks on this listing in the last 7 days. Null when there were none."},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"isOwner":{"type":"boolean","enum":[true]},"parentRouteId":{"type":"string","format":"uuid","nullable":true},"isBundle":{"type":"boolean"},"sipPort":{"type":"integer","nullable":true},"techPrefix":{"type":"string","nullable":true},"sipAuthUsername":{"type":"string","nullable":true},"sipAuthPasswordSet":{"type":"boolean","description":"A SIP digest password is stored (never returned)"},"smsDeliveryMethod":{"type":"string","enum":["http","smpp","http_form"],"nullable":true},"smsDeliveryUrl":{"type":"string","nullable":true},"smppHost":{"type":"string","nullable":true},"smppPort":{"type":"integer","nullable":true},"smppSystemId":{"type":"string","nullable":true},"smppPasswordSet":{"type":"boolean","description":"An SMPP password, or on an http_form route the API key, is stored (never returned)"},"endpointReachable":{"type":"boolean","nullable":true},"endpointCheckedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"sellerProfile":{"allOf":[{"$ref":"#/components/schemas/MarketplaceSellerProfile"}],"nullable":true,"description":"Trust signals only. The marketplace never names the seller behind a listing."},"rateCount":{"type":"integer"},"sipHost":{"type":"string","nullable":true,"description":"Your SIP endpoint"}},"required":["id","kind","type","country","countryCode","prefix","destinationName","cliType","routeType","pricePerUnit","billingIncrement","capacity","expectedAsr","expectedAcd","expectedPdd","minAcd","minAsr","visibility","status","wholesaleCompatible","callcenterCompatible","dialerCompatible","retailCompatible","otpCompatible","notes","exchangeScore","lastQcAt","createdAt","updatedAt","parentRouteId","isBundle","sipHost","sipPort","techPrefix","sipAuthUsername","sipAuthPasswordSet","smsDeliveryUrl","smppHost","smppPort","smppSystemId","smppPasswordSet","endpointReachable","endpointCheckedAt"],"description":"A route you listed, as only you (the seller) see it. Passwords are never returned."},"MarketplaceStats":{"type":"object","properties":{"total":{"type":"integer"},"voiceCount":{"type":"integer"},"smsCount":{"type":"integer"},"destinations":{"type":"integer"},"avgPrice":{"type":"number","nullable":true,"description":"Signed-in callers only. Average list price (display figure)"},"avgAsr":{"type":"number","nullable":true,"description":"Signed-in only. Average seller-stated ASR %"},"measuredAsr":{"type":"number","nullable":true,"description":"Signed-in only. Measured ASR % over 30 days of real calls"},"avgScore":{"type":"integer","nullable":true,"description":"Signed-in only"},"totalCapacity":{"type":"integer","description":"Signed-in only"},"priceHistogram":{"type":"object","properties":{"min":{"$ref":"#/components/schemas/Money"},"max":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Top edge: the 98th percentile price in view"},"buckets":{"type":"array","items":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/Money"},"to":{"$ref":"#/components/schemas/Money"},"count":{"type":"integer"}},"required":["from","to","count"]},"description":"About 20 equal-width bands, cheapest first"},"above":{"type":"integer","nullable":true,"description":"Rows priced above `max`"},"total":{"type":"integer"}},"required":["min","max","buckets","above","total"],"nullable":true,"description":"Price spread of the view, ignoring minPrice/maxPrice so a range slider can show where it sits. Per-network rows when rows=network"},"verifiedShareByCountry":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"countryCode":{"type":"string","nullable":true},"voice":{"type":"integer"},"verified":{"type":"integer","description":"Voice rows at Qualified or better (International CLI, NCLI or Qualified)"},"share":{"type":"number","description":"verified / voice, 0..1"}},"required":["country","countryCode","voice","verified","share"]},"nullable":true,"description":"Per country, how much of the voice market in view is proven; largest first"}},"required":["total","voiceCount","smsCount","destinations"]},"ResolvedRoute":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"destinationName":{"type":"string","description":"The listing name as a buyer reads it: generated by the platform, never the seller's text, and ending in the listing reference (e.g. \"Niger Mobile · Ref 7K2Q\", \"A-Z Voice · Premium · Full CLI · Ref 3MX9\"). Your own listings keep the name you gave them."},"country":{"type":"string"},"countryCode":{"type":"string"},"type":{"type":"string","enum":["voice","sms"]},"cliType":{"type":"string","nullable":true},"price":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Rate for this destination: USD per minute or message, 6-decimal string"},"asr":{"type":"number","nullable":true},"acd":{"type":"number","nullable":true},"matchedPrefix":{"type":"string","nullable":true}},"required":["id","destinationName","country","countryCode","type","cliType","price","asr","acd","matchedPrefix"]},"PricedRoute":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["voice","sms"]},"name":{"type":"string","description":"The listing name as a buyer reads it: generated by the platform, never the seller's text, and ending in the listing reference (e.g. \"Niger Mobile · Ref 7K2Q\", \"A-Z Voice · Premium · Full CLI · Ref 3MX9\"). Your own listings keep the name you gave them."},"listingRef":{"type":"string","description":"Anonymous short reference of the listing (4 characters, e.g. \"7K2Q\"): stable for the life of the listing, unique enough to tell two same-named listings apart, and derived from the listing alone (it says nothing about the seller). Absent on your own listings."},"country":{"type":"string"},"countryCode":{"type":"string","description":"E.164 country calling code, digits only"},"matchedPrefix":{"type":"string","description":"The dial prefix the number matched on this route (the longest one, on a deck)"},"destination":{"type":"string","description":"The destination that prefix belongs to, e.g. \"United Kingdom-Mobile\"; the country for a flat-priced listing"},"rate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"What this route charges for THIS number: USD per minute (voice) or per message (SMS)"},"billingIncrement":{"type":"string","nullable":true,"description":"e.g. \"60/60\" or \"1/1\"; null when the listing does not state one"},"pricedBy":{"type":"string","enum":["deck","flat"],"description":"deck = priced by the matching rate-sheet row; flat = the listing's single price"},"expectedAsr":{"type":"string","nullable":true,"description":"Seller-stated ASR %. The measured figure is in `measured.asr`"},"expectedAcd":{"type":"string","nullable":true,"description":"Seller-stated ACD in seconds"},"cliType":{"type":"string"},"routeType":{"type":"string","description":"Quality tier"},"capacity":{"type":"integer","description":"Channels (voice) or messages per second (SMS)"},"exchangeScore":{"type":"integer","nullable":true,"description":"Exchange Score 1-100; null (\"New\") until the route has carried traffic"},"measured":{"allOf":[{"$ref":"#/components/schemas/MeasuredRouteQuality"}],"nullable":true,"description":"Measured quality of the listing from real calls; null until it has enough traffic from enough buyers"},"routeChecks":{"allOf":[{"$ref":"#/components/schemas/RouteCheckRecord"}],"nullable":true,"description":"Route checks on this listing in the last 7 days. Null when there were none."},"isOwn":{"type":"boolean","description":"True only on your own listing (signed-in callers), so you are not offered your own route"},"network":{"type":"object","properties":{"mccMnc":{"type":"string","nullable":true,"description":"Mobile network code (MCC-MNC) `rate` is for, e.g. \"234-10\"; null when unknown"},"operator":{"type":"string","nullable":true,"description":"Network name from public number-range data, e.g. \"O2\""},"source":{"type":"string","enum":["range","hlr","none"],"description":"range = number-range data; none = not determined"},"rateBasis":{"type":"string","enum":["network","all_operators","country"],"description":"network = that network's own rate; all_operators = the route's rate for networks it does not list separately; country = the price for other or unknown networks"}},"required":["mccMnc","operator","source","rateBasis"],"nullable":true,"description":"SMS routes that price the country per mobile network: which network `rate` is for. Absent otherwise"},"countryRate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"SMS routes that price per network: the price for other or unknown networks"},"verification":{"type":"string","enum":["cli","ncli","connected","not_verified"],"nullable":true,"description":"Tier of the network row the number falls on (as the per-network board labels it), else the listing tier; null for SMS"},"networkName":{"type":"string","nullable":true,"description":"Destination network the number falls on, as plain text (SMS: the operator). On voice rows `network` carries the same string"}},"required":["id","type","name","country","countryCode","matchedPrefix","destination","rate","billingIncrement","pricedBy","expectedAsr","expectedAcd","cliType","routeType","capacity","exchangeScore","measured","routeChecks","isOwn"],"description":"One route that serves the number, at the rate it would charge for it. Never names the seller."},"PriceNumberResult":{"type":"object","properties":{"number":{"type":"string","description":"The number as priced: digits only"},"type":{"type":"string","enum":["voice","sms"]},"unit":{"type":"string","enum":["min","msg"],"description":"What `rate` is per: a minute (voice) or a message (SMS)"},"total":{"type":"integer","description":"Routes that serve the number, before the 100-row cap"},"routes":{"type":"array","items":{"$ref":"#/components/schemas/PricedRoute"},"description":"Cheapest first"},"notice":{"type":"string","enum":["sanctioned"],"nullable":true,"description":"Why the list is empty when it is empty for a reason other than \"no route covers it\""}},"required":["number","type","unit","total","routes","notice"]},"Purchase":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"buyerId":{"type":"string","format":"uuid","description":"Your account id"},"routeId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","pending_review"]},"sipUsername":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"cancelledAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"agreedPrice":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Negotiated price (from an accepted offer) that overrides the list price"},"heldOldRate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Set while the purchase is paused by a seller rate increase: the rate you were paying"},"heldNewRate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"The increased rate waiting for your acceptance"},"routingPriority":{"type":"integer","nullable":true,"description":"Your routing position (1 = first); null = unranked"},"sipPassword":{"type":"string","nullable":true,"description":"Your own SIP password, for your connection card"},"heldDeckVersion":{"type":"string","nullable":true,"description":"Deck fingerprint to pass as deckVersion when accepting a deck increase"},"route":{"type":"object","properties":{"type":{"type":"string","enum":["voice","sms"]},"country":{"type":"string"},"prefix":{"type":"array","items":{"type":"string"}},"countryCode":{"type":"string"},"destinationName":{"type":"string","description":"The listing name as a buyer reads it: generated by the platform, never the seller's text, and ending in the listing reference (e.g. \"Niger Mobile · Ref 7K2Q\", \"A-Z Voice · Premium · Full CLI · Ref 3MX9\"). Your own listings keep the name you gave them."},"pricePerUnit":{"$ref":"#/components/schemas/Money"},"billingIncrement":{"type":"string","nullable":true},"capacity":{"type":"integer"},"expectedAsr":{"type":"string","nullable":true},"expectedAcd":{"type":"string","nullable":true},"dialerCompatible":{"type":"boolean"},"rateCount":{"type":"integer"}},"required":["type","country","prefix","countryCode","destinationName","pricePerUnit","billingIncrement","capacity","expectedAsr","expectedAcd","dialerCompatible","rateCount"]}},"required":["id","buyerId","routeId","status","sipUsername","createdAt","cancelledAt","agreedPrice","heldOldRate","heldNewRate","routingPriority","sipPassword","heldDeckVersion","route"]},"CallAction":{"anyOf":[{"type":"object","properties":{"say":{"type":"string","minLength":1,"maxLength":500,"description":"Text spoken by our text-to-speech voice"},"language":{"type":"string","enum":["en","es","fr","de","pt","hi"],"description":"Overrides the call default for this action"}},"required":["say"],"description":"say"},{"type":"object","properties":{"play":{"type":"string","format":"uri","maxLength":2048,"description":"HTTPS URL of an MP3 file, at most 2 MB. We download it once before dialling (public addresses only, no redirects) and play our copy"}},"required":["play"],"description":"play"},{"type":"object","properties":{"gather":{"type":"object","properties":{"digits":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Most keys to collect"},"timeout":{"type":"integer","minimum":1,"maximum":30,"default":5,"description":"Seconds to wait for the first key"},"finishOnKey":{"type":"string","enum":["#","*",""],"default":"#","description":"Key that ends input early; empty for none"},"tries":{"type":"integer","minimum":1,"maximum":3,"default":1,"description":"Prompt and wait again this many times in total when nothing is pressed"},"say":{"type":"string","minLength":1,"maxLength":500,"description":"Prompt spoken while listening; a key press interrupts it"},"play":{"type":"string","format":"uri","maxLength":2048,"description":"Prompt played while listening (instead of say)"},"language":{"type":"string","enum":["en","es","fr","de","pt","hi"]}}}},"required":["gather"],"description":"gather"},{"type":"object","properties":{"pause":{"type":"integer","minimum":1,"maximum":10,"description":"Seconds of silence"}},"required":["pause"],"description":"pause"},{"type":"object","properties":{"hangup":{"type":"boolean","enum":[true]}},"required":["hangup"],"description":"hangup (must be last)"}]},"CommsCallAccepted":{"type":"object","properties":{"callId":{"type":"string","format":"uuid","description":"Use with GET /comms/calls/{id}; the same id appears on the call.* webhooks"},"status":{"type":"string","enum":["ringing"],"description":"The call has been handed to the network and is being dialled"},"mode":{"type":"string","enum":["async"]},"to":{"type":"string"},"from":{"type":"string"},"actions":{"type":"integer","description":"How many call actions will run on answer"},"statusUrl":{"type":"string","description":"Path of GET /comms/calls/{id} for this call"}},"required":["callId","status","mode","to","from","actions","statusUrl"]},"CommsCallStatus":{"type":"object","properties":{"callId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","ringing","answered","completed","no_answer","busy","failed"],"description":"queued, ringing and answered are live states; completed (answered, then ended), no_answer, busy and failed are final"},"mode":{"type":"string","enum":["sync","async"]},"to":{"type":"string"},"from":{"type":"string"},"simulated":{"type":"boolean","description":"True for test-key calls: nothing was dialled"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"ringingAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"answeredAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"endedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"durationSeconds":{"type":"integer","nullable":true},"billableSeconds":{"type":"integer","nullable":true,"description":"Duration rounded up to the route billing increment"},"cost":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"What the call cost you, platform fee included. Null until it ends"},"billingIncrement":{"type":"string","nullable":true},"sipResponseCode":{"type":"integer","nullable":true},"hangupCause":{"type":"string","nullable":true,"description":"The switch cause code, e.g. NORMAL_CLEARING or USER_BUSY"},"hangupReason":{"type":"string","nullable":true,"description":"Why the call ended, in plain words. Null while it is live"},"error":{"type":"string","nullable":true,"description":"Why the call could not be placed, when it failed before reaching the network"},"actions":{"type":"array","items":{},"nullable":true,"description":"The call actions as you sent them"},"gathered":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","description":"Which gather action (0 for the first)"},"digits":{"type":"string","nullable":true,"description":"The keys pressed, without the finish key"},"status":{"type":"string","enum":["received","no_input"],"description":"no_input: nothing was pressed, or the call ended before this step"}},"required":["index","digits","status"]},"nullable":true,"description":"Keypad input from gather actions, filled in when the call ends"},"routeId":{"type":"string","format":"uuid","nullable":true,"description":"Present when the call was placed over a failover chain: the route that carried it, or the last one tried"},"attempts":{"type":"array","items":{"type":"object","properties":{"attempt":{"type":"integer","description":"1 for the first route tried"},"routeId":{"type":"string","format":"uuid","nullable":true},"status":{"type":"string","description":"answered, failed, busy or no_answer"},"sipResponseCode":{"type":"integer","nullable":true},"hangupCause":{"type":"string","nullable":true}},"required":["attempt","routeId","status","sipResponseCode","hangupCause"]},"description":"Present when the call was tried on more than one route: every attempt in order. Only the attempt that connected is billed"}},"required":["callId","status","mode","to","from","simulated","createdAt","ringingAt","answeredAt","endedAt","durationSeconds","billableSeconds","cost","billingIncrement","sipResponseCode","hangupCause","hangupReason","error","actions","gathered"]},"CommsCall":{"type":"object","properties":{"callId":{"type":"string"},"to":{"type":"string"},"from":{"type":"string"},"status":{"type":"string","enum":["answered","no_answer","busy","failed","accepted"],"description":"Final outcome. `accepted` is returned only for simulated calls on a test key"},"sipResponseCode":{"type":"integer","nullable":true},"hangupCause":{"type":"string","nullable":true},"durationSeconds":{"type":"integer"},"billableSeconds":{"type":"integer","description":"Duration rounded up to the route billing increment"},"cost":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"What this call cost you, platform fee included"},"billingIncrement":{"type":"string","description":"The route billing increment, e.g. \"6/6\" or \"60/60\""},"startedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"completedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"simulated":{"type":"boolean","description":"Present and true for test-key calls: nothing was dialled"},"routeId":{"type":"string","format":"uuid","nullable":true,"description":"Present on calls placed over a failover chain (Smart Routing calls with automatic failover, and Switch sub-account calls): the route that carried the call, or the last one tried"},"attempts":{"type":"array","items":{"type":"object","properties":{"routeId":{"type":"string","format":"uuid"},"sipResponseCode":{"type":"integer","nullable":true},"status":{"type":"string"},"hangupCause":{"type":"string","nullable":true}},"required":["routeId","sipResponseCode","status","hangupCause"]},"description":"Present when the call was tried on more than one route: each route tried, in order. Only the one that connected is billed; a wrong number (404/484), a busy or declined call and no answer are never retried"}},"required":["callId","to","from","status","sipResponseCode","hangupCause","durationSeconds","billableSeconds","cost","billingIncrement","startedAt","completedAt"]},"CommsSms":{"type":"object","properties":{"messageId":{"type":"string","description":"Use with GET /comms/sms/{messageId}"},"to":{"type":"string"},"from":{"type":"string"},"status":{"type":"string","enum":["sent","delivered","failed","pending","accepted"],"description":"Send-time outcome when we forwarded the message, not a handset delivery receipt"},"segments":{"type":"integer","description":"Billed segments (160 GSM-7 / 70 UCS-2 characters each, fewer when concatenated)"},"cost":{"$ref":"#/components/schemas/Money"},"submittedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"simulated":{"type":"boolean","description":"Present and true for test-key messages: nothing was sent"},"network":{"type":"object","properties":{"mccMnc":{"type":"string","nullable":true,"description":"Mobile network code (MCC-MNC) the message was priced as, e.g. \"234-10\""},"operator":{"type":"string","nullable":true,"description":"Network name from public number-range data"},"source":{"type":"string","enum":["range","hlr","none"],"description":"range = number-range data; hlr = a live network lookup; none = not determined"},"rateBasis":{"type":"string","enum":["network","all_operators","country"],"description":"network = that network's own rate; all_operators = the route's rate for networks it does not list separately; country = the route's price for other or unknown networks"}},"required":["mccMnc","operator","source","rateBasis"],"nullable":true,"description":"Present when the route prices SMS to this country per destination network. The network is determined from the number's range (ported numbers may be priced at the network the range belongs to)"}},"required":["messageId","to","from","status","segments","cost","submittedAt"]},"CommsHistoryEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"type":{"type":"string","description":"Ledger entry type, e.g. charge"},"amount":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Signed: a charge is negative"},"balanceAfter":{"$ref":"#/components/schemas/Money"},"reference":{"type":"string","nullable":true,"description":"Human-readable description of the call or message"},"relatedEntityType":{"type":"string","nullable":true,"description":"api_call for calls; api_sms or smpp_sms for messages"},"relatedEntityId":{"type":"string","format":"uuid","nullable":true,"description":"The callId or messageId"},"callId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["id","userId","type","amount","balanceAfter","reference","relatedEntityType","relatedEntityId","callId","createdAt"]},"SmsTimelineStep":{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","accepted","delivered","failed"],"description":"queued = charged and waiting to be handed off; sent = the route accepted it; accepted = simulated on a test key; delivered / failed = final"},"at":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"source":{"type":"string","enum":["platform","submit","carrier_receipt","simulated"],"description":"Where we learned it: our ledger, the hand-off to the route, the carrier's delivery receipt, or a test-key simulation"},"errorCode":{"type":"string","nullable":true,"description":"On failed: SELLER_REJECTED, NO_ENDPOINT, UNDELIVERABLE, EXPIRED, REJECTED or TEMPORARY_FAILURE"},"carrierStatus":{"type":"string","nullable":true,"description":"The carrier receipt's own status value, e.g. DELIVRD or UNDELIV"},"carrierError":{"type":"string","nullable":true,"description":"The carrier receipt's own error value, when it sent one"}},"required":["status","at","source"]},"CommsSmsStatus":{"type":"object","properties":{"messageId":{"type":"string"},"status":{"type":"string","description":"Current state: sent, accepted (test key), delivered or failed; not_found when the id is not on your account. delivered only ever comes from a carrier receipt"},"to":{"type":"string","nullable":true},"from":{"type":"string","nullable":true},"segments":{"type":"integer","nullable":true},"errorCode":{"type":"string","nullable":true,"description":"Set when status is failed: SELLER_REJECTED (the route refused the hand-off), NO_ENDPOINT, UNDELIVERABLE, EXPIRED or REJECTED (from the carrier receipt), or TEMPORARY_FAILURE (the supplier session was momentarily unavailable on our side; retry)"},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/SmsTimelineStep"},"description":"Every state the message has been in, oldest first"},"awaitingReceipt":{"type":"boolean","description":"True while the message is sent and no carrier receipt has arrived. It stays true for good on a route that returns no receipts"},"routeReturnsReceipts":{"type":"boolean","nullable":true,"description":"Whether the route that carried this message has returned at least one carrier receipt in the last 30 days. null for test-key messages"},"dlrSupported":{"type":"boolean","description":"True: the platform collects carrier delivery receipts. Whether one arrives for this message depends on the route (routeReturnsReceipts)"},"simulated":{"type":"boolean","description":"Present and true for test-key messages: nothing was sent"},"cost":{"$ref":"#/components/schemas/Money","description":"The ledger amount of the charge (negative)"},"reference":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","description":"When the message was charged"},"message":{"type":"string","description":"Explanation, present when status is not_found"}},"required":["messageId","status"]},"VoiceOtpResult":{"type":"object","properties":{"voiceOtpId":{"type":"string","format":"uuid","description":"Use with GET /comms/voice-otp/{id}"},"callId":{"type":"string","description":"The call carrying the code; it also appears in GET /comms/calls and the call.completed webhook"},"status":{"type":"string","enum":["initiated","accepted"],"description":"`initiated`: the call is ringing. `accepted`: simulated on a test key"},"to":{"type":"string"},"from":{"type":"string","description":"The caller ID presented"},"language":{"type":"string"},"codeLength":{"type":"integer"},"repeat":{"type":"integer","description":"How many times the code is read"},"code":{"type":"string","description":"Present only when we generated the code AND you sent `returnCode: true`"},"cost":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Test keys: the simulated charge. Live: null here; the final cost arrives with call.completed and on GET"},"simulated":{"type":"boolean","description":"Present and true for test keys: nothing was dialled"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["voiceOtpId","callId","status","to","from","language","codeLength","repeat","cost","createdAt"]},"VoiceOtpStatus":{"type":"object","properties":{"voiceOtpId":{"type":"string","format":"uuid"},"callId":{"type":"string","nullable":true},"status":{"type":"string","enum":["initiated","answered","no_answer","busy","failed","accepted"]},"to":{"type":"string"},"language":{"type":"string"},"codeLength":{"type":"integer"},"cost":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"What the call cost you, platform fee included. Null until it ends"},"durationSeconds":{"type":"integer","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"completedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"simulated":{"type":"boolean"}},"required":["voiceOtpId","callId","status","to","language","codeLength","cost","durationSeconds","createdAt","completedAt"]},"VerifyStartResult":{"type":"object","properties":{"verificationId":{"type":"string","format":"uuid","description":"Pass to POST /verify/check"},"reference":{"type":"string","nullable":true,"description":"Your reference, when you sent one"},"to":{"type":"string"},"channel":{"type":"string","enum":["sms","voice"]},"status":{"type":"string","enum":["pending"]},"expiresAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"maxAttempts":{"type":"integer","description":"Wrong guesses allowed before the verification is dead (5)"},"sendRef":{"type":"string","description":"The messageId (SMS) or callId (voice) that carried the code"},"sendStatus":{"type":"string","description":"SMS send-time status, or `initiated` for a voice call"},"simulated":{"type":"boolean","description":"Present and true for test keys: nothing was sent"},"testCode":{"type":"string","description":"Test keys ONLY: the code, so a sandbox can complete the check. Never present on a live key"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["verificationId","reference","to","channel","status","expiresAt","maxAttempts","sendRef","sendStatus","createdAt"]},"VerifyCheckResult":{"type":"object","properties":{"verificationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["approved","denied","expired","max_attempts"]},"attemptsRemaining":{"type":"integer"},"reason":{"type":"string","enum":["wrong_code","already_used","not_pending"],"description":"Why a check was not approved, when it is not obvious from `status`"}},"required":["verificationId","status","attemptsRemaining"]},"CallInVerification":{"type":"object","properties":{"verificationId":{"type":"string","format":"uuid","description":"Use with GET /verify/{id}"},"reference":{"type":"string","nullable":true,"description":"Your reference, when you sent one"},"to":{"type":"string","description":"The phone number being verified"},"channel":{"type":"string","enum":["call_in"]},"status":{"type":"string","enum":["pending","approved","expired"]},"callNumber":{"type":"string","description":"The number the user must call from `to` (E.164)"},"callNumberDisplay":{"type":"string","description":"The same number formatted for people, e.g. +1 (773) 232-1843"},"callerNumber":{"type":"string","nullable":true,"description":"The caller ID the approving call came from"},"callReceivedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"callerIdAttestation":{"type":"string","nullable":true,"description":"What the calling carrier said about the caller ID, when it said anything: STIR/SHAKEN attestation A, B or C, or a verstat value such as TN-Validation-Passed. Null when nothing was passed"},"expiresAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"approvedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"price":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Charged once, when approved. Expired verifications are free"},"instructions":{"type":"string","description":"Start only: a sentence you can show the user as-is"},"simulated":{"type":"boolean","description":"Present and true for test keys"}},"required":["verificationId","reference","to","channel","status","callNumber","callNumberDisplay","callerNumber","callReceivedAt","callerIdAttestation","expiresAt","createdAt","approvedAt","price"]},"CallInCoverage":{"type":"object","properties":{"price":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Per approved call-in verification"},"currency":{"type":"string","enum":["USD"]},"numbers":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string","description":"ISO country of the number to call"},"coversDialCode":{"type":"string","description":"Phone numbers starting with this dial code can be verified with it"},"callNumber":{"type":"string"},"callNumberDisplay":{"type":"string"},"yours":{"type":"boolean","description":"True for your own number (switched on under call-in numbers)"}},"required":["country","coversDialCode","callNumber","callNumberDisplay","yours"]}}},"required":["price","currency","numbers"]},"CallInNumber":{"type":"object","properties":{"phoneNumberId":{"type":"string","format":"uuid","description":"Your phone number's id (the same id as in the DID Store)"},"number":{"type":"string"},"numberDisplay":{"type":"string"},"country":{"type":"string","nullable":true},"verifiesDialCode":{"type":"string","nullable":true,"description":"Phone numbers starting with this dial code are verified with this number"},"type":{"type":"string","nullable":true},"status":{"type":"string"},"callInEnabled":{"type":"boolean"},"hasCallRouting":{"type":"boolean","description":"The number has ringing set up. While call-in is on, calls to it are used for verification only and never ring"}},"required":["phoneNumberId","number","numberDisplay","country","verifiesDialCode","type","status","callInEnabled","hasCallRouting"]},"Verification":{"type":"object","properties":{"verificationId":{"type":"string","format":"uuid"},"reference":{"type":"string","nullable":true},"to":{"type":"string"},"channel":{"type":"string","enum":["sms","voice"]},"status":{"type":"string","enum":["pending","approved","expired","max_attempts","failed"]},"attempts":{"type":"integer"},"maxAttempts":{"type":"integer"},"expiresAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"approvedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"sendRef":{"type":"string","nullable":true},"sendStatus":{"type":"string","nullable":true},"simulated":{"type":"boolean"}},"required":["verificationId","reference","to","channel","status","attempts","maxAttempts","expiresAt","createdAt","approvedAt","sendRef","sendStatus"]},"DidCatalogSku":{"type":"object","properties":{"skuId":{"type":"string","description":"Pass to POST /dids/buy"},"channels":{"type":"integer","description":"Concurrent call channels included"},"setupPrice":{"type":"number","description":"One-off price in USD (display number, not a money string)"},"monthlyPrice":{"type":"number","description":"Monthly price in USD (display number, not a money string)"}},"required":["skuId","channels","setupPrice","monthlyPrice"]},"DidCatalogGroup":{"type":"object","properties":{"groupId":{"type":"string","description":"Pass to POST /dids/buy with a skuId"},"country":{"type":"string"},"countryId":{"type":"string","description":"Catalogue country id (filter value), not an ISO code"},"countryPrefix":{"type":"string"},"city":{"type":"string","nullable":true},"areaPrefix":{"type":"string","nullable":true},"typeId":{"type":"string","nullable":true},"typeName":{"type":"string","nullable":true,"description":"Local, National, Mobile, Toll-free..."},"skus":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogSku"}}},"required":["groupId","country","countryId","countryPrefix","city","areaPrefix","typeId","typeName","skus"]},"DidCatalogCountry":{"type":"object","properties":{"countryId":{"type":"string"},"country":{"type":"string"},"countryPrefix":{"type":"string"}},"required":["countryId","country","countryPrefix"]},"Did":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string","nullable":true,"description":"null while the number is still being provisioned"},"country":{"type":"string","nullable":true},"countryCode":{"type":"string","minLength":2,"maxLength":2,"description":"ISO-3166-1 alpha-2 country code","nullable":true},"city":{"type":"string","nullable":true},"areaPrefix":{"type":"string","nullable":true},"didType":{"type":"string","nullable":true},"channelsIncluded":{"type":"integer"},"status":{"type":"string","enum":["pending","active","suspended","released","failed"],"description":"suspended = a monthly renewal failed; the number is held for `graceDays` before release"},"pointMode":{"type":"string","enum":["unrouted","sip","forward"]},"pointsTo":{"type":"string","nullable":true,"description":"Primary destination: host[:port] for sip, E.164 for forward"},"pointsToBackup":{"type":"string","nullable":true},"autoRenew":{"type":"boolean"},"setupPrice":{"$ref":"#/components/schemas/Money"},"monthlyPrice":{"$ref":"#/components/schemas/Money"},"orderedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"activatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"nextRenewalAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"suspendedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"releasedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"endpointReachable":{"type":"boolean","nullable":true,"description":"null = not checked yet"},"endpointCause":{"type":"string","nullable":true},"endpointCheckedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"aiAgentId":{"type":"string","format":"uuid","nullable":true,"description":"The AI voice agent answering inbound calls to this number, or null (PUT /dids/{id}/ai-agent)"},"graceDays":{"type":"integer","description":"Days an unpaid (suspended) number is held before release"}},"required":["id","number","country","countryCode","city","areaPrefix","didType","channelsIncluded","status","pointMode","pointsTo","pointsToBackup","autoRenew","setupPrice","monthlyPrice","orderedAt","activatedAt","nextRenewalAt","suspendedAt","releasedAt","endpointReachable","endpointCause","endpointCheckedAt","aiAgentId","graceDays"]},"LedgerTransaction":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["topup","charge","credit","payout","platform_fee","test_credit","chargeback","refund_reversal","refund","transfer"],"description":"charge = usage you paid for; credit = seller earnings or a grant; platform_fee = the exchange fee"},"amount":{"allOf":[{"$ref":"#/components/schemas/Money"}],"description":"Signed: negative for money out (charges, fees, payouts), positive for money in"},"balanceAfter":{"$ref":"#/components/schemas/Money"},"reference":{"type":"string","nullable":true},"relatedEntityType":{"type":"string","nullable":true},"relatedEntityId":{"type":"string","format":"uuid","nullable":true},"callId":{"type":"string","nullable":true,"description":"The call or message this line bills; equals the CDR callUuid"},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["id","userId","type","amount","balanceAfter","reference","relatedEntityType","relatedEntityId","createdAt"],"additionalProperties":true},"PricingDestination":{"type":"object","properties":{"slug":{"type":"string","description":"URL slug from the country name, e.g. \"pakistan\""},"country":{"type":"string"},"countryCode":{"type":"string","description":"E.164 country calling code, digits only"},"routes":{"type":"integer","description":"Live routes that price at least one number type"},"lowest":{"type":"string","description":"Lowest mobile, fixed or country-wide rate"},"lowestBand":{"type":"string","enum":["mobile","fixed","countryWide"],"description":"`mobile` and `fixed`: rate-sheet rows named for that number type. `countryWide`: the bare country row (or a single-price listing), which prices every number without a more specific row."},"unit":{"type":"string","enum":["min","msg"],"description":"Per minute (voice) or per message (SMS)"}},"required":["slug","country","countryCode","routes","lowest","lowestBand","unit"]},"PricingDestinationDetail":{"type":"object","properties":{"slug":{"type":"string","description":"URL slug from the country name, e.g. \"pakistan\""},"country":{"type":"string"},"countryCode":{"type":"string","description":"E.164 country calling code, digits only"},"routes":{"type":"integer","description":"Live routes that price at least one number type"},"lowest":{"type":"string","description":"Lowest mobile, fixed or country-wide rate"},"lowestBand":{"type":"string","enum":["mobile","fixed","countryWide"],"description":"`mobile` and `fixed`: rate-sheet rows named for that number type. `countryWide`: the bare country row (or a single-price listing), which prices every number without a more specific row."},"unit":{"type":"string","enum":["min","msg"],"description":"Per minute (voice) or per message (SMS)"},"type":{"type":"string","enum":["voice","sms"]},"highest":{"type":"string","description":"Highest route \"from\" price in the destination"},"bands":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["mobile","fixed","countryWide"],"description":"`mobile` and `fixed`: rate-sheet rows named for that number type. `countryWide`: the bare country row (or a single-price listing), which prices every number without a more specific row."},"from":{"type":"string","description":"USD, 6-decimal string, e.g. \"0.020370\""},"routes":{"type":"integer"}},"required":["key","from","routes"]},"description":"Lowest rate per number type"},"operators":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"from":{"type":"string","description":"USD, 6-decimal string, e.g. \"0.020370\""},"routes":{"type":"integer"}},"required":["name","from","routes"]},"description":"Mobile operators broken out on at least two routes, cheapest first, at most 12"},"cliTypes":{"type":"array","items":{"type":"object","properties":{"cliType":{"type":"string"},"routes":{"type":"integer"}},"required":["cliType","routes"]},"description":"Caller-ID handling the sellers state (voice only)"},"increments":{"type":"array","items":{"type":"object","properties":{"increment":{"type":"string"},"routes":{"type":"integer"}},"required":["increment","routes"]},"description":"Billing increments, e.g. \"1/1\" (voice only)"},"routesWithStatedAsr":{"type":"integer","description":"Routes whose seller states an ASR"},"otherBreakouts":{"type":"integer","description":"Named breakouts that are not a headline number type (toll-free, premium, cities)"},"topRoutes":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"integer"},"from":{"type":"string","description":"USD, 6-decimal string, e.g. \"0.020370\""},"mobileFrom":{"type":"string","nullable":true,"description":"USD, 6-decimal string, e.g. \"0.020370\""},"cliType":{"type":"string"},"billingIncrement":{"type":"string","nullable":true},"routeType":{"type":"string","description":"Quality tier the route is listed under"},"statedAsr":{"type":"string","nullable":true,"description":"Seller-stated ASR %, not measured"},"statedAcd":{"type":"string","nullable":true,"description":"Seller-stated ACD in seconds, not measured"}},"required":["rank","from","mobileFrom","cliType","billingIncrement","routeType","statedAsr","statedAcd"]},"description":"The five cheapest routes, as anonymous facts"},"related":{"type":"array","items":{"$ref":"#/components/schemas/PricingDestination"},"description":"Destinations in the same world numbering zone"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["slug","country","countryCode","routes","lowest","lowestBand","unit","type","highest","bands","operators","cliTypes","increments","routesWithStatedAsr","otherBreakouts","topRoutes","related","updatedAt"]},"WebhookEvent":{"type":"object","description":"The body of every webhook delivery (an HTTPS POST). Headers: `X-Webhook-Event` (the event name), `X-Webhook-Id` (unique per delivery, use it to de-duplicate), `X-PX-Timestamp` (Unix seconds) and `X-PX-Signature: v1=<hex HMAC-SHA256 of \"<X-PX-Timestamp>.<raw body>\">` keyed with the endpoint secret. Verify the signature on the raw bytes and reject timestamps more than 5 minutes old. Answer any 2xx within 10 seconds. See POST /account/webhooks for registration.","required":["event","data","timestamp"],"properties":{"event":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"],"description":"The event name, also sent as X-Webhook-Event."},"data":{"type":"object","additionalProperties":true,"description":"The event payload. Its fields depend on the event."},"timestamp":{"type":"string","format":"date-time","description":"ISO-8601 time (UTC) the event was raised."}}}},"responses":{"BadRequest":{"description":"`VALIDATION_ERROR`, `INVALID_INPUT` or `BAD_REQUEST`. For `VALIDATION_ERROR`, `error.details` is an array of `{ path, message }`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Unauthorized":{"description":"`UNAUTHORIZED`: missing, invalid, expired or revoked credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Forbidden":{"description":"`FORBIDDEN`: not allowed: a scoped key lacks the scope, or the endpoint is session-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"NotFound":{"description":"`NOT_FOUND`: no such resource on your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"Conflict":{"description":"`CONFLICT` (or a code-specific 409): the change clashes with existing state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"RateLimited":{"description":"`RATE_LIMITED`: slow down and retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"ServerError":{"description":"`INTERNAL_ERROR`: unexpected failure. Quote `X-Request-Id` to support.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"paths":{"/api/v1/account":{"get":{"operationId":"getAccount","tags":["Account and balance"],"summary":"Get your account profile","description":"Profile, balance and account state. Secrets are never included.\n\n**Auth:** API key or JWT. Scoped keys need `account:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/AccountProfile"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"account:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/account/balance":{"get":{"operationId":"getAccountBalance","tags":["Account and balance"],"summary":"Get your balance and test credit","description":"**Auth:** API key or JWT. Scoped keys need `account:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/AccountBalance"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"account:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/billing/transactions":{"get":{"operationId":"getBillingTransactions","tags":["Account and balance"],"summary":"List ledger transactions","description":"Your account ledger, newest first, cursor-paginated. Filter by type and an ISO date range (inclusive `from`, exclusive `to`). With `format=csv` the response is a CSV file of every matching row (up to 10,000) instead of JSON.\n\n**Auth:** API key or JWT. Scoped keys need `account:read`.","responses":{"200":{"description":"One page of results, newest first.","content":{"application/json":{"schema":{"type":"object","required":["success","data","nextCursor","hasMore"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerTransaction"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to fetch the next page; null on the last page."},"hasMore":{"type":"boolean","description":"True when another page exists."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"account:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["topup","charge","credit","payout","platform_fee","test_credit"]}},{"name":"from","in":"query","required":false,"description":"Inclusive start (ISO-8601)","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Exclusive end (ISO-8601)","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` from the previous page","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"format","in":"query","required":false,"description":"csv streams every matching row (up to 10,000) as a spreadsheet file","schema":{"type":"string","enum":["json","csv"]}}]}},"/api/v1/comms/sms":{"post":{"operationId":"postCommsSms","tags":["SMS"],"summary":"Send a single SMS","description":"Forwards the message to the route seller and returns straight away with a message id. `status` is the send-time outcome (accepted, sent or failed). The final outcome comes later from the carrier's delivery receipt, when the route returns one: read it with `GET /comms/sms/{messageId}` or subscribe to the `sms.delivered` and `sms.failed` webhooks. A message that fails on its receipt is refunded. Billed per segment at the route price plus the platform fee. A test key simulates the send against test credit. Live sends need a verified account (403 `KYC_REQUIRED` otherwise).\n\n**Auth:** API key or JWT. Scoped keys need `sms:send`.\n\n**Rate limit:** 10 requests per second per caller.\n\n**Idempotency:** send an `X-Idempotency-Key` header to make retries safe; a replay within 24 hours returns the original response.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CommsSms"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"sms:send","x-rate-limit":{"max":10,"window":"second"},"x-error-codes":["KYC_REQUIRED"],"x-idempotent":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"X-Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$","description":"Destination number (E.164)"},"from":{"type":"string","minLength":1,"maxLength":30,"pattern":"^[A-Za-z0-9 .+_-]+$","description":"Sender ID: a number or an alphanumeric sender (letters, digits, spaces and . + _ -)"},"routeId":{"type":"string","format":"uuid","description":"An SMS route you purchased. Omit to let Smart Routing pick the best of your own active SMS routes for the destination (never a route you have not bought)"},"strategy":{"type":"string","enum":["cheapest","best_quality","balanced"],"description":"Smart Routing strategy used when routeId is omitted"},"message":{"type":"string","minLength":1,"maxLength":1600,"description":"Message body. Long messages are sent as concatenated segments"}},"required":["to","from","message"]}}}},"x-px-billable":{"kind":"traffic","note":"Places a real call or sends a real message, billed to your balance. A test key simulates it against test credit."}},"get":{"operationId":"getCommsSms","tags":["SMS"],"summary":"List your SMS history","description":"Ledger entries for messages sent over the API and SMPP, newest first.\n\n**Auth:** API key or JWT. Not available to scoped keys. Use a full-access key or a dashboard session.","responses":{"200":{"description":"One page of results, newest first.","content":{"application/json":{"schema":{"type":"object","required":["success","data","nextCursor","hasMore"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CommsHistoryEntry"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to fetch the next page; null on the last page."},"hasMore":{"type":"boolean","description":"True when another page exists."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"Accepted but not applied: each endpoint already fixes its own type","schema":{"type":"string","enum":["api_call","api_sms","smpp_sms","dialer_campaign"]}},{"name":"from","in":"query","required":false,"description":"Only rows created at or after this instant","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Only rows created before this instant","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` from the previous page","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}]}},"/api/v1/comms/sms/{messageId}":{"get":{"operationId":"getCommsSmsByMessageId","tags":["SMS"],"summary":"Get the delivery status and timeline of a sent SMS","description":"Returns the message's current status and its timeline: `queued` (charged), `sent` (the route accepted the hand-off), then `delivered` or `failed`, each with a timestamp, and an `errorCode` on failure.\n\n**Where delivered comes from.** Only from a carrier delivery receipt. Receipts come back on SMPP routes whose supplier returns them, and on HTTP routes whose seller posts them back to us. A route that returns none leaves its messages at `sent` with `awaitingReceipt: true`; `routeReturnsReceipts` tells you whether the route has returned any in the last 30 days, so you know whether to wait. A receipt that reports the message undelivered, expired or rejected marks it `failed` and refunds it.\n\nCovers messages sent with `POST /comms/sms` and `POST /comms/sms/bulk`. An unknown id answers 200 with status `not_found` rather than 404.\n\n**Auth:** API key or JWT. Scoped keys need `sms:send`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CommsSmsStatus"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"sms:send","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/comms/calls":{"post":{"operationId":"postCommsCalls","tags":["Voice calls"],"summary":"Place a single outbound call","description":"Dials `to` over a route you purchased (or one Smart Routing selects). By default the request BLOCKS until the call ends (answer and hangup, no answer, or `maxDuration`), then returns the outcome and what it cost (200); set a client timeout above `maxDuration`. With `async: true` it returns at once with **202** and `status: ringing`; follow the call on GET /comms/calls/{id} or with the call.ringing, call.answered, call.gathered and call.completed webhooks. Validation, routing and balance errors are still returned straight away in both modes. `actions` make the answered call speak (`say`, in en, es, fr, de, pt or hi), play an MP3 (`play`), collect keypad digits (`gather`), wait (`pause`) or end (`hangup`), in order; audio is prepared before dialling, so a bad URL costs nothing. Billed per the route increment at the route price plus the platform fee, after the call completes; there is no charge for spoken text. A test key simulates the call against test credit and runs no actions.\n\n**Auth:** API key or JWT. Scoped keys need `voice:send`.\n\n**Rate limit:** 10 requests per second per caller.\n\n**Idempotency:** send an `X-Idempotency-Key` header to make retries safe; a replay within 24 hours returns the original response.","responses":{"200":{"description":"The call outcome (200), or with async:true the accepted call (202)","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/CommsCall"},{"$ref":"#/components/schemas/CommsCallAccepted"}]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"voice:send","x-rate-limit":{"max":10,"window":"second"},"x-idempotent":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"X-Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$","description":"Destination number (E.164)"},"from":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$","description":"Caller ID to present (E.164)"},"routeId":{"type":"string","format":"uuid","description":"A route you purchased. Omit to let Smart Routing pick one"},"strategy":{"type":"string","enum":["cheapest","best_quality","balanced"],"description":"Smart Routing strategy used when routeId is omitted"},"maxDuration":{"type":"integer","minimum":10,"maximum":3600,"default":300,"description":"Hang up after this many seconds"},"async":{"type":"boolean","description":"Return at once (202, status ringing) instead of waiting for the call to end. Follow the call on GET /comms/calls/{id} or with the call.* webhooks"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/CallAction"},"minItems":1,"maxItems":10,"description":"What the call does once answered, in order: say, play, gather, pause, hangup. At most 10 actions, 1,500 characters of spoken text, 3 play URLs and 5 gathers. The call ends when the actions finish"},"language":{"type":"string","enum":["en","es","fr","de","pt","hi"],"description":"Default language for say actions (default en)"}},"required":["to","from"]}}}},"x-px-billable":{"kind":"traffic","note":"Places a real call or sends a real message, billed to your balance. A test key simulates it against test credit."}},"get":{"operationId":"getCommsCalls","tags":["Voice calls"],"summary":"List your API call history","description":"Ledger entries for calls placed through POST /comms/calls, newest first.\n\n**Auth:** API key or JWT. Not available to scoped keys. Use a full-access key or a dashboard session.","responses":{"200":{"description":"One page of results, newest first.","content":{"application/json":{"schema":{"type":"object","required":["success","data","nextCursor","hasMore"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CommsHistoryEntry"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to fetch the next page; null on the last page."},"hasMore":{"type":"boolean","description":"True when another page exists."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"Accepted but not applied: each endpoint already fixes its own type","schema":{"type":"string","enum":["api_call","api_sms","smpp_sms","dialer_campaign"]}},{"name":"from","in":"query","required":false,"description":"Only rows created at or after this instant","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"description":"Only rows created before this instant","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` from the previous page","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}]}},"/api/v1/comms/calls/{id}":{"get":{"operationId":"getCommsCallsById","tags":["Voice calls"],"summary":"Get one call: live status, cost and gathered digits","description":"Works for any call placed through POST /comms/calls, while it runs and after it ends: status, timestamps, duration, cost, the hangup cause in plain words, and the digits collected by gather actions. A reseller sub-account key sees only its own calls. Unknown ids answer 404.\n\n**Auth:** API key or JWT. Scoped keys need `voice:send`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CommsCallStatus"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"voice:send","x-error-codes":["NOT_FOUND"],"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The callId returned by POST /comms/calls"}}]}},"/api/v1/verify/start":{"post":{"operationId":"postVerifyStart","tags":["Verify"],"summary":"Start a verification: a code by SMS or voice, or a call-in","description":"Generates a code of `length` digits (default 6), sends it over `channel`, and returns a `verificationId`. We store only a keyed hash (HMAC) of the code; the code itself is never stored or logged. The code expires after `expirySeconds` (default 600). SMS languages: en, es, fr, de, pt, hi, ar. Voice languages: en, es, fr, de, pt, hi. `from` is the SMS sender ID (defaults to your brand) or, for voice, the caller ID. Billed as the SMS or call that carries the code: the route rate plus the platform fee, no verification fee. A test key sends nothing, charges test credit and returns `testCode` so you can finish the flow. Omit `strategy` and the code goes out over Smart Routing's `best_quality` route for the destination (plain calls and SMS default to `balanced`). Limits, shared by voice passcodes and the Verify API: 5 codes per number per hour, 30 seconds between codes to the same number, a per-account daily cap, and a cap on codes into one number range per hour. A limit answers 429 with `details.retryAfterSeconds`. Embargoed destinations, premium-rate / satellite / high-risk ranges and numbers on your Do-Not-Contact list are refused with 400. CALL-IN (`channel: \"call_in\"`): uses a phone number YOU hold. Buy one in the DID Store in the country of the people you verify, then switch it on with POST /verify/call-in/numbers. No code is sent. The response carries `callNumber`; show it to your user and ask them to call it FROM `to`. The call is matched by its caller ID and ended straight away without being answered, so it is free for the caller, and the verification turns `approved`. Learn the result from the `verification.approved` webhook (or `verification.expired` when nobody called in time), or poll GET /verify/{id}. `expirySeconds` defaults to 300 for call-in. Each of your call-in numbers verifies phone numbers in its own country (dial code); a `to` with no call-in number for its country answers 400. Price: a flat fee per APPROVED verification (see coverage), taken from your balance when the call arrives; an expired verification is free. Your balance must cover one verification to start. Starting again with the same `reference`, or for the same `to` while one is pending, returns the pending verification instead of a new one. A test key returns a real-looking verification that no call can approve: finish it with POST /verify/{id}/simulate-call. A caller ID is weaker proof than a code: use call-in to confirm a phone number at sign-up, and a code for high-risk actions such as account recovery or payments.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.\n\n**Rate limit:** 10 requests per second per caller.\n\n**Idempotency:** send an `X-Idempotency-Key` header to make retries safe; a replay within 24 hours returns the original response.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/VerifyStartResult"},{"$ref":"#/components/schemas/CallInVerification"}]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","x-rate-limit":{"max":10,"window":"second"},"x-idempotent":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"X-Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$"},"channel":{"type":"string","enum":["sms","voice","call_in"],"description":"`sms` or `voice` send a code; `call_in` returns a number the user calls from `to`, and the call itself verifies them"},"reference":{"type":"string","pattern":"^[A-Za-z0-9._:@-]{1,128}$","description":"Your own id for this request (e.g. your user or session id). Echoed on every read and webhook; a pending verification is reused when you start again with the same reference"},"length":{"type":"integer","minimum":4,"maximum":10},"language":{"type":"string","pattern":"^[a-z]{2}$"},"brand":{"type":"string","maxLength":120,"description":"Brand read out / sent. Cleaned to letters, digits and spaces, max 30 characters"},"expirySeconds":{"type":"integer","minimum":60,"maximum":3600},"from":{"type":"string","minLength":1,"maxLength":30},"strategy":{"type":"string","enum":["cheapest","best_quality","balanced"]},"route":{"type":"string","enum":["smart","direct"]}},"required":["to","channel"]}}}},"x-px-billable":{"kind":"traffic","note":"Sends a real SMS or places a real voice call carrying the code, billed as that message or call. A test key simulates it."}}},"/api/v1/verify/check":{"post":{"operationId":"postVerifyCheck","tags":["Verify"],"summary":"Check the code a user entered","description":"`approved` exactly once: a code is single use, and a second check of an approved verification answers `denied` with reason `already_used`. Five attempts in total; the fifth wrong guess answers `max_attempts` and the verification is dead. After `expiresAt` every check answers `expired`, even with the right code. Spaces and dashes in the submitted code are ignored. The comparison is constant-time.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.\n\n**Rate limit:** 20 requests per second per caller.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/VerifyCheckResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","x-rate-limit":{"max":20,"window":"second"},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"verificationId":{"type":"string","format":"uuid"},"code":{"type":"string","minLength":1,"maxLength":32}},"required":["verificationId","code"]}}}}}},"/api/v1/verify/{id}":{"get":{"operationId":"getVerifyById","tags":["Verify"],"summary":"Get the state of a verification","description":"Status, attempts used and how the code was delivered (never the code). For a call-in verification: whether the call arrived, from which caller ID and when.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/Verification"},{"$ref":"#/components/schemas/CallInVerification"}]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/verify":{"get":{"operationId":"getVerify","tags":["Verify"],"summary":"List recent verifications","description":"Newest first. Filter by your `reference`, `status` or `channel`. Test keys see only test verifications, live keys only live ones.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/Verification"},{"$ref":"#/components/schemas/CallInVerification"}]}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"reference","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","expired","max_attempts","failed"]}},{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["sms","voice","call_in"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}]}},"/api/v1/verify/{id}/simulate-call":{"post":{"operationId":"postVerifyByIdSimulateCall","tags":["Verify"],"summary":"Simulate the user's call (test keys only)","description":"Approves a pending test-key call-in verification as if the call came from its `to` number, and sends the same `verification.approved` webhook with `simulated: true`. Nothing is charged. Live keys answer 400.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.\n\n**Rate limit:** 10 requests per second per caller.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CallInVerification"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","x-rate-limit":{"max":10,"window":"second"},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/verify/call-in/coverage":{"get":{"operationId":"getVerifyCallInCoverage","tags":["Verify"],"summary":"Call-in coverage, numbers and price","description":"The call-in numbers your account can use, the dial code each verifies, and the price per approved verification.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CallInCoverage"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/verify/call-in/numbers":{"get":{"operationId":"getVerifyCallInNumbers","tags":["Verify"],"summary":"Your phone numbers and their call-in setting","description":"Every phone number on your account (DID Store) with whether it answers call-in verifications, and the dial code it verifies.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CallInNumber"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]},"post":{"operationId":"postVerifyCallInNumbers","tags":["Verify"],"summary":"Use one of your phone numbers for call-in verification","description":"Switches call-in ON for an active number you hold. From then on every call to it is treated as a verification attempt and ended without being answered, so any ringing set up on the number stops until you switch call-in off. The number verifies phone numbers in its own country (dial code). Live keys only.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/CallInNumber"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumberId":{"type":"string","format":"uuid"}},"required":["phoneNumberId"]}}}}}},"/api/v1/verify/call-in/numbers/{phoneNumberId}":{"delete":{"operationId":"deleteVerifyCallInNumbersByPhoneNumberId","tags":["Verify"],"summary":"Stop using a number for call-in verification","description":"Switches call-in OFF for the number; calls to it ring as set up again. Pending call-in verifications on it simply expire. Live keys only.\n\n**Auth:** API key or JWT. Scoped keys need `verify:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/CallInNumber"}],"nullable":true}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"verify:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"phoneNumberId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/comms/voice-otp":{"post":{"operationId":"postCommsVoiceOtp","tags":["Verify"],"summary":"Read a one-time passcode to a phone by voice call","description":"Calls `to` and, when answered, reads the code one digit at a time: \"Your {brand} verification code is 4, 8, 2, 9, 1, 3. Again, 4, 8, 2, 9, 1, 3.\" Repeated `repeat` times (default 2, max 3), then the call hangs up. Pass your own `code` (4-10 digits) or let us generate one of `length` digits (default 6); a generated code is returned only when you set `returnCode: true`. You check the code yourself; use POST /verify/start instead to have us check it. Languages: en, es, fr, de, pt, hi. `brand` defaults to your company name and is cleaned to letters, digits and spaces (max 30). Returns as soon as the call is ringing; the outcome and cost arrive with the call.completed webhook and on GET /comms/voice-otp/{id}. Billed exactly like POST /comms/calls: the route rate per billing increment plus the platform fee. No text-to-speech surcharge. A test key simulates the call against test credit. Omit `strategy` and the code goes out over Smart Routing's `best_quality` route for the destination (plain calls and SMS default to `balanced`). Limits, shared by voice passcodes and the Verify API: 5 codes per number per hour, 30 seconds between codes to the same number, a per-account daily cap, and a cap on codes into one number range per hour. A limit answers 429 with `details.retryAfterSeconds`. Embargoed destinations, premium-rate / satellite / high-risk ranges and numbers on your Do-Not-Contact list are refused with 400.\n\n**Auth:** API key or JWT. Scoped keys need `voice:send`.\n\n**Rate limit:** 10 requests per second per caller.\n\n**Idempotency:** send an `X-Idempotency-Key` header to make retries safe; a replay within 24 hours returns the original response.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/VoiceOtpResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"voice:send","x-rate-limit":{"max":10,"window":"second"},"x-idempotent":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"X-Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$"},"code":{"type":"string","pattern":"^[0-9]{4,10}$"},"length":{"type":"integer","minimum":4,"maximum":10},"language":{"type":"string","pattern":"^[a-z]{2}$"},"repeat":{"type":"integer","minimum":1,"maximum":3},"from":{"type":"string","pattern":"^\\+?[1-9][0-9]{6,14}$"},"strategy":{"type":"string","enum":["cheapest","best_quality","balanced"]},"route":{"type":"string","enum":["smart","direct"]},"brand":{"type":"string","maxLength":120,"description":"Brand read out / sent. Cleaned to letters, digits and spaces, max 30 characters"},"returnCode":{"type":"boolean"}},"required":["to"]}}}},"x-px-billable":{"kind":"traffic","note":"Places a real call or sends a real message, billed to your balance. A test key simulates it against test credit."}}},"/api/v1/comms/voice-otp/{id}":{"get":{"operationId":"getCommsVoiceOtpById","tags":["Verify"],"summary":"Get the outcome of a voice passcode call","description":"Whether the call was answered, how long it ran and what it cost. Never returns the code.\n\n**Auth:** API key or JWT. Scoped keys need `voice:send`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/VoiceOtpStatus"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"voice:send","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/public/numbers/catalog":{"get":{"operationId":"getPublicNumbersCatalog","tags":["Phone numbers"],"summary":"Browse the public number catalogue","description":"No account needed: prices only, for pre-signup browsing. While the number store is switched off this answers 200 with `data: { disabled: true, comingSoon: true, message }`.\n\n**Auth:** none (public endpoint).\n\n**Rate limit:** 30 requests per minute per caller.","responses":{"200":{"description":"One page of number groups. Note: `groups`, `total` and `page` sit at the TOP level beside `success`, not under `data`.","content":{"application/json":{"schema":{"type":"object","required":["success","success","groups","total","page"],"properties":{"success":{"type":"boolean","enum":[true]},"groups":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogGroup"}},"total":{"type":"integer","nullable":true},"page":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"public","x-rate-limit":{"max":30,"window":"minute"},"security":[],"parameters":[{"name":"countryId","in":"query","required":false,"description":"From GET .../catalog/countries","schema":{"type":"string","maxLength":64}},{"name":"typeId","in":"query","required":false,"description":"From GET .../catalog/types","schema":{"type":"string","maxLength":64}},{"name":"search","in":"query","required":false,"description":"Text match over country, city, area prefix and type; digits also match the start of the full dialling prefix (\"4420\" finds London). Spans the whole catalogue once it is indexed, otherwise the fetched page","schema":{"type":"string","maxLength":120}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Order by the cheapest monthly price, setup price or location. Omitted: the catalogue order","schema":{"type":"string","enum":["monthly_asc","monthly_desc","setup_asc","location_asc"]}},{"name":"maxMonthly","in":"query","required":false,"description":"Only groups whose cheapest monthly price is at most this, in USD","schema":{"type":"number","minimum":0}}]}},"/api/v1/dids/catalog":{"get":{"operationId":"getDidsCatalog","tags":["Phone numbers"],"summary":"Browse the number catalogue","description":"Number groups by country, city and type, with the price of each SKU. While the number store is switched off this answers 200 with `data: { disabled: true, comingSoon: true, message }`.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:read`.","responses":{"200":{"description":"One page of number groups. Note: `groups`, `total` and `page` sit at the TOP level beside `success`, not under `data`.","content":{"application/json":{"schema":{"type":"object","required":["success","success","groups","total","page"],"properties":{"success":{"type":"boolean","enum":[true]},"groups":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogGroup"}},"total":{"type":"integer","nullable":true},"page":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"countryId","in":"query","required":false,"description":"From GET .../catalog/countries","schema":{"type":"string","maxLength":64}},{"name":"typeId","in":"query","required":false,"description":"From GET .../catalog/types","schema":{"type":"string","maxLength":64}},{"name":"search","in":"query","required":false,"description":"Text match over country, city, area prefix and type; digits also match the start of the full dialling prefix (\"4420\" finds London). Spans the whole catalogue once it is indexed, otherwise the fetched page","schema":{"type":"string","maxLength":120}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"Order by the cheapest monthly price, setup price or location. Omitted: the catalogue order","schema":{"type":"string","enum":["monthly_asc","monthly_desc","setup_asc","location_asc"]}},{"name":"maxMonthly","in":"query","required":false,"description":"Only groups whose cheapest monthly price is at most this, in USD","schema":{"type":"number","minimum":0}}]}},"/api/v1/dids/catalog/countries":{"get":{"operationId":"getDidsCatalogCountries","tags":["Phone numbers"],"summary":"List countries with numbers for sale","description":"While the number store is switched off this answers 200 with `data: { disabled: true, comingSoon: true, message }`.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogCountry"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/dids/search":{"get":{"operationId":"getDidsSearch","tags":["Phone numbers"],"summary":"Search the catalogue by digit pattern or vanity run","description":"Scans catalogue pages for groups whose dialing prefix matches. While the number store is switched off this answers 200 with `data: { disabled: true, comingSoon: true, message }`.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:read`.","responses":{"200":{"description":"Matching groups under `data`, like every other endpoint. The same `hits`, `scannedPages` and `truncated` are also repeated at the top level beside `success` for clients written before `data` was added; that copy is deprecated, read `data`.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"hits":{"type":"array","items":{"type":"object","properties":{"groupId":{"type":"string","description":"Pass to POST /dids/buy with a skuId"},"country":{"type":"string"},"countryId":{"type":"string","description":"Catalogue country id (filter value), not an ISO code"},"countryPrefix":{"type":"string"},"city":{"type":"string","nullable":true},"areaPrefix":{"type":"string","nullable":true},"typeId":{"type":"string","nullable":true},"typeName":{"type":"string","nullable":true,"description":"Local, National, Mobile, Toll-free..."},"skus":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogSku"}},"dialingPrefix":{"type":"string","description":"Country prefix plus area prefix"},"vanity":{"type":"boolean"}},"required":["groupId","country","countryId","countryPrefix","city","areaPrefix","typeId","typeName","skus","dialingPrefix","vanity"]}},"scannedPages":{"type":"integer"},"truncated":{"type":"boolean","description":"True when the scan budget ran out before the end of the catalogue"}},"required":["hits","scannedPages","truncated"]},"hits":{"type":"array","items":{"type":"object","properties":{"groupId":{"type":"string","description":"Pass to POST /dids/buy with a skuId"},"country":{"type":"string"},"countryId":{"type":"string","description":"Catalogue country id (filter value), not an ISO code"},"countryPrefix":{"type":"string"},"city":{"type":"string","nullable":true},"areaPrefix":{"type":"string","nullable":true},"typeId":{"type":"string","nullable":true},"typeName":{"type":"string","nullable":true,"description":"Local, National, Mobile, Toll-free..."},"skus":{"type":"array","items":{"$ref":"#/components/schemas/DidCatalogSku"}},"dialingPrefix":{"type":"string","description":"Country prefix plus area prefix"},"vanity":{"type":"boolean"}},"required":["groupId","country","countryId","countryPrefix","city","areaPrefix","typeId","typeName","skus","dialingPrefix","vanity"]}},"scannedPages":{"type":"integer"},"truncated":{"type":"boolean","description":"True when the scan budget ran out before the end of the catalogue"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"pattern","in":"query","required":false,"description":"Digits to match against the dialing prefix (country + area)","schema":{"type":"string","maxLength":24}},{"name":"match","in":"query","required":false,"description":"Default contains","schema":{"type":"string","enum":["contains","starts_with","ends_with","exact"]}},{"name":"vanity","in":"query","required":false,"description":"Only prefixes with repeating or sequential runs","schema":{"type":"string","enum":["true","false","1","0","yes","no","on","off"]}},{"name":"countryId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"typeId","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"text","in":"query","required":false,"description":"Text over country, city and type name","schema":{"type":"string","maxLength":120}},{"name":"limit","in":"query","required":false,"description":"Default 50","schema":{"type":"integer","minimum":1,"maximum":100}}]}},"/api/v1/dids/buy":{"post":{"operationId":"postDidsBuy","tags":["Phone numbers"],"summary":"Buy a phone number","description":"Charges the setup price plus the first month to your own platform balance and orders the number. When `subAccountId` names one of your customers, the number is held for them but your balance still pays, now and at every renewal; a customer's balance or credit line never does, and a purchase your balance does not cover is refused (`400`). It starts `pending`; `number` is null until provisioning completes. Requires a verified identity where KYC is enforced.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:write`.\n\n**Idempotency:** send an `X-Idempotency-Key` header to make retries safe; a replay within 24 hours returns the original response.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Did"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:write","x-error-codes":["KYC_REQUIRED","NUMBER_APPROVAL_REQUIRED"],"x-idempotent":true,"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"X-Idempotency-Key","in":"header","required":false,"description":"Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skuId":{"type":"string","minLength":1,"maxLength":64},"groupId":{"type":"string","minLength":1,"maxLength":64},"countryId":{"type":"string","maxLength":64},"country":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":120,"nullable":true},"areaPrefix":{"type":"string","maxLength":16,"nullable":true},"didType":{"type":"string","maxLength":40,"nullable":true},"subAccountId":{"type":"string","format":"uuid","description":"Buy the number for one of your sub-accounts: the number is held for them, and your own platform balance pays for it (setup, first month and every renewal), never the sub-account's balance or credit"}},"required":["skuId","groupId"]}}}},"x-px-billable":{"kind":"money","note":"Buys a phone number, charged to your balance."}}},"/api/v1/dids/mine":{"get":{"operationId":"getDidsMine","tags":["Phone numbers"],"summary":"List your phone numbers","description":"While the number store is switched off this answers 200 with `data: { disabled: true, comingSoon: true, message }`.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Did"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/dids/{id}":{"get":{"operationId":"getDidsById","tags":["Phone numbers"],"summary":"Get one of your phone numbers","description":"**Auth:** API key or JWT. Scoped keys need `numbers:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Did"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/dids/{id}/routing":{"patch":{"operationId":"patchDidsByIdRouting","tags":["Phone numbers"],"summary":"Point a number at one destination (and an optional backup)","description":"The simple form of call routing: a primary and an optional failover backup. Hosted softphone lines and any extra destinations are left alone. Use PUT for the full call flow.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Did"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["sip","forward"]},"target":{"type":"string","minLength":1,"maxLength":255,"description":"host[:port] for sip, E.164 for forward"},"backupMode":{"type":"string","enum":["sip","forward"],"nullable":true,"description":"Defaults to `mode`"},"backupTarget":{"type":"string","maxLength":255,"nullable":true,"description":"null or \"\" clears the backup; omit to keep it"}},"required":["mode","target"]}}}}}},"/api/v1/dids/{id}/release":{"post":{"operationId":"postDidsByIdRelease","tags":["Phone numbers"],"summary":"Release a phone number","description":"Cancels the number and stops its monthly charge. Irreversible: the number goes back to the carrier.\n\n**Auth:** API key or JWT. Scoped keys need `numbers:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Did"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"numbers:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/routes":{"get":{"operationId":"getRoutes","tags":["Routes, marketplace and pricing"],"summary":"Browse the route marketplace","description":"Public. Every row is anonymous: no seller name, id or endpoint. Listing rows carry `trend` (calls per day, last 7 UTC days, oldest first; null with no traffic) and every row `listingTrend` (the listing's own series; on rows=network it is the whole listing, not that network). Signed-in callers get the full `stats` block; anonymous callers get counts only. Money fields are 6-decimal USD strings. Each row carries `measured` (ASR, ACD, NER and PDD measured from real calls, or null) beside the seller-stated `expectedAsr`/`expectedAcd`/`expectedPdd`; anonymous callers get the attempt count as a band and no buyer count. Sort by measured quality with `sort=measured_asr_desc|measured_asr_asc|measured_acd_desc|measured_acd_asc|ner_desc|ner_asc`, or `quality_desc` (measured NER then ASR where measured, else stated ASR): listings with measured figures come first. Every view is ordered by `verification` tier first (International CLI, NCLI, Qualified, Untested), then by the chosen sort; `verification=cli|ncli|connected|not_verified` narrows to one tier (voice routes only). Omitted, every tier is listed. `originPolicy=dual` lists routes with a separate caller ID origin price (for example a lower price for an EEA caller ID), `originPolicy=origin_only` routes that take only caller IDs from their origin group; `stats.originFacets` counts each option.\n\n**Auth:** optional. Works anonymously; a token or API key personalises the answer.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/MarketplaceRoute"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"},"total":{"type":"integer","description":"Routes matching the filters across all pages"},"stats":{"$ref":"#/components/schemas/MarketplaceStats"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"optional","security":[{},{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["voice","sms"]}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"countryCode","in":"query","required":false,"schema":{"type":"string"}},{"name":"cliType","in":"query","required":false,"schema":{"type":"string","enum":["full_cli","local_cli","mixed_cli","ncli","partial_cli"]}},{"name":"lineType","in":"query","required":false,"schema":{"type":"string","enum":["mobile_and_fixed","mobile","fixed"]}},{"name":"routeType","in":"query","required":false,"schema":{"type":"string","enum":["direct","premium","standard","ncli"]}},{"name":"minPrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"maxPrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"minAsr","in":"query","required":false,"schema":{"type":"string"}},{"name":"minAcd","in":"query","required":false,"schema":{"type":"string"}},{"name":"maxPdd","in":"query","required":false,"schema":{"type":"string"}},{"name":"minScore","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100}},{"name":"minCapacity","in":"query","required":false,"schema":{"type":"integer","minimum":0}},{"name":"billing","in":"query","required":false,"schema":{"type":"string","enum":["per_second","per_minute"]}},{"name":"wholesale","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"callcenter","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"retail","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"otp","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"openRtp","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"dialer","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"a2p","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"bundlesOnly","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"verification","in":"query","required":false,"schema":{"type":"string","enum":["cli","ncli","connected","not_verified"]}},{"name":"originPolicy","in":"query","required":false,"schema":{"type":"string","enum":["any","dual","origin_only"]}},{"name":"originGroup","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_]{1,16}$"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["price_asc","price_desc","asr_desc","asr_asc","acd_desc","acd_asc","pdd_asc","pdd_desc","capacity_desc","created_desc","country_asc","score_desc","score_asc","measured_asr_desc","measured_asr_asc","measured_acd_desc","measured_acd_asc","ner_desc","ner_asc","quality_desc"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}]}},"/api/v1/routes/{id}":{"get":{"operationId":"getRoutesById","tags":["Routes, marketplace and pricing"],"summary":"Get a route","description":"Public for live public routes. The seller gets the full owner view; a granted buyer sees a private route; any other signed-in caller gets an access stub for a private route. Carries `measured` (quality measured from real calls, or null) and `routeChecks` (the last 7 days of route checks, or null).\n\n**Auth:** optional. Works anonymously; a token or API key personalises the answer.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/MarketplaceRoute"},{"$ref":"#/components/schemas/OwnRoute"},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"destinationName":{"type":"string","description":"The listing name. For anyone but the seller it is GENERATED by the platform from its own data, never the seller's text: \"<Country> <Operator?> <Mobile|Fixed|All Networks>\" for one destination (e.g. \"Niger Mobile\", \"Kenya Safaricom Mobile\"), \"A-Z Voice · <tier> · <CLI> · Ref XXXX\" or \"A-Z SMS · <quality> · Ref XXXX\" for an A-Z bundle. The seller sees the name they gave it."},"listingRef":{"type":"string","description":"Anonymous short reference of the listing (4 characters, e.g. \"7K2Q\"): stable for the life of the listing, unique enough to tell two same-named listings apart, and derived from the listing alone (it says nothing about the seller). Absent on your own listings."},"country":{"type":"string"},"countryCode":{"type":"string"},"type":{"type":"string","enum":["voice","sms"]},"visibility":{"type":"string","enum":["private"]},"accessRequired":{"type":"boolean","enum":[true]},"accessRequestPending":{"type":"boolean"}},"required":["id","destinationName","listingRef","country","countryCode","type","visibility","accessRequired","accessRequestPending"],"description":"Returned instead of the route when it is private and you have not been granted access"}]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"optional","security":[{},{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/routes/price-number":{"get":{"operationId":"getRoutesPriceNumber","tags":["Routes, marketplace and pricing"],"summary":"Price a phone number across the marketplace","description":"Every buyer-visible route that serves the number, at the rate it would actually charge for it, cheapest first. A route with a rate sheet is priced by its longest matching active prefix (if that row is blocked the route does not serve the number); a single-price route serves it when a listed prefix, or failing that its country code, starts the number. This is the public list price: negotiated prices and private grants are not applied. SMS prices are by destination network on routes that price a country per mobile network: `network` says which network `rate` is for and `countryRate` is the price for other or unknown networks. The network is determined from the number's range (ported numbers may be priced at the network the range belongs to). The number is normalised to digits (a leading 00 is dropped). At most 100 routes are returned; `total` counts all of them. An embargoed destination returns no routes and `notice: \"sanctioned\"`. Seller identities are never included.\n\n**Auth:** optional. Works anonymously; a token or API key personalises the answer.\n\n**Rate limit:** 30 requests per minute per caller.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/PriceNumberResult"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"optional","x-rate-limit":{"max":30,"window":"minute"},"security":[{},{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"number","in":"query","required":true,"description":"A full number or dial code, any formatting","schema":{"type":"string","minLength":1,"maxLength":32}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["voice","sms"],"default":"voice"}}]}},"/api/v1/routes/countries":{"get":{"operationId":"getRoutesCountries","tags":["Routes, marketplace and pricing"],"summary":"List destinations on the marketplace","description":"Every country with at least one live public route, with its route count, A to Z.\n\n**Auth:** none (public endpoint).","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"country":{"type":"string"},"countryCode":{"type":"string"},"count":{"type":"integer"}},"required":["country","countryCode","count"]}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"public","security":[]}},"/api/v1/routes/resolve":{"get":{"operationId":"getRoutesResolve","tags":["Routes, marketplace and pricing"],"summary":"Preview which route would carry a destination","description":"Resolves as your account (including private routes you bought). `price` is a 6-decimal USD string.\n\n**Auth:** API key or JWT. Scoped keys need `routes:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"strategy":{"type":"string","enum":["cheapest","best_quality","balanced"]},"selected":{"allOf":[{"$ref":"#/components/schemas/ResolvedRoute"}],"nullable":true},"alternatives":{"type":"array","items":{"$ref":"#/components/schemas/ResolvedRoute"}},"count":{"type":"integer"}},"required":["strategy","selected","alternatives","count"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"routes:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"to","in":"query","required":true,"description":"Destination number or prefix","schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["voice","sms"],"default":"voice"}},{"name":"strategy","in":"query","required":false,"schema":{"type":"string","enum":["cheapest","best_quality","balanced"],"default":"balanced"}}]}},"/api/v1/markets/summary":{"get":{"operationId":"getMarketsSummary","tags":["Routes, marketplace and pricing"],"summary":"Get the marketplace summary","description":"Public counts for everyone; capacity, ASR, ACD and average price only for signed-in callers.\n\n**Auth:** optional. Works anonymously; a token or API key personalises the answer.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"routes":{"type":"integer"},"destinations":{"type":"integer"},"voiceRoutes":{"type":"integer"},"smsRoutes":{"type":"integer"},"hasRoutes":{"type":"boolean"},"hasActivityData":{"type":"boolean"},"capacity":{"type":"integer"},"avgAsr":{"type":"number","nullable":true},"measuredAsr":{"type":"number","nullable":true},"measuredAsrSample":{"type":"integer"},"avgAcd":{"type":"number","nullable":true},"avgPrice":{"type":"number","nullable":true,"description":"Display figure"},"topMovers":{"type":"array","items":{}},"marketStatus":{"type":"string"},"asOf":{"type":"string","format":"date-time","description":"Start of the 24h activity window"}},"required":["routes","destinations","voiceRoutes","smsRoutes","hasRoutes","hasActivityData","topMovers","marketStatus","asOf"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"optional","security":[{},{"bearerAuth":[]},{"apiKeyAuth":[]}]}},"/api/v1/pricing/destinations":{"get":{"operationId":"getPricingDestinations","tags":["Routes, marketplace and pricing"],"summary":"List destinations with live routes and their lowest rates","description":"Public. Every destination with at least one live, buyer-visible route, per product: slug, route count and lowest rate. Pass `type` for one product; without it both `voice` and `sms` lists are returned. Rebuilt at most every 10 minutes (`Cache-Control: public, max-age=600`). Rates are the sellers' list prices before the platform fee.\n\n**Auth:** none (public endpoint).","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"voice":{"type":"array","items":{"$ref":"#/components/schemas/PricingDestination"}},"sms":{"type":"array","items":{"$ref":"#/components/schemas/PricingDestination"}},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"}},"required":["updatedAt"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"public","security":[],"parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["voice","sms"]}}]}},"/api/v1/pricing/destinations/{slug}":{"get":{"operationId":"getPricingDestinationsBySlug","tags":["Routes, marketplace and pricing"],"summary":"Get the live market for one destination","description":"Public. Lowest rate per number type, mobile operator breakouts, caller-ID and billing-increment mix, and the five cheapest routes as anonymous facts (price, caller ID, increment, stated ASR). The ASR here is the one the seller states; measured figures per listing are on GET /routes (`measured`). 404 when the destination has no live route of that type. Cached like the list.\n\n**Auth:** none (public endpoint).","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/PricingDestinationDetail"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"public","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9-]{1,80}$"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["voice","sms"],"default":"voice"}}]}},"/api/v1/purchases":{"post":{"operationId":"postPurchases","tags":["Routes, marketplace and pricing"],"summary":"Buy access to a marketplace route","description":"No upfront cost: usage is billed per minute or message from your balance. Requires a LIVE API key: a test key is refused with 400.\n\n**Auth:** API key or JWT. Scoped keys need `purchases:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"buyerId":{"type":"string","format":"uuid","description":"Your account id"},"routeId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["active","paused","cancelled","pending_review"]},"sipUsername":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"cancelledAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"agreedPrice":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Negotiated price (from an accepted offer) that overrides the list price"},"heldOldRate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"Set while the purchase is paused by a seller rate increase: the rate you were paying"},"heldNewRate":{"allOf":[{"$ref":"#/components/schemas/Money"}],"nullable":true,"description":"The increased rate waiting for your acceptance"},"routingPriority":{"type":"integer","nullable":true,"description":"Your routing position (1 = first); null = unranked"},"requiresUsCompliance":{"type":"boolean","description":"A US voice route that needs STIR/SHAKEN review before traffic flows"},"reviewedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"reviewNote":{"type":"string","nullable":true,"description":"The compliance reviewer's note to you, if any"},"sipPasswordSet":{"type":"boolean","description":"Whether a SIP password exists. The value is not returned here: it is shown once at purchase, on your purchased-routes list and on Interconnections."},"smppSystemId":{"type":"string","nullable":true},"offerId":{"type":"string","format":"uuid","nullable":true,"description":"The accepted offer that set agreedPrice"},"route":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["voice","sms"]},"country":{"type":"string"},"destinationName":{"type":"string","description":"The listing name as a buyer reads it: generated by the platform, never the seller's text, and ending in the listing reference (e.g. \"Niger Mobile · Ref 7K2Q\", \"A-Z Voice · Premium · Full CLI · Ref 3MX9\"). Your own listings keep the name you gave them."},"listingRef":{"type":"string","description":"Anonymous short reference of the listing (4 characters, e.g. \"7K2Q\"): stable for the life of the listing, unique enough to tell two same-named listings apart, and derived from the listing alone (it says nothing about the seller). Absent on your own listings."},"pricePerUnit":{"$ref":"#/components/schemas/Money"},"billingIncrement":{"type":"string","nullable":true}},"required":["id","type","country","destinationName","listingRef","pricePerUnit","billingIncrement"],"nullable":true},"sipPublicIp":{"type":"string","description":"Where to send your SIP traffic"},"sipPassword":{"type":"string","nullable":true,"description":"Plaintext SIP password, returned once here"},"pendingCompliance":{"type":"boolean","description":"True when US STIR/SHAKEN compliance review must finish before traffic flows"}},"required":["id","buyerId","routeId","status","sipUsername","createdAt","cancelledAt","agreedPrice","heldOldRate","heldNewRate","routingPriority","requiresUsCompliance","reviewedAt","reviewNote","sipPasswordSet","smppSystemId","offerId","route","sipPublicIp","sipPassword","pendingCompliance"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"purchases:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"routeId":{"type":"string","format":"uuid"},"alertsForDestination":{"type":"boolean","description":"Follow this destination for new routes and price changes (default true). Multi-country decks follow nothing. Manage under /account/destination-alerts."}},"required":["routeId"]}}}},"x-px-billable":{"kind":"money","note":"Buys access to a marketplace route."}},"get":{"operationId":"getPurchases","tags":["Routes, marketplace and pricing"],"summary":"List your route purchases","description":"**Auth:** API key or JWT. Not available to scoped keys. Use a full-access key or a dashboard session.","responses":{"200":{"description":"One page of results, newest first.","content":{"application/json":{"schema":{"type":"object","required":["success","data","nextCursor","hasMore"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Purchase"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to fetch the next page; null on the last page."},"hasMore":{"type":"boolean","description":"True when another page exists."}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","cancelled"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}]}},"/api/v1/account/webhooks":{"get":{"operationId":"getAccountWebhooks","tags":["Webhooks"],"summary":"List your webhook endpoints","description":"Secrets are redacted to their last 4 characters.\n\n**Auth:** API key or JWT. Scoped keys need `account:read`.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"account:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}]},"post":{"operationId":"postAccountWebhooks","tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"The signing secret is returned ONCE in `secret`. URLs must be https and resolve to a public address. Works from a dashboard session, or with an API key that was created with the `webhooks:write` permission. A full-access key does not include `webhooks:write`: it has to be chosen explicitly, so keys issued before this permission existed cannot manage endpoints.\n\nEach delivery is a POST of `{ event, data, timestamp }` with headers `X-Webhook-Event`, `X-Webhook-Id` (the delivery id), `X-PX-Timestamp` (Unix seconds at send time) and two signatures: `X-PX-Signature: v1=<hex HMAC-SHA256 of \"<timestamp>.<raw body>\">` (verify this one, and reject timestamps more than 5 minutes old to stop replays) and the legacy `X-Webhook-Signature: sha256=<hex HMAC-SHA256 of the raw body>`, kept during the transition.\n\n**Auth:** API key or JWT. Scoped keys need `webhooks:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/WebhookWithSecret"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"webhooks:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"]},"minItems":1}},"required":["url","events"]}}}}}},"/api/v1/account/webhooks/{id}":{"patch":{"operationId":"patchAccountWebhooksById","tags":["Webhooks"],"summary":"Update a webhook endpoint","description":"Change the URL, the subscribed events or `isActive`. The signing secret and delivery history are kept. Works from a dashboard session, or with an API key that was created with the `webhooks:write` permission. A full-access key does not include `webhooks:write`: it has to be chosen explicitly, so keys issued before this permission existed cannot manage endpoints.\n\n**Auth:** API key or JWT. Scoped keys need `webhooks:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Webhook"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"webhooks:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"]},"minItems":1},"isActive":{"type":"boolean"}}}}}}},"delete":{"operationId":"deleteAccountWebhooksById","tags":["Webhooks"],"summary":"Delete a webhook endpoint","description":"Removes the endpoint, its secret and its delivery history. Events stop immediately. Works from a dashboard session, or with an API key that was created with the `webhooks:write` permission. A full-access key does not include `webhooks:write`: it has to be chosen explicitly, so keys issued before this permission existed cannot manage endpoints.\n\n**Auth:** API key or JWT. Scoped keys need `webhooks:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"webhooks:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/account/webhooks/{id}/test":{"post":{"operationId":"postAccountWebhooksByIdTest","tags":["Webhooks"],"summary":"Send a test ping to a webhook endpoint","description":"Queues a `ping` delivery, signed like any other, usually delivered within 15 seconds.\n\n**Auth:** API key or JWT. Scoped keys need `account:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"202":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","sending","delivered","failed"]},"event":{"type":"string","enum":["ping"]}},"required":["id","status","event"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"account:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/account/webhooks/{id}/rotate-secret":{"post":{"operationId":"postAccountWebhooksByIdRotateSecret","tags":["Webhooks"],"summary":"Rotate a webhook signing secret","description":"Issues a new secret, returned once. Deliveries are signed with it from this moment (including pending retries); there is no overlap window, so update your receiver at the same time. Works from a dashboard session, or with an API key that was created with the `webhooks:write` permission. A full-access key does not include `webhooks:write`: it has to be chosen explicitly, so keys issued before this permission existed cannot manage endpoints.\n\n**Auth:** API key or JWT. Scoped keys need `webhooks:write`.\n\n**Test keys:** refused with 403 `TEST_KEY_NOT_ALLOWED`. This action has no test mode, so it would change your live account. Use a live key.","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secretLast4":{"type":"string","description":"Last 4 characters of the signing secret, to tell secrets apart"},"events":{"type":"array","items":{"type":"string","enum":["call.completed","call.ringing","call.answered","call.gathered","call.recording.completed","sms.sent","sms.dlr","sms.delivered","sms.failed","sms.scheduled","sms.canceled","campaign.started","campaign.completed","topup.confirmed","balance.low","offer.received","route.purchased","sub_account.balance_low","sub_account.suspended","sub_account.resumed","sub_account.topup_requested","number.call.received","number.sms.received","number.voicemail.received","verification.approved","verification.expired","verification.canceled","invoice.created","invoice.issued","invoice.sent","invoice.voided","invoice.reissued","invoice.payment","credit_note.issued","payable.created","netting.run","sell_rate.changed","cost_rate.scheduled","cost_rate.activated","cost_rate.rolled_back","sub_account.margin_below_floor","revshare.call.received","revshare.number.taken","revshare.number.released","ping"]}},"isActive":{"type":"boolean","description":"False when you disabled it, or after sustained delivery failures"},"failureCount":{"type":"integer","description":"Consecutive failed deliveries; resets on success"},"lastDeliveryAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)","nullable":true},"createdAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"updatedAt":{"type":"string","format":"date-time","description":"ISO-8601 timestamp (UTC)"},"secret":{"type":"string","description":"The signing secret. Returned ONCE; store it now."},"message":{"type":"string"}},"required":["id","url","secretLast4","events","isActive","failureCount","lastDeliveryAt","createdAt","updatedAt","secret","message"]}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}},"x-auth":"key","x-required-scope":"webhooks:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}}}}