Skip to content
Markets open

Switch API reference

Switch: customers

Customers you sell to: accounts, balances, credit, contacts and lifecycle.

61 operationsBase URL https://packetexchange.io/api/v1Postman collection

BrowseSwitch: customers

Get a Switch customer routing assignment

GET/api/v1/switch/customers/{id}/routing

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
subAccountIdrequireddata.subAccountIdstring (uuid)-
customerTrunkIddata.customerTrunkIdstring (uuid) | null-
dialplanIdrequireddata.dialplanIdstring (uuid) | null-
routePlanIdrequireddata.routePlanIdstring (uuid) | null-
failoverRoutePlanIdrequireddata.failoverRoutePlanIdstring (uuid) | null-
strategyOverriderequireddata.strategyOverridestring | null-
directRouteIdrequireddata.directRouteIdstring (uuid) | null-
directVendorTrunkIdrequireddata.directVendorTrunkIdstring (uuid) | null-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Assign routing to a Switch customer

POST/api/v1/switch/customers/{id}/routing

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

Sets the dialplan, route group, failover group, strategy or a direct supplier on the customer's first trunk. Use the per-trunk routing endpoint for a specific trunk. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
dialplanIdstring (uuid) | null-
routePlanIdstring (uuid) | null-
failoverRoutePlanIdstring (uuid) | null-
strategyOverridestring | null-One of cheapest, best_quality, balanced
directRouteIdstring (uuid) | null-
directVendorTrunkIdstring (uuid) | null-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerRoutingAssignment, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List a Switch customer trunks with traffic

GET/api/v1/switch/customers/{id}/trunks

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

Each trunk with its authentication readiness, identification, addresses, routing, inherited limits and traffic over the chosen period.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
scopequerystringDefault operational (excludes archived)One of operational, archived, all
periodHoursqueryintegerWindow for the traffic figures; unrecognised values fall back to 24

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
subAccountIdrequireddata[].subAccountIdstring (uuid)The customer this trunk belongs to
labelrequireddata[].labelstring-
statusrequireddata[].statusstring-One of active, disabled, archived
authModedata[].authModestring-One of ip, credentials, ip_and_credentials, registration, certificate
sipUsernamerequireddata[].sipUsernamestring | null-
sipPasswordSetrequireddata[].sipPasswordSetboolean-
maxConcurrentCallsrequireddata[].maxConcurrentCallsinteger | nullNull inherits the customer ceiling
maxCpsrequireddata[].maxCpsinteger | null-
markupPctrequireddata[].markupPctstring | null-
billingIncrementrequireddata[].billingIncrementstring | null-
techPrefixrequireddata[].techPrefixstring | null-
mediaModedata[].mediaModestring-One of proxy, direct
cliRewriterequireddata[].cliRewriteobject | null-
allowedPrefixesrequireddata[].allowedPrefixesstring[] | null-
allowedCountriesrequireddata[].allowedCountriesstring[] | null-
blockedCountriesrequireddata[].blockedCountriesstring[] | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)
authenticationrequireddata[].authenticationobject-
moderequireddata[].authentication.modestring-One of ip, credentials, ip_and_credentials, registration, certificate
titlerequireddata[].authentication.titlestring-
summaryrequireddata[].authentication.summarystring-
sendsrequireddata[].authentication.sendsstring[]-
checksrequireddata[].authentication.checksstring[]-
gapsrequireddata[].authentication.gapsstring[]Empty when the trunk is configured for its declared mode
enforcedrequireddata[].authentication.enforcedboolean-
identificationrequireddata[].identificationobject-
namedByrequireddata[].identification.namedBystring[]-
uniquerequireddata[].identification.uniqueboolean-
noterequireddata[].identification.notestring | null-
allowedIpsrequireddata[].allowedIpsstring[]-
allowedAddressesrequireddata[].allowedAddressesobject[]-
idrequireddata[].allowedAddresses[].idstring (uuid)-
cidrrequireddata[].allowedAddresses[].cidrstring-
routingrequireddata[].routingobject | null-
inheritedrequireddata[].inheritedobject-
fromrequireddata[].inherited.fromstring-One of customer
maxConcurrentCallsrequireddata[].inherited.maxConcurrentCallsinteger | null-
maxCpsrequireddata[].inherited.maxCpsinteger | null-
billingIncrementrequireddata[].inherited.billingIncrementstring | null-
last24hrequireddata[].last24hobject-
callsrequireddata[].last24h.callsinteger-
minutesrequireddata[].last24h.minutesnumber-
revenuerequireddata[].last24h.revenuenumberUS dollars as a JSON number (computed figure)
perioddata[].periodanyThe window the traffic figures cover
trafficrequireddata[].trafficobject-
callsrequireddata[].traffic.callsinteger-
answeredrequireddata[].traffic.answeredinteger-
minutesrequireddata[].traffic.minutesnumber-
revenuerequireddata[].traffic.revenuenumberUS dollars as a JSON number (computed figure)
marginrequireddata[].traffic.marginnumberUS dollars as a JSON number (computed figure)
asrrequireddata[].traffic.asrnumber | null-
pddMsrequireddata[].traffic.pddMsnumber | null-
refusedrequireddata[].refusedobject-
forbiddenrequireddata[].refused.forbiddeninteger-
capacityrequireddata[].refused.capacityinteger-
capacityChannelsrequireddata[].refused.capacityChannelsinteger-
capacityCpsrequireddata[].refused.capacityCpsinteger-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Add a trunk to a Switch customer

POST/api/v1/switch/customers/{id}/trunks

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

If sipPassword is set it is echoed back ONCE in the response.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
labelstring-max 120 chars
authModestringWhat the customer must present; the service refuses a mode the trunk is not configured forOne of ip, credentials, ip_and_credentials, registration, certificate
sipUsernamestring | null-max 64 chars
sipPasswordstring | null-max 64 chars
maxConcurrentCallsinteger | null-0 to 100000
maxCpsinteger | null-0 to 10000
markupPctnumber | null-0 to 10000
billingIncrementstring | null-max 10 chars
blockedPrefixesstring | null-max 8000 chars
statusstring-One of active, disabled
mediaModestring-One of proxy, direct
techPrefixstring | null-max 24 chars
cliRewriteobject | null-
modecliRewrite.modestring-One of pattern
valuecliRewrite.valuestring-max 24 chars
stripcliRewrite.stripinteger-0 to 15
addcliRewrite.addstring-max 12 chars
matchcliRewrite.matchstring-max 200 chars
replacecliRewrite.replacestring-max 200 chars
allowedPrefixesstring[] | null-
allowedCountriesstring[] | null-
blockedCountriesstring[] | null-
maxCallDurationSecondsinteger | null-1 to 21600
requireCliboolean-
allowedClisstring[] | null-
marginProtectionModestring-One of off, monitor, enforce
minMarginPctnumber | null-0 to 99.999
minMarginAbsnumber | null-0 to 1000
maxLossPerMinutenumber | null-0 to 1000
dailyLossLimitnumber | nullWarns only; never blocks0 to 10000000
dailyLossLimitPctnumber | null-0 to 100000

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
subAccountIdrequireddata.subAccountIdstring (uuid)The customer this trunk belongs to
labelrequireddata.labelstring-
statusrequireddata.statusstring-One of active, disabled, archived
authModedata.authModestring-One of ip, credentials, ip_and_credentials, registration, certificate
sipUsernamerequireddata.sipUsernamestring | null-
maxConcurrentCallsrequireddata.maxConcurrentCallsinteger | nullNull inherits the customer ceiling
maxCpsrequireddata.maxCpsinteger | null-
markupPctrequireddata.markupPctstring | null-
billingIncrementrequireddata.billingIncrementstring | null-
techPrefixrequireddata.techPrefixstring | null-
mediaModedata.mediaModestring-One of proxy, direct
cliRewriterequireddata.cliRewriteobject | null-
allowedPrefixesrequireddata.allowedPrefixesstring[] | null-
allowedCountriesrequireddata.allowedCountriesstring[] | null-
blockedCountriesrequireddata.blockedCountriesstring[] | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
sipPasswordrequireddata.sipPasswordstring | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List your Switch customers with live and 24-hour figures

GET/api/v1/switch/customers

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

Every customer with trunk health, live calls, 24-hour traffic, credit used, primary contact and problem flags.

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
labelrequireddata[].labelstring-
sourcerequireddata[].sourcestring-One of marketplace, external
statusrequireddata[].statusstring-One of draft, active, suspended, closed
externalRefrequireddata[].externalRefstring | null-
balancerequireddata[].balancemoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
creditLimitrequireddata[].creditLimitstringUSD decimal string as stored (2 decimal places), e.g. "5000.00"
currencyrequireddata[].currencystring | null-
sipUsernamerequireddata[].sipUsernamestring | null-
portalEmailrequireddata[].portalEmailstring | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
trunkCountrequireddata[].trunkCountintegerTrunks excluding archived ones
trunksUprequireddata[].trunksUpinteger-
trunksDownrequireddata[].trunksDowninteger-
liveCallsrequireddata[].liveCallsinteger-
calls24hrequireddata[].calls24hinteger-
answered24hrequireddata[].answered24hinteger-
asr24hrequireddata[].asr24hnumber | nullPercent; null when no calls ran (not 0)
revenue24hrequireddata[].revenue24hnumberUS dollars as a JSON number (computed figure)
margin24hrequireddata[].margin24hnumberUS dollars as a JSON number (computed figure)
marginPct24hrequireddata[].marginPct24hnumber | null-
pddMs24hrequireddata[].pddMs24hnumber | null-
creditUsedPctrequireddata[].creditUsedPctnumber | null-
contactrequireddata[].contactobject | null-
namerequireddata[].contact.namestring-
emailrequireddata[].contact.emailstring | null-
phonerequireddata[].contact.phonestring | null-
attentionrequireddata[].attentionobject | nullOpen operational issues. Null means the check could not run, not that nothing is wrong.
highestrequireddata[].attention.higheststring | null-
openrequireddata[].attention.openinteger-
unacknowledgedrequireddata[].attention.unacknowledgedinteger-
refsrequireddata[].attention.refsstring[]-
setuprequireddata[].setupobject-
trunksrequireddata[].setup.trunksinteger-
enabledrequireddata[].setup.enabledinteger-
identifiedrequireddata[].setup.identifiedinteger-
routedrequireddata[].setup.routedinteger-
unroutedrequireddata[].setup.unroutedinteger-
refused24hrequireddata[].refused24hobject-
forbiddenrequireddata[].refused24h.forbiddeninteger-
capacityrequireddata[].refused24h.capacityinteger-
flagsrequireddata[].flagsstring[]Filterable problem and state flags, e.g. "problem:no_traffic"

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer

POST/api/v1/switch/customers

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

Creates the customer, a "Default" trunk carrying the same credentials and limits, an empty routing row, and the customer's first API key. The SIP password and API key are returned ONCE in this response.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Request body (application/json)

FieldTypeDescription
labelrequiredstring-max 160 chars
sourcestring-One of marketplace, external
statusstring-One of draft, active
externalRefstring | null-max 255 chars
creditLimitnumber | null-min 0
markupPctnumber | null-0 to 100000
billingIncrementstring | null-max 10 chars
currencystring | null-max 3 chars
minMarginPctnumber | null-0 to 100000
marginFloorActionstring | null-One of block, alert
dailySpendCapnumber | null-min 0
maxConcurrentCallsinteger | null-min 0
maxCpsinteger | null-min 0
blockedPrefixesstring[]-
portalEmailstring (email) | null-max 255 chars
taxCountrystring | null-max 2 chars
taxIdstring | null-max 64 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
labelrequireddata.labelstring-
sourcerequireddata.sourcestring-One of marketplace, external
statusrequireddata.statusstring-One of draft, active, suspended, closed
externalRefrequireddata.externalRefstring | null-
balancerequireddata.balancemoneyPrepaid wallet balance (negative = owed), 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
creditLimitrequireddata.creditLimitstringUSD decimal string as stored (2 decimal places), e.g. "5000.00"
currencyrequireddata.currencystring | null-
markupPctrequireddata.markupPctstring | nullDefault markup over cost, percent as a decimal string
billingIncrementrequireddata.billingIncrementstring | nulle.g. "60/60" or "6/6"
minMarginPctrequireddata.minMarginPctstring | null-
marginFloorActionrequireddata.marginFloorActionstring | null-One of block, alert
dailySpendCaprequireddata.dailySpendCapstring | nullUSD decimal string as stored (2 decimal places), e.g. "5000.00"
maxConcurrentCallsrequireddata.maxConcurrentCallsinteger | null-
maxCpsrequireddata.maxCpsinteger | null-
blockedPrefixesrequireddata.blockedPrefixesstring[] | null-
sipUsernamerequireddata.sipUsernamestring | null-
portalEmailrequireddata.portalEmailstring | null-
taxCountryrequireddata.taxCountrystring | null-
taxIdrequireddata.taxIdstring | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
sipPasswordrequireddata.sipPasswordstringThe inbound SIP password in plain text. Returned ONCE, here.
defaultTrunkIdrequireddata.defaultTrunkIdstring (uuid)The "Default" trunk created with every customer
apiKeyrequireddata.apiKeystringThe customer's first API key. Returned ONCE, here.
apiKeyPrefixrequireddata.apiKeyPrefixstring-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer command-centre overview

GET/api/v1/switch/customers/{id}/overview

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

KPIs, live traffic, quality, activity, setup state and data freshness in one read.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
customerrequireddata.customerobject-
idrequireddata.customer.idstring (uuid)-
labelrequireddata.customer.labelstring-
statusrequireddata.customer.statusstring-One of draft, active, suspended, closed
sourcerequireddata.customer.sourcestring-
kpisrequireddata.kpisobjectBalance owed, wallet, credit used and today's traffic figures (numbers)
commercialrequireddata.commercialobject-
activityrequireddata.activityobject[]-
topDestinationsTodayrequireddata.topDestinationsTodayobject[]-
healthdata.healthany-
setupdata.setupany-
reconciliationdata.reconciliationany-
freshnessdata.freshnessany-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer

GET/api/v1/switch/customers/{id}

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

Includes customer-level IP allow-list entries in ipAcls. The SIP password is never returned here; see the credentials endpoint.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
labelrequireddata.labelstring-
sourcerequireddata.sourcestring-One of marketplace, external
statusrequireddata.statusstring-One of draft, active, suspended, closed
externalRefrequireddata.externalRefstring | null-
balancerequireddata.balancemoneyPrepaid wallet balance (negative = owed), 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
creditLimitrequireddata.creditLimitstringUSD decimal string as stored (2 decimal places), e.g. "5000.00"
currencyrequireddata.currencystring | null-
markupPctrequireddata.markupPctstring | nullDefault markup over cost, percent as a decimal string
billingIncrementrequireddata.billingIncrementstring | nulle.g. "60/60" or "6/6"
minMarginPctrequireddata.minMarginPctstring | null-
marginFloorActionrequireddata.marginFloorActionstring | null-One of block, alert
dailySpendCaprequireddata.dailySpendCapstring | nullUSD decimal string as stored (2 decimal places), e.g. "5000.00"
maxConcurrentCallsrequireddata.maxConcurrentCallsinteger | null-
maxCpsrequireddata.maxCpsinteger | null-
blockedPrefixesrequireddata.blockedPrefixesstring[] | null-
sipUsernamerequireddata.sipUsernamestring | null-
sipPasswordSetrequireddata.sipPasswordSetbooleanWhether an inbound SIP password is set. The value itself is only ever returned by the audited credentials endpoint.
portalEmailrequireddata.portalEmailstring | null-
taxCountryrequireddata.taxCountrystring | null-
taxIdrequireddata.taxIdstring | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
ipAclsrequireddata.ipAclsobject[]-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer

PATCH/api/v1/switch/customers/{id}

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

Any field from create, all optional. A status change is applied as the matching lifecycle action, with the same guards and history entry as POST /lifecycle. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
labelstring-max 160 chars
sourcestring-One of marketplace, external
statusstring-One of draft, active, suspended, closed
externalRefstring | null-max 255 chars
creditLimitnumber | null-min 0
markupPctnumber | null-0 to 100000
billingIncrementstring | null-max 10 chars
currencystring | null-max 3 chars
minMarginPctnumber | null-0 to 100000
marginFloorActionstring | null-One of block, alert
dailySpendCapnumber | null-min 0
maxConcurrentCallsinteger | null-min 0
maxCpsinteger | null-min 0
blockedPrefixesstring[]-
portalEmailstring (email) | null-max 255 chars
taxCountrystring | null-max 2 chars
taxIdstring | null-max 64 chars
statusReasonstring | null-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
labelrequireddata.labelstring-
sourcerequireddata.sourcestring-One of marketplace, external
statusrequireddata.statusstring-One of draft, active, suspended, closed
externalRefrequireddata.externalRefstring | null-
balancerequireddata.balancemoneyPrepaid wallet balance (negative = owed), 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
creditLimitrequireddata.creditLimitstringUSD decimal string as stored (2 decimal places), e.g. "5000.00"
currencyrequireddata.currencystring | null-
markupPctrequireddata.markupPctstring | nullDefault markup over cost, percent as a decimal string
billingIncrementrequireddata.billingIncrementstring | nulle.g. "60/60" or "6/6"
minMarginPctrequireddata.minMarginPctstring | null-
marginFloorActionrequireddata.marginFloorActionstring | null-One of block, alert
dailySpendCaprequireddata.dailySpendCapstring | nullUSD decimal string as stored (2 decimal places), e.g. "5000.00"
maxConcurrentCallsrequireddata.maxConcurrentCallsinteger | null-
maxCpsrequireddata.maxCpsinteger | null-
blockedPrefixesrequireddata.blockedPrefixesstring[] | null-
sipUsernamerequireddata.sipUsernamestring | null-
sipPasswordSetrequireddata.sipPasswordSetbooleanWhether an inbound SIP password is set. The value itself is only ever returned by the audited credentials endpoint.
portalEmailrequireddata.portalEmailstring | null-
taxCountryrequireddata.taxCountrystring | null-
taxIdrequireddata.taxIdstring | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Delete a draft Switch customer

DELETE/api/v1/switch/customers/{id}

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

Only for a customer that never carried traffic or held financial records. Offboard a real customer with the close lifecycle action instead.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
deletedrequireddata.deletedboolean-One of true
idrequireddata.idstring (uuid)-
labelrequireddata.labelstring-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Get a Switch customer lifecycle state and financial position

GET/api/v1/switch/customers/{id}/lifecycle

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

Which lifecycle actions are available now, live calls, trunk counts, recent history and the money position a close or suspend would leave.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
customerrequireddata.customerobject-
idrequireddata.customer.idstring (uuid)-
labelrequireddata.customer.labelstring-
statusrequireddata.customer.statusstring-One of draft, active, suspended, closed
sourcerequireddata.customer.sourcestring-
createdAtrequireddata.customer.createdAtstring (date-time)ISO-8601 timestamp (UTC)
availablerequireddata.availablestring[]Actions allowed from the current stateOne of activate, suspend, reactivate, close, reopen
liveCallsrequireddata.liveCallsinteger-
trunksrequireddata.trunksobject-
totalrequireddata.trunks.totalinteger-
activerequireddata.trunks.activeinteger-
historyrequireddata.historyobject[]-
idrequireddata.history[].idstring-
atrequireddata.history[].atstring (date-time)ISO-8601 timestamp (UTC)
actionrequireddata.history[].actionstring-
fromrequireddata.history[].fromstring | null-
torequireddata.history[].tostring | null-
reasonrequireddata.history[].reasonstring | null-
actorrequireddata.history[].actorstring | nullEmail of whoever did it
detailrequireddata.history[].detailobject-
financialsrequireddata.financialsobject-
currencyrequireddata.financials.currencystring-
prepaidBalancerequireddata.financials.prepaidBalancenumberUS dollars as a JSON number (computed figure)
invoicesOutstandingrequireddata.financials.invoicesOutstandingnumberUS dollars as a JSON number (computed figure)
invoicesOverduerequireddata.financials.invoicesOverduenumberUS dollars as a JSON number (computed figure)
creditNotesOpenrequireddata.financials.creditNotesOpennumberUS dollars as a JSON number (computed figure)
unbilledUsagerequireddata.financials.unbilledUsagenumberUS dollars as a JSON number (computed figure)
creditLimitrequireddata.financials.creditLimitnumberUS dollars as a JSON number (computed figure)
openInvoiceCountrequireddata.financials.openInvoiceCountinteger-
paidInvoiceCountrequireddata.financials.paidInvoiceCountinteger-
paymentCountrequireddata.financials.paymentCountinteger-
hasOpenPositionrequireddata.financials.hasOpenPositionboolean-
canDeleterequireddata.canDeleteboolean-
deleteBlockersrequireddata.deleteBlockersstring[]-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Activate, suspend, reactivate, close or reopen a Switch customer

POST/api/v1/switch/customers/{id}/lifecycle

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

The one write path for a customer's state. Live calls keep talking unless disconnectLiveCalls is true. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
actionrequiredstring-One of activate, suspend, reactivate, close, reopen
reasonstring | null-max 2000 chars
disconnectLiveCallsboolean-

Response 200

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
labelrequireddata.labelstring-
statusrequireddata.statusstring-One of draft, active, suspended, closed
previousStatusrequireddata.previousStatusstring-One of draft, active, suspended, closed
actionrequireddata.actionstring-
liveCallsAtChangerequireddata.liveCallsAtChangeinteger-
disconnectedLiveCallsrequireddata.disconnectedLiveCallsboolean-
disconnectIncompletedata.disconnectIncompleteboolean-
apiKeysRevokeddata.apiKeysRevokedinteger-
financialsUnchangedrequireddata.financialsUnchangedboolean-One of true

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List a Switch customer lifecycle history

GET/api/v1/switch/customers/{id}/history

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
limitqueryintegerDefault 50

Response 200

FieldTypeDescription
datarequiredobject[]Same fields as SwitchCustomerLifecycleEntry, 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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Rotate a Switch customer inbound SIP password

POST/api/v1/switch/customers/{id}/sip-password

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

Generates a new password and returns it ONCE. The old password stops working immediately.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
sipUsernamerequireddata.sipUsernamestring | null-
sipPasswordrequireddata.sipPasswordstring | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Reveal a Switch customer inbound SIP credentials

GET/api/v1/switch/customers/{id}/credentials

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

Returns the current username and password without changing them. Every reveal is recorded in the audit log.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerSipCredentials, 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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 what needs attention on a Switch customer

GET/api/v1/switch/customers/{id}/attention

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

A compact projection of the customer's open operational issues: quality, margin, credit and setup problems.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
kindrequireddata[].kindstring-One of quality, commercial, credit, config, setup
titlerequireddata[].titlestring-
detailrequireddata[].detailstring-
atrequireddata[].atstring-
actionablerequireddata[].actionableboolean-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 operational issues on a Switch customer

GET/api/v1/switch/customers/{id}/issues

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

The full issue records behind the attention feed, with trigger, recovery rule, evidence and ownership.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
refrequireddata[].refstringIssue reference, e.g. OPS-1042
detectorrequireddata[].detectorstring-
severityrequireddata[].severitystring-
statusrequireddata[].statusstring-
titlerequireddata[].titlestring-
summaryrequireddata[].summarystring-
triggerrequireddata[].triggerstring-
recoveryrequireddata[].recoverystring-
sampleSizerequireddata[].sampleSizenumber-
evidencerequireddata[].evidenceobject[]-
labelrequireddata[].evidence[].labelstring-
valuerequireddata[].evidence[].valuestring-
firstDetectedAtrequireddata[].firstDetectedAtstring-
lastDetectedAtrequireddata[].lastDetectedAtstring-
acknowledgedAtrequireddata[].acknowledgedAtstring | null-
resolvedAtrequireddata[].resolvedAtstring | null-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 a Switch customer contacts

GET/api/v1/switch/customers/{id}/contacts

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

Ordered by role, then priority. A contact is a person to reach, never a login.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
subAccountIdrequireddata[].subAccountIdstring (uuid)-
namerequireddata[].namestring-
rolerequireddata[].rolestring-One of technical, noc, billing, escalation, commercial
emailrequireddata[].emailstring | null-
phonerequireddata[].phonestring | null-
priorityrequireddata[].priorityinteger1 = try first within this role
isPrimaryrequireddata[].isPrimaryboolean-
preferredMethodrequireddata[].preferredMethodstring-One of email, phone, either
availabilityrequireddata[].availabilitystring | null-One of 24x7, business_hours, on_call
timezonerequireddata[].timezonestring | null-
notesrequireddata[].notesstring | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Add a Switch customer contact

POST/api/v1/switch/customers/{id}/contacts

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
namerequiredstring-max 200 chars
rolerequiredstring-One of technical, noc, billing, escalation, commercial
emailstring (email) | null-max 255 chars
phonestring | null-max 48 chars
priorityinteger-1 to 99
isPrimaryboolean-
preferredMethodstring-One of email, phone, either
availabilitystring | null-One of 24x7, business_hours, on_call
timezonestring | null-max 64 chars
notesstring | null-max 2000 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerContact, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Update a Switch customer contact

PATCH/api/v1/switch/customers/{id}/contacts/{contactId}

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
contactIdrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
namestring-max 200 chars
rolestring-One of technical, noc, billing, escalation, commercial
emailstring (email) | null-max 255 chars
phonestring | null-max 48 chars
priorityinteger-1 to 99
isPrimaryboolean-
preferredMethodstring-One of email, phone, either
availabilitystring | null-One of 24x7, business_hours, on_call
timezonestring | null-max 64 chars
notesstring | null-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerContact, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Delete a Switch customer contact

DELETE/api/v1/switch/customers/{id}/contacts/{contactId}

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
contactIdrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
deletedrequireddata.deletedboolean-One of true

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List internal notes on a Switch customer

GET/api/v1/switch/customers/{id}/notes

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

Operator-private notes with the author name. Never visible to the customer.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
subAccountIdrequireddata[].subAccountIdstring (uuid)-
bodyrequireddata[].bodystring-
typerequireddata[].typestring-One of general, technical, billing, warning
pinnedrequireddata[].pinnedboolean-
followUpAtrequireddata[].followUpAtstring (date-time) | nullISO-8601 timestamp (UTC)
createdByrequireddata[].createdBystring (uuid) | null-
createdAtrequireddata[].createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata[].updatedAtstring (date-time)ISO-8601 timestamp (UTC)
authorNamerequireddata[].authorNamestring | null-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Add an internal note to a Switch customer

POST/api/v1/switch/customers/{id}/notes

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
bodyrequiredstring-max 4000 chars
typestring-One of general, technical, billing, warning
pinnedboolean-
followUpAtstring (date-time) | null-

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
subAccountIdrequireddata.subAccountIdstring (uuid)-
bodyrequireddata.bodystring-
typerequireddata.typestring-One of general, technical, billing, warning
pinnedrequireddata.pinnedboolean-
followUpAtrequireddata.followUpAtstring (date-time) | nullISO-8601 timestamp (UTC)
createdByrequireddata.createdBystring (uuid) | null-
createdAtrequireddata.createdAtstring (date-time)ISO-8601 timestamp (UTC)
updatedAtrequireddata.updatedAtstring (date-time)ISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Edit, pin or flag a Switch customer note

PATCH/api/v1/switch/customers/{id}/notes/{noteId}

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

The author and creation time never change.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
noteIdrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
bodystring-max 4000 chars
typestring-One of general, technical, billing, warning
pinnedboolean-
followUpAtstring (date-time) | null-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerNote, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Delete a Switch customer note

DELETE/api/v1/switch/customers/{id}/notes/{noteId}

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
noteIdrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
deletedrequireddata.deletedboolean-One of true

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Get per-destination quality for a Switch customer

GET/api/v1/switch/customers/{id}/quality

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

ASR, NER and PDD per destination over a window, with verdicts. The KPI row and the table are both computed from the same filtered set.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
windowqueryintegerHours: 1, 24 or 168. Default 24
fromquerystringExplicit window start (ISO-8601); overrides window
toquerystringExplicit window end (ISO-8601)

Response 200

FieldTypeDescription
datarequiredobject-
windowHoursrequireddata.windowHoursnumber-
windowrequireddata.windowobject-
fromrequireddata.window.fromstring (date-time)ISO-8601 timestamp (UTC)
torequireddata.window.tostring (date-time)ISO-8601 timestamp (UTC)
labelrequireddata.window.labelstring-
destinationDigitsrequireddata.destinationDigitsinteger-
kpisrequireddata.kpisobject-
callsrequireddata.kpis.callsinteger-
answeredrequireddata.kpis.answeredinteger-
asrrequireddata.kpis.asrnumber | null-
nerrequireddata.kpis.nernumber | null-
destinationsrequireddata.destinationsobject[]-
prefixrequireddata.destinations[].prefixstring-
callsrequireddata.destinations[].callsinteger-
answeredrequireddata.destinations[].answeredinteger-
asrrequireddata.destinations[].asrnumber | null-
nerrequireddata.destinations[].nernumber | null-
healthrequireddata.destinations[].healthstring-
thresholdsdata.thresholdsany-
minJudgeableSessionsrequireddata.minJudgeableSessionsinteger-
supportsrequireddata.supportsstring[]Call Records filter ids this view honours
unsupportedrequireddata.unsupportedany[]Filters you sent that this view could not apply

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Drill into one destination for a Switch customer

GET/api/v1/switch/customers/{id}/quality/destination

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

Which customer trunks sent it, which supplier trunks carried it, which route groups send it there, and how far the sessions got. Uses the same window and filters as the quality table.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
windowqueryintegerHours: 1, 24 or 168. Default 24
fromquerystringExplicit window start (ISO-8601); overrides window
toquerystringExplicit window end (ISO-8601)
prefixrequiredquerystringThe destination prefix to open

Response 200

FieldTypeDescription
datarequiredobject-
windowHoursrequireddata.windowHoursnumber-
windowrequireddata.windowobject-
fromrequireddata.window.fromstring (date-time)ISO-8601 timestamp (UTC)
torequireddata.window.tostring (date-time)ISO-8601 timestamp (UTC)
labelrequireddata.window.labelstring-
destinationDigitsrequireddata.destinationDigitsinteger-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer receivables summary

GET/api/v1/switch/customers/{id}/billing-summary

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

What is owed, unbilled and unrated, payments recorded and ageing. Credit headroom is a separate endpoint (credit-position).

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
balanceOwedrequireddata.balanceOwednumberOpen invoices less open credit notes
grossBalanceOwedrequireddata.grossBalanceOwednumberUS dollars as a JSON number (computed figure)
creditNotesOpenrequireddata.creditNotesOpennumberUS dollars as a JSON number (computed figure)
paymentsRecordedrequireddata.paymentsRecordednumberUS dollars as a JSON number (computed figure)
creditLimitrequireddata.creditLimitnumberUS dollars as a JSON number (computed figure)
unbilledRatedrequireddata.unbilledRatednumberUS dollars as a JSON number (computed figure)
unbilledSinceLastInvoicerequireddata.unbilledSinceLastInvoicenumberUS dollars as a JSON number (computed figure)
unratedUsagerequireddata.unratedUsageobject-
callsrequireddata.unratedUsage.callsinteger-
minutesrequireddata.unratedUsage.minutesnumber | null-
noterequireddata.unratedUsage.notestring-
overdueIsSubsetOfOpenInvoicesrequireddata.overdueIsSubsetOfOpenInvoicesboolean-One of true
disputedrequireddata.disputedenum | nullCustomer-side disputes are not recorded, so always nullOne of null
avgDaysToPayrequireddata.avgDaysToPaynumber | null-
lastInvoicePeriodEndrequireddata.lastInvoicePeriodEndstring (date-time) | nullISO-8601 timestamp (UTC)
currencyrequireddata.currencystring-
agingrequireddata.agingobject-
currentrequireddata.aging.currentnumberUS dollars as a JSON number (computed figure)
d1_30requireddata.aging.d1_30numberUS dollars as a JSON number (computed figure)
d31_60requireddata.aging.d31_60numberUS dollars as a JSON number (computed figure)
d61_90requireddata.aging.d61_90numberUS dollars as a JSON number (computed figure)
d90_plusrequireddata.aging.d90_plusnumberUS dollars as a JSON number (computed figure)

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer credit position

GET/api/v1/switch/customers/{id}/credit-position

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

Credit limit, exposure, funds reserved by live calls, available credit and whether the next call would be admitted. Read-only; it reports the admission arithmetic without performing it.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
customerIdrequireddata.customerIdstring (uuid)-
labelrequireddata.labelstring-
currencyrequireddata.currencystring-
moderequireddata.modestringprepaid or postpaid, derived from the credit limit
creditLimitrequireddata.creditLimitobject-
valuerequireddata.creditLimit.valuenumberUS dollars as a JSON number (computed figure)
ambiguousrequireddata.creditLimit.ambiguousstring | null-
exposurerequireddata.exposurenumberUS dollars as a JSON number (computed figure)
balancerequireddata.balancenumberUS dollars as a JSON number (computed figure)
reservationsrequireddata.reservationsobject-
amountrequireddata.reservations.amountnumberUS dollars as a JSON number (computed figure)
callsrequireddata.reservations.callsinteger-
enforcedrequireddata.reservations.enforcedboolean-
basisrequireddata.reservations.basisstring-
availableCreditrequireddata.availableCreditnumberUS dollars as a JSON number (computed figure)
availableAfterReservationsrequireddata.availableAfterReservationsnumberUS dollars as a JSON number (computed figure)
admitsNextCallrequireddata.admitsNextCallboolean-
usedPctrequireddata.usedPctnumber | null-
overCommittedrequireddata.overCommittedboolean-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Preview how a payment would be allocated to invoices

GET/api/v1/switch/customers/{id}/payments/preview

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
amountquerynumberUSD amount to preview

Response 200

FieldTypeDescription
datarequiredobject-
billingModerequireddata.billingModestring-
currencyrequireddata.currencystring-
wouldAllocaterequireddata.wouldAllocateobject[]-
invoiceIdrequireddata.wouldAllocate[].invoiceIdstring (uuid)-
invoiceNumberrequireddata.wouldAllocate[].invoiceNumberstring-
appliedrequireddata.wouldAllocate[].appliednumberUS dollars as a JSON number (computed figure)
clearsInvoicerequireddata.wouldAllocate[].clearsInvoiceboolean-
wouldLeaveUnappliedrequireddata.wouldLeaveUnappliednumberUS dollars as a JSON number (computed figure)

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Record a payment received from a Switch customer

POST/api/v1/switch/customers/{id}/payments

Access
API key. Scoped keys need switch:manage.
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
Records or reverses a payment on a Switch customer ledger.

Records money the customer already paid you (nothing is collected). It credits the wallet and pays open invoices oldest-due first in one transaction; anything left is held unapplied.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
X-Idempotency-KeyheaderstringAny unique string (a UUID is ideal). Replays within 24 hours return the first response instead of acting twice.

Request body (application/json)

FieldTypeDescription
amountrequirednumberUSDmin 0
referencestring | nullBank or remittance reference, for matching latermax 160 chars
methodstring | null-max 32 chars
paidAtstring | nullWhen the money was received (ISO-8601); default now

Response 201

FieldTypeDescription
datarequiredobject-
kindrequireddata.kindstring-One of payment
transactionIdrequireddata.transactionIdstring (uuid)-
amountrequireddata.amountnumberUS dollars as a JSON number (computed figure)
currencyrequireddata.currencystring-
postedAtrequireddata.postedAtstring (date-time)ISO-8601 timestamp (UTC)
externalReferencerequireddata.externalReferencestring | null-
methodrequireddata.methodstring | null-
operatorLabelrequireddata.operatorLabelstring | null-
billingModerequireddata.billingModestring-
allocationsrequireddata.allocationsobject[]Oldest-due invoices first
invoiceIdrequireddata.allocations[].invoiceIdstring (uuid)-
invoiceNumberrequireddata.allocations[].invoiceNumberstring-
appliedrequireddata.allocations[].appliednumberUS dollars as a JSON number (computed figure)
outstandingAfterrequireddata.allocations[].outstandingAfternumberUS dollars as a JSON number (computed figure)
statusrequireddata.allocations[].statusstring-
unappliedrequireddata.unappliednumberLeft on account after paying every open invoice
positionAfterrequireddata.positionAfterobject-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Reverse a recorded Switch customer payment

POST/api/v1/switch/customers/{id}/payments/{transactionId}/reverse

Access
API key. Scoped keys need switch:manage.
Rate limit
100 requests per second (the default)
Moves money
Records or reverses a payment on a Switch customer ledger.

A posted payment is never edited or deleted. This posts a linked reversal and unwinds its invoice allocations; both entries stay on the record.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
transactionIdrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
reasonrequiredstring-max 500 chars

Response 201

FieldTypeDescription
datarequiredobject-
kindrequireddata.kindstring-One of reversal
reversesTransactionIdrequireddata.reversesTransactionIdstring (uuid)-
transactionIdrequireddata.transactionIdstring (uuid)-
amountrequireddata.amountnumberUS dollars as a JSON number (computed figure)
currencyrequireddata.currencystring-
reasonrequireddata.reasonstring-
unwoundrequireddata.unwoundobject[]-
positionAfterrequireddata.positionAfterobject-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Preview an invoice for a Switch customer unbilled period

POST/api/v1/switch/customers/{id}/invoice-preview

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

The period runs from the last invoice's end (or the customer's creation) to now. Issues nothing; returns a reviewToken for generate-invoice.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
notesstring | null-max 2000 chars
includeBroughtForwardboolean-
applyCreditsboolean-
excludeUnratedobject | nullIssue despite unrated usage in the period, with the reason recorded on the invoice
reasonrequiredexcludeUnrated.reasonstring-max 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
customerrequireddata.customerobject-
idrequireddata.customer.idstring (uuid)-
labelrequireddata.customer.labelstring-
legalNamerequireddata.customer.legalNamestring-
currencyrequireddata.customer.currencystring-
periodrequireddata.periodobject-
dueDaterequireddata.dueDatestring-
paymentTermsDaysrequireddata.paymentTermsDaysinteger-
currencyrequireddata.currencystring-
usagerequireddata.usageobject-
unratedrequireddata.unratedobjectUsage that has no price yet; blocks issue unless excluded
reviewTokenrequireddata.reviewTokenstringPass to generate-invoice to issue exactly what was reviewed
reviewDigestrequireddata.reviewDigeststring-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Issue the reviewed invoice for a Switch customer

POST/api/v1/switch/customers/{id}/generate-invoice

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

Requires the reviewToken from invoice-preview; refused with 409 INVOICE_REVIEW_STALE if the data changed since, or INVOICE_UNRATED_USAGE if unrated usage remains and was not excluded.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
notesstring | null-max 2000 chars
includeBroughtForwardboolean-
applyCreditsboolean-
excludeUnratedobject | nullIssue despite unrated usage in the period, with the reason recorded on the invoice
reasonrequiredexcludeUnrated.reasonstring-max 2000 chars
reviewTokenrequiredstring-max 120 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
invoiceNumberrequireddata.invoiceNumberstring-
customerIdrequireddata.customerIdstring (uuid)-
statusrequireddata.statusstring-
subtotalrequireddata.subtotalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
totalrequireddata.totalmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
currencyrequireddata.currencystring-
periodStartrequireddata.periodStartstring (date-time)ISO-8601 timestamp (UTC)
periodEndrequireddata.periodEndstring (date-time)ISO-8601 timestamp (UTC)
issueDaterequireddata.issueDatestring (date-time) | nullISO-8601 timestamp (UTC)
dueDaterequireddata.dueDatestring (date-time) | nullISO-8601 timestamp (UTC)
linesrequireddata.linesobject[]-
reviewDigestrequireddata.reviewDigeststring | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoINVOICE_REVIEW_STALE, INVOICE_UNRATED_USAGE, STALE_WRITE

Get a Switch customer billing profile

GET/api/v1/switch/customers/{id}/billing-profile

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

profile is what was entered (null if none); resolved is what an invoice issued now would freeze, including fallbacks.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
profilerequireddata.profileobject | null-
idrequireddata.profile.idstring (uuid)-
legalNamerequireddata.profile.legalNamestring-
versionrequireddata.profile.versionintegerBumped on every save; frozen onto invoices issued afterwards
updatedAtrequireddata.profile.updatedAtstring (date-time)ISO-8601 timestamp (UTC)
resolvedrequireddata.resolvedobject-
sourcerequireddata.resolved.sourcestring-One of profile, fallback
profileIdrequireddata.resolved.profileIdstring (uuid) | null-
profileVersionrequireddata.resolved.profileVersioninteger | null-
customerrequireddata.resolved.customerobject-
billingAddressrequireddata.resolved.billingAddressobject | null-
issuerrequireddata.resolved.issuerobject-
termsrequireddata.resolved.termsobject-
currencyrequireddata.resolved.terms.currencystring-
billingCyclerequireddata.resolved.terms.billingCyclestring | null-
billingTimezonerequireddata.resolved.terms.billingTimezonestring-
paymentTermsDaysrequireddata.resolved.terms.paymentTermsDaysinteger-
purchaseOrderRefrequireddata.resolved.terms.purchaseOrderRefstring | null-
paymentInstructionsrequireddata.resolved.terms.paymentInstructionsstring | null-
recipientsdata.resolved.recipientsany-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Save a Switch customer billing profile

PUT/api/v1/switch/customers/{id}/billing-profile

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

The customer's legal and billing identity. Frozen onto invoices issued afterwards; never changes an invoice already issued. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
legalNamestring-max 200 chars
tradingNamestring | null-max 200 chars
registrationNumberstring | null-max 64 chars
addressLine1string | null-max 200 chars
addressLine2string | null-max 200 chars
citystring | null-max 120 chars
regionstring | null-max 120 chars
postcodestring | null-max 32 chars
countrystring | null-max 2 chars
billingAddressLine1string | null-max 200 chars
billingAddressLine2string | null-max 200 chars
billingCitystring | null-max 120 chars
billingRegionstring | null-max 120 chars
billingPostcodestring | null-max 32 chars
billingCountrystring | null-max 2 chars
taxCountrystring | null-max 2 chars
taxIdstring | null-max 64 chars
taxTreatmentstring | null-One of standard, reverse_charge, zero_rated, exempt
invoiceCurrencystring-max 3 chars
billingCyclestring | null-One of weekly, biweekly, monthly, manual
billingTimezonestring-max 64 chars
paymentTermsDaysinteger | null-0 to 365
purchaseOrderRefstring | null-max 64 chars
invoiceRecipientsstring (email)[]-

Response 200

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerBillingProfile, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Get a Switch customer default sell deck and each trunk's deck

GET/api/v1/switch/customers/{id}/sell-deck

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

An unknown customer answers 404 NOT_FOUND.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
customerIdrequireddata.customerIdstring (uuid)-
customerLabelrequireddata.customerLabelstring-
defaultDeckrequireddata.defaultDeckobject | null-
idrequireddata.defaultDeck.idstring (uuid)-
namerequireddata.defaultDeck.namestring-
versionrequireddata.defaultDeck.versioninteger-
statusrequireddata.defaultDeck.statusstring-
currencyrequireddata.defaultDeck.currencystring-
isSystemDefaultrequireddata.defaultDeck.isSystemDefaultboolean-
defaultRatePerUnitrequireddata.defaultDeck.defaultRatePerUnitnumber | nullUSD per minute for destinations the deck does not list; null = refuse them
chargingrequireddata.defaultDeck.chargingobject-
systemDefaultrequireddata.systemDefaultobject | nullSame fields as SwitchCustomerSellDeckRef, shown earlier on this page.
trunksrequireddata.trunksobject[]-
effectiverequireddata.trunks[].effectiveobject-
deckrequireddata.trunks[].effective.deckobject | nullSame fields as SwitchCustomerSellDeckRef, shown earlier on this page.
moderequireddata.trunks[].effective.modestring-
choicerequireddata.trunks[].effective.choicestringWhich rule won: the trunk, the customer default or the system default
bypassesCustomerDefaultrequireddata.trunks[].effective.bypassesCustomerDefaultboolean-
customerDefaultrequireddata.trunks[].effective.customerDefaultobject | nullSame fields as SwitchCustomerSellDeckRef, shown earlier on this page.
systemDefaultrequireddata.trunks[].effective.systemDefaultobject | nullSame fields as SwitchCustomerSellDeckRef, shown earlier on this page.
liveRowCountrequireddata.trunks[].effective.liveRowCountinteger-
explanationrequireddata.trunks[].effective.explanationstring-
problemrequireddata.trunks[].effective.problemstring | null-
trunksDisagreerequireddata.trunksDisagreeboolean-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Set a Switch customer default sell deck

PUT/api/v1/switch/customers/{id}/sell-deck

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

Without confirm: true nothing changes: the response lists the trunks whose prices would change. With it, the deck is assigned and trunks that follow the customer default reprice from the next call.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
deckIdstring (uuid) | nullnull clears the default
confirmboolean-
reasonstring-

Response 200

FieldTypeDescription
datarequiredobject-
changeddata.changedboolean-One of true
wouldChangedata.wouldChangeobject-
trunksrequireddata.wouldChange.trunksstring[]-
messagerequireddata.wouldChange.messagestring-
trunksdata.trunksinteger-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Email a Switch customer a portal sign-in link

POST/api/v1/switch/customers/{id}/portal-invite

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

Sends a magic sign-in link to the customer's portal email. With no portal email set it answers 400 VALIDATION_ERROR.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
sentrequireddata.sentboolean-One of true
torequireddata.tostring-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List a Switch customer sell rates with buy cost and margin

GET/api/v1/switch/customers/{id}/sell-rates

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
searchquerystringPrefix or destination text
limitqueryinteger-
offsetqueryinteger-
viewquerystringDefault currentOne of current, scheduled, discontinued, expiring, all
originquerystring-One of any, origin_only, destination_only
incrementquerystring-One of any, custom, inherited
costquerystring-One of any, missing
marginquerystring-One of any, thin, negative

Response 200

FieldTypeDescription
datarequiredobject-
rowsrequireddata.rowsobject[]-
idrequireddata.rows[].idstring (uuid)-
subAccountIdrequireddata.rows[].subAccountIdstring (uuid)-
customerTrunkIdrequireddata.rows[].customerTrunkIdstring (uuid) | null-
prefixrequireddata.rows[].prefixstring-
originPrefixrequireddata.rows[].originPrefixstring"" = any origin
ratePerUnitrequireddata.rows[].ratePerUnitmoneySell price per minute, 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
billingIncrementrequireddata.rows[].billingIncrementstring | null-
statusrequireddata.rows[].statusstringactive, pending (scheduled) or discontinued
effectiveFromrequireddata.rows[].effectiveFromstring (date-time)ISO-8601 timestamp (UTC)
endDaterequireddata.rows[].endDatestring (date-time) | nullISO-8601 timestamp (UTC)
buyCostrequireddata.rows[].buyCostnumber | nullBest eligible buy cost per minute (USD number); null = no supplier prices it
marginPctrequireddata.rows[].marginPctnumber | null-
thinrequireddata.rows[].thinboolean-
negativerequireddata.rows[].negativeboolean-
costSupplierrequireddata.rows[].costSupplierstring | null-
costSourcerequireddata.rows[].costSourcestring-
costMatchedPrefixrequireddata.rows[].costMatchedPrefixstring | null-
costNoterequireddata.rows[].costNotestring | null-
totalrequireddata.totalinteger-
totalIsPageScopedrequireddata.totalIsPageScopedbooleanTrue when a cost or margin filter narrowed the page, so total counts this page only
limitrequireddata.limitinteger-
offsetrequireddata.offsetinteger-
viewrequireddata.viewstring-
summaryrequireddata.summaryobject-
prefixesrequireddata.summary.prefixesinteger-
blendedMarginPctrequireddata.summary.blendedMarginPctnumber | null-
thinCountrequireddata.summary.thinCountinteger-
negativeCountrequireddata.summary.negativeCountinteger-
defaultRateCostCountrequireddata.summary.defaultRateCostCountinteger-
unpricedCountrequireddata.summary.unpricedCountinteger-
basisdata.basisany-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Add or replace one Switch customer sell rate

POST/api/v1/switch/customers/{id}/sell-rates

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

Takes effect now on the customer's default trunk. Use the per-trunk rate endpoints to price a specific trunk.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
prefixrequiredstring-max 24 chars
raterequirednumberUSD per minutemin 0
originstring-max 24 chars
billingIncrementstring-max 10 chars

Response 201

FieldTypeDescription
datarequiredobject-
idrequireddata.idstring (uuid)-
subAccountIdrequireddata.subAccountIdstring (uuid)-
customerTrunkIdrequireddata.customerTrunkIdstring (uuid) | null-
prefixrequireddata.prefixstring-
originPrefixrequireddata.originPrefixstring"" = any origin
ratePerUnitrequireddata.ratePerUnitmoneySell price per minute, 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
billingIncrementrequireddata.billingIncrementstring | null-
statusrequireddata.statusstringactive, pending (scheduled) or discontinued
effectiveFromrequireddata.effectiveFromstring (date-time)ISO-8601 timestamp (UTC)
endDaterequireddata.endDatestring (date-time) | nullISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Count a Switch customer sell rates by view

GET/api/v1/switch/customers/{id}/sell-rates/counts

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
currentrequireddata.currentinteger-
scheduledrequireddata.scheduledinteger-
expiringrequireddata.expiringinteger-
discontinuedrequireddata.discontinuedinteger-
allrequireddata.allinteger-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 upcoming sell-rate starts and ends for a Switch customer

GET/api/v1/switch/customers/{id}/sell-rates/upcoming

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
idrequireddata[].idstring (uuid)-
subAccountIdrequireddata[].subAccountIdstring (uuid)-
customerTrunkIdrequireddata[].customerTrunkIdstring (uuid) | null-
prefixrequireddata[].prefixstring-
originPrefixrequireddata[].originPrefixstring"" = any origin
ratePerUnitrequireddata[].ratePerUnitmoneySell price per minute, 6-decimal USD string USD as a decimal string with exactly 6 places, e.g. "0.012500".
billingIncrementrequireddata[].billingIncrementstring | null-
statusrequireddata[].statusstringactive, pending (scheduled) or discontinued
effectiveFromrequireddata[].effectiveFromstring (date-time)ISO-8601 timestamp (UTC)
endDaterequireddata[].endDatestring (date-time) | nullISO-8601 timestamp (UTC)
kindrequireddata[].kindstring-One of starts, ends
atrequireddata[].atstring (date-time) | nullISO-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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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 Switch customer rate-change notice period and what is queued

GET/api/v1/switch/customers/{id}/sell-rates/notice

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

The notice period you give this customer before a sell-rate increase takes effect, how many sell-rate changes are queued behind it, and who a notice email would go to by default (commercial contacts, then billing contacts, then the portal email; at most 5). Needs the rates.view permission. An unknown customer, or one that is not yours, answers 404.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
rateNoticeDaysrequireddata.rateNoticeDaysintegerDays of notice before a sell-rate increase takes effect; 0 = none
queuedrequireddata.queuedintegerSell-rate changes queued and not yet in effect
increasesrequireddata.increasesintegerHow many of the queued changes are increases
nextEffectiveFromrequireddata.nextEffectiveFromstring (date-time) | nullWhen the soonest queued change takes effect
defaultRecipientsrequireddata.defaultRecipientsstring[]Who a notice goes to when you do not name recipients

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Set a Switch customer rate-change notice period

PUT/api/v1/switch/customers/{id}/sell-rates/notice

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

With a notice period, a rise on any of this customer's prices (hand edit, bulk paste, sheet import, markup, sell-deck publish or assignment) is queued and takes effect that many days out, at the next 00:00 UTC; decreases and new destinations still apply at once. 0 = every change applies immediately. The new period applies to rises written from now on; changes already queued keep their dates. Needs the rates.publish permission; the change is audited. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
rateNoticeDaysrequiredintegerWhole days of notice before an increase takes effect; 0 = none0 to 365

Response 200

FieldTypeDescription
datarequiredobject-
rateNoticeDaysrequireddata.rateNoticeDaysinteger-0 to 365

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List a Switch customer queued sell-rate changes

GET/api/v1/switch/customers/{id}/sell-rates/notice/changes

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

Every sell-rate change queued for this customer and not yet in effect, with the rate in force today beside it. Soonest first, then by prefix; at most 50,000 rows. The same rows as the CSV the customer receives.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
trunkIdquerystring (uuid)Only this trunk's changes

Response 200

FieldTypeDescription
datarequiredobject[]-
trunkrequireddata[].trunkstringThe customer trunk's label ("" when it has none)
prefixrequireddata[].prefixstring-
originrequireddata[].originstringOrigin prefix for origin-based pricing; "" when the rate applies from any origin
currentRaterequireddata[].currentRatemoney | nullThe rate in force today; null for a new destination USD as a decimal string with exactly 6 places, e.g. "0.012500".
newRaterequireddata[].newRatemoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
changePctrequireddata[].changePctnumber | nullPercentage move, 2 decimals; null for a new destination
currentIncrementrequireddata[].currentIncrementstring | null-
newIncrementrequireddata[].newIncrementstring | null-
effectiveFromrequireddata[].effectiveFromstring (date-time)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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Download a Switch customer queued sell-rate changes as CSV

GET/api/v1/switch/customers/{id}/sell-rates/notice/changes.csv

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

The list from GET /switch/customers/{id}/sell-rates/notice/changes as the CSV the customer receives, for you to check or forward.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
trunkIdquerystring (uuid)Only this trunk's changes

Response 200 (text/csv)

An attachment named rate-changes-<customer id>.csv. Columns: trunk, prefix, origin, current_rate, new_rate, change_pct, current_increment, new_increment, effective_from_utc. current_rate is empty for a new destination.

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Email a Switch customer a rate-change notice

POST/api/v1/switch/customers/{id}/sell-rates/notice/send

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

Emails the customer every queued change with its effective date: a table of the first 100 in the message and the full list (up to 5,000 rows) as CSV in the text part. The email is white-label: it is sent under your brand, replies go to your own support address, and it does not mention PacketExchange. Recipients are to when given (up to 10), otherwise the default recipients from GET .../sell-rates/notice. Answers 400 VALIDATION_ERROR when there are no queued changes, when trunkId is not one of this customer's trunks, or when there is no one to send to. A recipient the mail service refused is listed in failed, not raised as an error. Needs the rates.publish permission; the send is audited. Send X-If-Unchanged-Since: <updatedAt you loaded> to have the save refused with 409 STALE_WRITE if someone changed the record since.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
trunkIdstring (uuid) | nullOnly this trunk's changes; omit for every trunk of the customer
tostring (email)[]Recipients; omit to use the default recipients
messagestringA note of your own, added under the introductionmax 2000 chars

Response 200

FieldTypeDescription
datarequiredobject-
sentrequireddata.sentstring[]Addresses the notice was accepted for
failedrequireddata.failedstring[]Addresses the mail service refused
rowsrequireddata.rowsintegerChanges in the notice
increasesrequireddata.increasesinteger-
decreasesrequireddata.decreasesinteger-
addedrequireddata.addedintegerNew destinations (no rate today)
firstEffectiveFromrequireddata.firstEffectiveFromstring (date-time)The earliest effective date in the notice

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Preview discontinuing a Switch customer whole sell deck

POST/api/v1/switch/customers/{id}/sell-rates/discontinue-all/preview

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

Omit the effective fields to act now. Send either effectiveFrom (an instant with an offset) or effectiveLocal plus timezone; a bare date is refused because midnight differs by country.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
effectiveFromstringAn instant with offset, e.g. "2026-10-01T00:00:00Z". A bare date is refused.max 40 chars
effectiveLocalstringA wall-clock time, e.g. "2026-10-01T00:00"; requires timezonemax 30 chars
timezonestring | nullIANA zone, e.g. Europe/London; always recordedmax 64 chars

Response 200

FieldTypeDescription
datarequiredobject-
customerLabelrequireddata.customerLabelstring-
activeRatesrequireddata.activeRatesinteger-
scheduledRatesrequireddata.scheduledRatesinteger-
alreadyDiscontinuedrequireddata.alreadyDiscontinuedinteger-
endDaterequireddata.endDatestring (date-time)ISO-8601 timestamp (UTC)
immediaterequireddata.immediateboolean-
timezonerequireddata.timezonestring | null-
effectOnNewCallsrequireddata.effectOnNewCallsstring-
minutes30drequireddata.minutes30dnumber-
calls30drequireddata.calls30dinteger-
revenue30drequireddata.revenue30dnumberUS dollars as a JSON number (computed figure)
impactTruncatedrequireddata.impactTruncatedboolean-
samplerequireddata.sampleobject[]-
prefixrequireddata.sample[].prefixstring-
originPrefixrequireddata.sample[].originPrefixstring-
ratePerUnitrequireddata.sample[].ratePerUnitmoneyUSD as a decimal string with exactly 6 places, e.g. "0.012500".
billingIncrementrequireddata.sample[].billingIncrementstring | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Discontinue a Switch customer whole sell deck

POST/api/v1/switch/customers/{id}/sell-rates/discontinue-all

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

Closes every rate's period at the effective moment; nothing is deleted and priced calls keep their rate. New calls fall back to your operator deck, then markup over cost. Omit the effective fields to act now. Send either effectiveFrom (an instant with an offset) or effectiveLocal plus timezone; a bare date is refused because midnight differs by country.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
effectiveFromstringAn instant with offset, e.g. "2026-10-01T00:00:00Z". A bare date is refused.max 40 chars
effectiveLocalstringA wall-clock time, e.g. "2026-10-01T00:00"; requires timezonemax 30 chars
timezonestring | nullIANA zone, e.g. Europe/London; always recordedmax 64 chars
includeScheduledboolean-

Response 200

FieldTypeDescription
datarequiredobject-
endDaterequireddata.endDatestring (date-time)ISO-8601 timestamp (UTC)
effectivedata.effectiveanyThe moment described in words and in the recorded zone
revisionIddata.revisionIdstring (uuid) | null-
discontinuedrequireddata.discontinuedinteger-
deletedrequireddata.deletedintegerDeprecated alias of discontinued; nothing is deleted
scheduledLeftrequireddata.scheduledLeftinteger-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Discontinue one Switch customer sell rate

POST/api/v1/switch/customers/{id}/sell-rates/{rateId}/discontinue

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

Omit the effective fields to act now. Send either effectiveFrom (an instant with an offset) or effectiveLocal plus timezone; a bare date is refused because midnight differs by country.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
rateIdrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
effectiveFromstringAn instant with offset, e.g. "2026-10-01T00:00:00Z". A bare date is refused.max 40 chars
effectiveLocalstringA wall-clock time, e.g. "2026-10-01T00:00"; requires timezonemax 30 chars
timezonestring | nullIANA zone, e.g. Europe/London; always recordedmax 64 chars

Response 200

FieldTypeDescription
datarequiredobject-
endDaterequireddata.endDatestring (date-time)ISO-8601 timestamp (UTC)
effectivedata.effectiveanyThe moment described in words and in the recorded zone
revisionIddata.revisionIdstring (uuid) | null-
discontinuedrequireddata.discontinuedboolean-One of true
deletedrequireddata.deletedbooleanDeprecated alias; the rate is discontinued, not deletedOne of true
immediaterequireddata.immediateboolean-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List sell-rate discontinuation events for a Switch customer

GET/api/v1/switch/customers/{id}/sell-rates/discontinuations

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]-
revisionIdrequireddata[].revisionIdstring (uuid) | null-
discontinuedAtrequireddata[].discontinuedAtstring (date-time)ISO-8601 timestamp (UTC)
rowsrequireddata[].rowsinteger-
labelrequireddata[].labelstring-
effectivedata[].effectiveany | null-
timezonerequireddata[].timezonestring | null-
changeModerequireddata[].changeModestring | null-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Reprice a Switch customer deck as a markup over buy cost

POST/api/v1/switch/customers/{id}/sell-rates/apply-markup

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
markupPctrequirednumber-min -100
prefixesstring[]Only these prefixes; omit for the whole deck

Response 200

FieldTypeDescription
datarequiredobject-
updatedrequireddata.updatedinteger-
skippedrequireddata.skippedinteger-
basisdata.basisany-
revisionIdrequireddata.revisionIdstring (uuid) | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Export a Switch customer sell rates as CSV

GET/api/v1/switch/customers/{id}/sell-rates.csv

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

Takes the same filters as the list, with buy cost and margin columns.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
searchquerystringPrefix or destination text
viewquerystringDefault currentOne of current, scheduled, discontinued, expiring, all
originquerystring-One of any, origin_only, destination_only
incrementquerystring-One of any, custom, inherited
costquerystring-One of any, missing
marginquerystring-One of any, thin, negative

Response 200 (text/csv)

The filtered sell deck as a CSV attachment.

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Add or replace many Switch customer sell rates

POST/api/v1/switch/customers/{id}/sell-rates/bulk

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
rowsrequiredobject[]-
prefixrequiredrows[].prefixstring-max 24 chars
raterequiredrows[].ratenumber-min 0
originrows[].originstring-max 24 chars
billingIncrementrows[].billingIncrementstring-max 10 chars

Response 200

FieldTypeDescription
datarequiredobject-
appliedrequireddata.appliedinteger-
revisionIdrequireddata.revisionIdstring (uuid) | null-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Discontinue one Switch customer sell rate now

DELETE/api/v1/switch/customers/{id}/sell-rates/{rateId}

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

Kept for existing clients: the rate is discontinued immediately, not deleted.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
rateIdrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
endDaterequireddata.endDatestring (date-time)ISO-8601 timestamp (UTC)
effectivedata.effectiveanyThe moment described in words and in the recorded zone
revisionIddata.revisionIdstring (uuid) | null-
discontinuedrequireddata.discontinuedboolean-One of true
deletedrequireddata.deletedbooleanDeprecated alias; the rate is discontinued, not deletedOne of true
immediaterequireddata.immediateboolean-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Discontinue every Switch customer sell rate now

POST/api/v1/switch/customers/{id}/sell-rates/clear

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
endDaterequireddata.endDatestring (date-time)ISO-8601 timestamp (UTC)
effectivedata.effectiveanyThe moment described in words and in the recorded zone
revisionIddata.revisionIdstring (uuid) | null-
discontinuedrequireddata.discontinuedinteger-
deletedrequireddata.deletedintegerDeprecated alias of discontinued; nothing is deleted
scheduledLeftrequireddata.scheduledLeftinteger-

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

List scheduled (future-dated) sell rates for a Switch customer

GET/api/v1/switch/customers/{id}/sell-rates/scheduled

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

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject[]Same fields as SwitchCustomerSellRate, 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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.

Schedule a future Switch customer sell-rate change

POST/api/v1/switch/customers/{id}/sell-rates/schedule

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

The rate becomes active at the effective moment. Omit the effective fields to act now. Send either effectiveFrom (an instant with an offset) or effectiveLocal plus timezone; a bare date is refused because midnight differs by country.

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
effectiveFromstringAn instant with offset, e.g. "2026-10-01T00:00:00Z". A bare date is refused.max 40 chars
effectiveLocalstringA wall-clock time, e.g. "2026-10-01T00:00"; requires timezonemax 30 chars
timezonestring | nullIANA zone, e.g. Europe/London; always recordedmax 64 chars
prefixrequiredstring-max 24 chars
raterequirednumberUSD per minutemin 0
originstring-max 24 chars
billingIncrementstring-max 10 chars

Response 201

FieldTypeDescription
datarequiredobjectSame fields as SwitchCustomerSellRate, shown earlier on this page.

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Cancel a scheduled Switch customer sell rate

DELETE/api/v1/switch/customers/{id}/sell-rates/scheduled/{rateId}

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-
rateIdrequiredpathstring (uuid)-

Response 200

FieldTypeDescription
datarequiredobject-
cancelledrequireddata.cancelledboolean-One of true

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE

Set a Switch customer billing cycle and payment terms

POST/api/v1/switch/customers/{id}/billing-settings

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

Test keys: refused with 403 TEST_KEY_NOT_ALLOWED. The Switch has no test mode, so a change always applies to your live configuration. Test keys can still read Switch data.

Parameters

NameInTypeDescription
idrequiredpathstring (uuid)-

Request body (application/json)

FieldTypeDescription
billingCyclestring | null-One of weekly, biweekly, monthly, manual
paymentTermsDaysinteger | null-0 to 365

Response 200

FieldTypeDescription
datarequiredobject-
customerIdrequireddata.customerIdstring (uuid)-
billingCyclerequireddata.billingCyclestring | null-
paymentTermsDaysrequireddata.paymentTermsDaysinteger | null-
nextInvoiceAtrequireddata.nextInvoiceAtstring (date-time) | nullISO-8601 timestamp (UTC)

Response 202

FieldTypeDescription
datarequiredobject-
approvalRequireddata.approvalRequiredboolean-One of true
approvalRequestIddata.approvalRequestIdstring (uuid) | null-
permissiondata.permissionstring-
expiresAtdata.expiresAtstring (date-time)-
messagedata.messagestring-

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.
  • 402SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial.
  • 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.
  • AlsoSTALE_WRITE