Skip to content

API reference

Application Manager

Operate retail sub-accounts: provisioning, credit and routing.

24 operationsBase URL https://packetexchange.io/api/v1Postman collection
BrowseApplication Manager

Get reseller analytics across your sub-accounts

GET/api/v1/application/analytics

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Headline totals and quality, a daily series, per-sub-account margin and top destinations. Figures are JSON numbers (analytics rollups, not ledger entries).

Parameters

  • days

    query · integer

    Trailing window in days (default 30)

Response 200

  • datarequired

    object

  • periodrequired

    object · data.period

  • daysrequired

    integer · data.period.days

  • summaryrequired

    object · data.summary

  • callsrequired

    integer · data.summary.calls

  • smsrequired

    integer · data.summary.sms

  • minutesrequired

    integer · data.summary.minutes

  • revenuerequired

    number · data.summary.revenue

    USD, JSON number (analytics rollup)
  • marginrequired

    number · data.summary.margin

    USD, JSON number (analytics rollup)
  • asrrequired

    number | null · data.summary.asr

    Answer rate percent over customer sessions; null with no calls
  • acdrequired

    number · data.summary.acd

  • carrierCostrequired

    number · data.summary.carrierCost

  • activeSubsrequired

    integer · data.summary.activeSubs

  • timeseriesrequired

    object[] · data.timeseries

  • daterequired

    string · data.timeseries[].date

    YYYY-MM-DD
  • callsrequired

    integer · data.timeseries[].calls

  • smsrequired

    integer · data.timeseries[].sms

  • revenuerequired

    number · data.timeseries[].revenue

  • marginrequired

    number · data.timeseries[].margin

  • bySubAccountrequired

    object[] · data.bySubAccount

  • byRouterequired

    object[] · data.byRoute

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get your Application Manager settings

GET/api/v1/application/settings

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Created with defaults on first read.

Response 200

  • datarequired

    object

  • operatorIdrequired

    string (uuid) · data.operatorId

  • defaultMarkupPctrequired

    string · data.defaultMarkupPct

  • defaultBillingIncrementrequired

    string · data.defaultBillingIncrement

  • minMarginPctrequired

    string · data.minMarginPct

  • subLowBalanceThresholdrequired

    string · data.subLowBalanceThreshold

    "0.00" disables low-balance alerts
  • defaultDailySpendCaprequired

    string | null · data.defaultDailySpendCap

    US dollars as a decimal string with 2 decimal places, e.g. "50.00"
  • defaultMaxConcurrentCallsrequired

    integer | null · data.defaultMaxConcurrentCalls

  • brandNamerequired

    string | null · data.brandName

  • brandColorrequired

    string | null · data.brandColor

  • brandLogoUrlrequired

    string | null · data.brandLogoUrl

  • requireTrunkApprovalrequired

    boolean · data.requireTrunkApproval

  • requireTrunkReadinessrequired

    boolean · data.requireTrunkReadiness

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Update your Application Manager settings

PUT/api/v1/application/settings

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Default markup, low-balance threshold, default fraud caps and portal branding. Send only what changes.

Request body (application/json)

  • defaultMarkupPct

    number

    0 to 100000
  • subLowBalanceThreshold

    number

    0 to 1000000
  • defaultDailySpendCap

    number | null

    0 to 1000000
  • defaultMaxConcurrentCalls

    integer | null

    0 to 100000
  • brandName

    string | null

    max 120 chars
  • brandColor

    string | null

    max 9 chars
  • brandLogoUrl

    string (uri) | null

    max 500 chars

Response 200

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get sub-account totals

GET/api/v1/application/overview

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Response 200

  • datarequired

    object

  • subCountrequired

    integer · data.subCount

  • activeSubCountrequired

    integer · data.activeSubCount

  • aggregateBalancerequired

    number · data.aggregateBalance

    Sum of sub-account balances, USD as a JSON number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List your sub-accounts

GET/api/v1/application/sub-accounts

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Newest first, cursor-paginated and searchable by label or external reference. total counts every match.

Parameters

  • cursor

    query · string (uuid)

  • limit

    query · integer

    Default 50
  • search

    query · string

  • status

    query · string

    One of draft, active, suspended, closed
  • lowBalanceOnly

    query · string

    One of true, 1

Response 200

  • datarequired

    object[]

  • idrequired

    string (uuid) · data[].id

  • labelrequired

    string · data[].label

  • externalRefrequired

    string | null · data[].externalRef

  • balancerequired

    money · data[].balance

    USD as a decimal string with exactly 6 places, e.g. "0.012500".
  • statusrequired

    string · data[].status

    One of draft, active, suspended, closed
  • markupPctrequired

    string | null · data[].markupPct

    Markup percent as a 3-decimal string; null = operator default
  • dailySpendCaprequired

    string | null · data[].dailySpendCap

    null = operator default; "0.00" = unlimited
  • maxConcurrentCallsrequired

    integer | null · data[].maxConcurrentCalls

  • creditLimitrequired

    string · data[].creditLimit

    Postpaid credit, "0.00" = strict prepaid
  • currencyrequired

    string · data[].currency

    Display currency for statementsmax 3 chars
  • portalEmailrequired

    string | null · data[].portalEmail

  • autoSuspendedrequired

    boolean · data[].autoSuspended

    Suspended automatically by a daily cap, lifts itself
  • sipUsernamerequired

    string | null · data[].sipUsername

  • createdAtrequired

    string (date-time) · data[].createdAt

    ISO-8601 timestamp (UTC)
  • updatedAtrequired

    string (date-time) · data[].updatedAt

    ISO-8601 timestamp (UTC)
  • lowBalancerequired

    boolean · data[].lowBalance

  • nextCursor

    string | null

  • hasMore

    boolean

  • total

    integer

  • lowBalanceThreshold

    number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Create a sub-account

POST/api/v1/application/sub-accounts

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Provisions its SIP credentials and one API key, both returned ONCE. Requires an active route purchase or an active route of your own.

Request body (application/json)

  • labelrequired

    string

    max 255 chars
  • externalRef

    string | null

    max 10000 chars
  • markupPct

    number | null

    0 to 100000
  • dailySpendCap

    number | null

    0 to 1000000
  • maxConcurrentCalls

    integer | null

    0 to 100000
  • creditLimit

    number | null

    0 to 10000000
  • currency

    string

    max 3 chars

Response 201

  • datarequired

    object

  • idrequired

    string (uuid) · data.id

  • labelrequired

    string · data.label

  • externalRefrequired

    string | null · data.externalRef

  • balancerequired

    money · data.balance

    USD as a decimal string with exactly 6 places, e.g. "0.012500".
  • statusrequired

    string · data.status

    One of draft, active, suspended, closed
  • markupPctrequired

    string | null · data.markupPct

    Markup percent as a 3-decimal string; null = operator default
  • dailySpendCaprequired

    string | null · data.dailySpendCap

    null = operator default; "0.00" = unlimited
  • maxConcurrentCallsrequired

    integer | null · data.maxConcurrentCalls

  • creditLimitrequired

    string · data.creditLimit

    Postpaid credit, "0.00" = strict prepaid
  • currencyrequired

    string · data.currency

    Display currency for statementsmax 3 chars
  • portalEmailrequired

    string | null · data.portalEmail

  • autoSuspendedrequired

    boolean · data.autoSuspended

    Suspended automatically by a daily cap, lifts itself
  • sipUsernamerequired

    string | null · data.sipUsername

  • createdAtrequired

    string (date-time) · data.createdAt

    ISO-8601 timestamp (UTC)
  • updatedAtrequired

    string (date-time) · data.updatedAt

    ISO-8601 timestamp (UTC)
  • apiKeyrequired

    string · data.apiKey

    The sub-account API key. Returned ONCE.
  • apiKeyPrefixrequired

    string · data.apiKeyPrefix

  • sipPasswordrequired

    string · data.sipPassword

    The SIP password. Returned ONCE.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Create up to 100 sub-accounts at once

POST/api/v1/application/sub-accounts/bulk

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Each item is created independently, so one bad row does not fail the batch. Each created entry carries its one-time credentials.

Request body (application/json)

  • subAccountsrequired

    object[]

  • labelrequired

    string · subAccounts[].label

    max 255 chars
  • externalRef

    string | null · subAccounts[].externalRef

    max 10000 chars
  • markupPct

    number | null · subAccounts[].markupPct

    0 to 100000
  • dailySpendCap

    number | null · subAccounts[].dailySpendCap

    0 to 1000000
  • maxConcurrentCalls

    integer | null · subAccounts[].maxConcurrentCalls

    0 to 100000
  • creditLimit

    number | null · subAccounts[].creditLimit

    0 to 10000000
  • currency

    string · subAccounts[].currency

    max 3 chars

Response 201

  • datarequired

    object

  • createdrequired

    object[] · data.created

    Same fields as SubAccountCreated, shown earlier on this page.
  • failedrequired

    object[] · data.failed

  • labelrequired

    string · data.failed[].label

  • errorrequired

    string · data.failed[].error

  • requestedrequired

    integer · data.requested

  • createdCountrequired

    integer · data.createdCount

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get a sub-account

GET/api/v1/application/sub-accounts/{id}

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

Response 200

  • datarequired

    object

  • idrequired

    string (uuid) · data.id

  • labelrequired

    string · data.label

  • externalRefrequired

    string | null · data.externalRef

  • balancerequired

    money · data.balance

    USD as a decimal string with exactly 6 places, e.g. "0.012500".
  • statusrequired

    string · data.status

    One of draft, active, suspended, closed
  • markupPctrequired

    string | null · data.markupPct

    Markup percent as a 3-decimal string; null = operator default
  • dailySpendCaprequired

    string | null · data.dailySpendCap

    null = operator default; "0.00" = unlimited
  • maxConcurrentCallsrequired

    integer | null · data.maxConcurrentCalls

  • creditLimitrequired

    string · data.creditLimit

    Postpaid credit, "0.00" = strict prepaid
  • currencyrequired

    string · data.currency

    Display currency for statementsmax 3 chars
  • portalEmailrequired

    string | null · data.portalEmail

  • autoSuspendedrequired

    boolean · data.autoSuspended

    Suspended automatically by a daily cap, lifts itself
  • sipUsernamerequired

    string | null · data.sipUsername

  • createdAtrequired

    string (date-time) · data.createdAt

    ISO-8601 timestamp (UTC)
  • updatedAtrequired

    string (date-time) · data.updatedAt

    ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Update a sub-account

PATCH/api/v1/application/sub-accounts/{id}

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Suspending or closing revokes its API keys and stops its campaigns.

Parameters

  • idrequired

    path · string

Request body (application/json)

  • label

    string

    max 255 chars
  • status

    string

    One of active, suspended, closed
  • markupPct

    number | null

    0 to 100000
  • dailySpendCap

    number | null

    0 to 1000000
  • maxConcurrentCalls

    integer | null

    0 to 100000
  • creditLimit

    number | null

    0 to 10000000
  • currency

    string

    max 3 chars

Response 200

  • datarequired

    object

    Same fields as SubAccount, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Fund a sub-account from your balance

POST/api/v1/application/sub-accounts/{id}/credit

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)
Safe retries
Send X-Idempotency-Key; a replay within 24 hours returns the first response.
Moves money
Moves money between your balance and a sub-account.

Moves money from your balance into the sub-account. Only active sub-accounts can be funded.

Parameters

  • idrequired

    path · string

  • X-Idempotency-Key

    header · string

    Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.

Request body (application/json)

  • amountrequired

    number

    min 0

Response 200

  • datarequired

    object

  • operatorBalancerequired

    number | null · data.operatorBalance

    Your balance after the transfer, as a JSON number; null when your balance did not move
  • subBalancerequired

    number · data.subBalance

    The sub-account balance after the transfer, as a JSON number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Return funds from a sub-account to your balance

POST/api/v1/application/sub-accounts/{id}/debit

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)
Safe retries
Send X-Idempotency-Key; a replay within 24 hours returns the first response.
Moves money
Moves money between your balance and a sub-account.

Works on closed sub-accounts too, so a balance can be handed back after closure.

Parameters

  • idrequired

    path · string

  • X-Idempotency-Key

    header · string

    Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.

Request body (application/json)

  • amountrequired

    number

    min 0
  • reasonrequired

    string

    max 500 chars

Response 200

  • datarequired

    object

  • operatorBalancerequired

    number | null · data.operatorBalance

    Your balance after the transfer, as a JSON number; null when your balance did not move
  • subBalancerequired

    number · data.subBalance

    The sub-account balance after the transfer, as a JSON number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Record a payment a sub-account made to you

POST/api/v1/application/sub-accounts/{id}/payment

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)
Safe retries
Send X-Idempotency-Key; a replay within 24 hours returns the first response.
Moves money
Moves money between your balance and a sub-account.

Credits the sub-account for money it paid you outside the platform. Your own balance does not move.

Parameters

  • idrequired

    path · string

  • X-Idempotency-Key

    header · string

    Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.

Request body (application/json)

  • amountrequired

    number

    min 0
  • reason

    string

    max 500 chars

Response 200

  • datarequired

    object

  • operatorBalancerequired

    number | null · data.operatorBalance

    Your balance after the transfer, as a JSON number; null when your balance did not move
  • subBalancerequired

    number · data.subBalance

    The sub-account balance after the transfer, as a JSON number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Reverse a recorded sub-account payment

POST/api/v1/application/sub-accounts/{id}/payment-correction

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)
Safe retries
Send X-Idempotency-Key; a replay within 24 hours returns the first response.
Moves money
Moves money between your balance and a sub-account.

Debits the sub-account to correct a payment recorded in error. Your own balance does not move.

Parameters

  • idrequired

    path · string

  • X-Idempotency-Key

    header · string

    Any unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.

Request body (application/json)

  • amountrequired

    number

    min 0
  • reasonrequired

    string

    max 500 chars

Response 200

  • datarequired

    object

  • operatorBalancerequired

    number | null · data.operatorBalance

    Your balance after the transfer, as a JSON number; null when your balance did not move
  • subBalancerequired

    number · data.subBalance

    The sub-account balance after the transfer, as a JSON number

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List a sub-account's API keys

GET/api/v1/application/sub-accounts/{id}/api-keys

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

Response 200

  • datarequired

    object[]

  • idrequired

    string (uuid) · data[].id

  • keyPrefixrequired

    string · data[].keyPrefix

  • labelrequired

    string · data[].label

  • lastUsedAtrequired

    string (date-time) | null · data[].lastUsedAt

    ISO-8601 timestamp (UTC)
  • createdAtrequired

    string (date-time) · data[].createdAt

    ISO-8601 timestamp (UTC)
  • expiresAtrequired

    string (date-time) | null · data[].expiresAt

    ISO-8601 timestamp (UTC)

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Issue an API key for a sub-account

POST/api/v1/application/sub-accounts/{id}/api-keys

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

The key is returned ONCE. It can reach only the sub-account traffic endpoints.

Parameters

  • idrequired

    path · string

Response 201

  • datarequired

    object

  • idrequired

    string (uuid) · data.id

  • apiKeyrequired

    string · data.apiKey

  • prefixrequired

    string · data.prefix

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Revoke a sub-account API key

DELETE/api/v1/application/sub-accounts/{id}/api-keys/{keyId}

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

  • keyIdrequired

    path · string

Response 200

  • datarequired

    object

  • revokedrequired

    boolean · data.revoked

    One of true

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Set a sub-account's portal email and send a sign-in link

POST/api/v1/application/sub-accounts/{id}/portal-invite

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)
Sends email
Sends an email to a third party.

Send email: null to clear it. The link is only emailed to active sub-accounts.

Parameters

  • idrequired

    path · string

Request body (application/json)

  • emailrequired

    string (email) | null

    max 255 chars
  • sendInvite

    boolean

    default true

Response 200

  • datarequired

    object

    Same fields as SubAccount, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Close a sub-account

POST/api/v1/application/sub-accounts/{id}/close

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Ends service: revokes its keys and stops its campaigns. No money moves; return any balance separately with the debit endpoint. Idempotent.

Parameters

  • idrequired

    path · string

Response 200

  • datarequired

    object

    Same fields as SubAccount, shown earlier on this page.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Regenerate a sub-account SIP password

POST/api/v1/application/sub-accounts/{id}/sip-password

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

The new password is returned ONCE; the old one stops working immediately.

Parameters

  • idrequired

    path · string

Response 201

  • datarequired

    object

  • sipUsernamerequired

    string | null · data.sipUsername

  • sipPasswordrequired

    string · data.sipPassword

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 409CONFLICT (or a code-specific 409): the change clashes with existing state.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get lifetime usage for a sub-account

GET/api/v1/application/sub-accounts/{id}/usage

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

Response 200

  • datarequired

    object

  • recordsrequired

    integer · data.records

  • totalCostrequired

    number · data.totalCost

    USD as a JSON number
  • totalSecondsrequired

    integer · data.totalSeconds

  • totalSegmentsrequired

    integer · data.totalSegments

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get analytics for one sub-account

GET/api/v1/application/sub-accounts/{id}/analytics

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

  • days

    query · integer

    Trailing window in days (default 30)

Response 200

  • datarequired

    object

  • periodrequired

    object · data.period

  • daysrequired

    integer · data.period.days

  • summaryrequired

    object · data.summary

  • callsrequired

    integer · data.summary.calls

  • smsrequired

    integer · data.summary.sms

  • minutesrequired

    integer · data.summary.minutes

  • revenuerequired

    number · data.summary.revenue

    USD, JSON number (analytics rollup)
  • marginrequired

    number · data.summary.margin

    USD, JSON number (analytics rollup)
  • asrrequired

    number | null · data.summary.asr

    Answer rate percent over customer sessions; null with no calls
  • acdrequired

    number · data.summary.acd

  • timeseriesrequired

    object[] · data.timeseries

  • daterequired

    string · data.timeseries[].date

    YYYY-MM-DD
  • callsrequired

    integer · data.timeseries[].calls

  • smsrequired

    integer · data.timeseries[].sms

  • revenuerequired

    number · data.timeseries[].revenue

  • marginrequired

    number · data.timeseries[].margin

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

List call records for a sub-account

GET/api/v1/application/sub-accounts/{id}/cdrs

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Newest first, offset-paginated.

Parameters

  • idrequired

    path · string

  • limit

    query · integer

    Default 50
  • offset

    query · integer

    Default 0
  • kind

    query · string

    One of voice, sms

Response 200

  • datarequired

    object[]

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Get a monthly statement for a sub-account

GET/api/v1/application/sub-accounts/{id}/statement

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Spend in USD and in the sub-account's display currency, split by voice and SMS, with a resale-tax block. Derived, not stored.

Parameters

  • idrequired

    path · string

  • monthrequired

    query · string

    YYYY-MM

Response 200

  • datarequired

    object

  • subAccountIdrequired

    string (uuid) · data.subAccountId

  • labelrequired

    string · data.label

  • monthrequired

    string · data.month

  • periodStartrequired

    string (date-time) · data.periodStart

    ISO-8601 timestamp (UTC)
  • periodEndrequired

    string (date-time) · data.periodEnd

    ISO-8601 timestamp (UTC)
  • currencyrequired

    string · data.currency

  • fxRaterequired

    number · data.fxRate

  • recordsrequired

    integer · data.records

  • spendrequired

    object · data.spend

  • usdrequired

    number · data.spend.usd

  • inCurrencyrequired

    number · data.spend.inCurrency

  • byKindrequired

    object · data.byKind

  • voicerequired

    object · data.byKind.voice

  • usdrequired

    number · data.byKind.voice.usd

  • inCurrencyrequired

    number · data.byKind.voice.inCurrency

  • smsrequired

    object · data.byKind.sms

  • usdrequired

    number · data.byKind.sms.usd

  • inCurrencyrequired

    number · data.byKind.sms.inCurrency

  • taxrequired

    object · data.tax

    base, ratePct, taxAmount, total, treatment, label, note

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.

Export a sub-account's call records as CSV

GET/api/v1/application/sub-accounts/{id}/cdrs/export

Access
API key. Scoped keys need application:write.
Rate limit
100 requests per second (the default)

Parameters

  • idrequired

    path · string

Response 200 (text/csv)

Every call record for the sub-account, as CSV.

Errors

  • 400VALIDATION_ERROR, INVALID_INPUT or BAD_REQUEST. For VALIDATION_ERROR, error.details is an array of { path, message }.
  • 401UNAUTHORIZED: missing, invalid, expired or revoked credential.
  • 403FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only.
  • 404NOT_FOUND: no such resource on your account.
  • 429RATE_LIMITED: slow down and retry after the Retry-After seconds.
  • 500INTERNAL_ERROR: unexpected failure. Quote X-Request-Id to support.