Switch API reference
Switch: team and audit
Roles, team members, approvals and the audit history.
11 operationsBase URL https://packetexchange.io/api/v1Postman collection
BrowseSwitch: team and audit
Get your role and permissions on the switch
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
operatorIdrequireddata.operatorId | string (uuid) | - |
isAccountHolderrequireddata.isAccountHolder | boolean | - |
rolerequireddata.role | string | null | - |
roleLabelrequireddata.roleLabel | string | null | - |
permissionsrequireddata.permissions | string[] | - |
sensitivePermissionsrequireddata.sensitivePermissions | string[] | - |
scoperequireddata.scope | object | - |
customerIdsrequireddata.scope.customerIds | string (uuid)[] | null | null = all customers |
trunkIdsrequireddata.scope.trunkIds | string (uuid)[] | null | null = all trunks |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List team members and the available roles
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
membersrequireddata.members | object[] | - |
idrequireddata.members[].id | string (uuid) | - |
userIdrequireddata.members[].userId | string (uuid) | - |
emailrequireddata.members[].email | string | - |
contactNamerequireddata.members[].contactName | string | null | - |
rolerequireddata.members[].role | string | - |
roleLabelrequireddata.members[].roleLabel | string | - |
statusrequireddata.members[].status | string | - |
customerIdsrequireddata.members[].customerIds | string (uuid)[] | null | - |
trunkIdsrequireddata.members[].trunkIds | string (uuid)[] | null | - |
noterequireddata.members[].note | string | null | - |
permissionsrequireddata.members[].permissions | string[] | - |
scopeSummaryrequireddata.members[].scopeSummary | object | - |
customersrequireddata.members[].scopeSummary.customers | string | - |
trunksrequireddata.members[].scopeSummary.trunks | string | - |
createdAtrequireddata.members[].createdAt | string (date-time) | ISO-8601 timestamp (UTC) |
updatedAtrequireddata.members[].updatedAt | string (date-time) | ISO-8601 timestamp (UTC) |
rolesrequireddata.roles | object[] | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Add a team member
POST/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Gives an email address a role on your switch, optionally limited to some customers and trunks (null = all).
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)
| Field | Type | Description |
|---|---|---|
emailrequired | string (email) | -max 255 chars |
rolerequired | string | -One of viewer, noc, routing, billing, account_manager, administrator |
customerIds | string (uuid)[] | null | - |
trunkIds | string (uuid)[] | null | - |
note | string | null | -max 500 chars |
Response 201
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchTeamMember, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Change a team member's role, scope or status
PATCH/
- 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
| Name | In | Type | Description |
|---|---|---|---|
memberIdrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
role | string | -One of viewer, noc, routing, billing, account_manager, administrator |
status | string | -One of active, suspended |
customerIds | string (uuid)[] | null | - |
trunkIds | string (uuid)[] | null | - |
note | string | null | -max 500 chars |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchTeamMember, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Suspend a team member
DELETE/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Suspends rather than deletes, so their history stays attributed.
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
| Name | In | Type | Description |
|---|---|---|---|
memberIdrequired | path | string | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchTeamMember, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Search the switch audit history
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Who changed what, when, and under which permission. Cursor-paginated with nextCursor.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
customerId | query | string (uuid) | - |
trunkId | query | string (uuid) | - |
actorUserId | query | string (uuid) | - |
action | query | string | - |
permission | query | string | - |
sensitiveOnly | query | boolean | - |
outcome | query | string | -One of success, failure, denied |
from | query | string (date-time) | - |
to | query | string (date-time) | - |
search | query | string | - |
limit | query | integer | - |
cursor | query | string (uuid) | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
entriesrequireddata.entries | object[] | - |
nextCursorrequireddata.nextCursor | string | null | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Get the values available to filter the audit history by
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
actorsrequireddata.actors | object[] | - |
permissionsrequireddata.permissions | string[] | - |
sensitivePermissionsrequireddata.sensitivePermissions | string[] | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List approval requests
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Actions waiting for (or decided by) a second person. Defaults to pending and approved.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
status | query | string | Comma-separated statuses |
limit | query | integer | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object[] | - |
idrequireddata[].id | string (uuid) | - |
statusrequireddata[].status | string | pending, approved, rejected, expired... |
permissiondata[].permission | string | - |
requestedAtrequireddata[].requestedAt | string (date-time) | ISO-8601 timestamp (UTC) |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Approve or reject an approval request
POST/
- 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
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | - |
Request body (application/json)
| Field | Type | Description |
|---|---|---|
decisionrequired | string | -One of approve, reject |
note | string | null | -max 2000 chars |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | Same fields as SwitchApproval, shown earlier on this page. |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 404
NOT_FOUND: no such resource on your account. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
List approval policies
GET/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
policiesrequireddata.policies | object[] | - |
eligiblerequireddata.eligible | string[] | Permissions that can be put behind an approval |
pendingrequireddata.pending | integer | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.
Set the approval policy for a permission
PUT/
- Access
- API key. Scoped keys need
switch:manage. - Rate limit
- 100 requests per second (the default)
Require a second person to approve actions under this permission, optionally only above an amount.
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)
| Field | Type | Description |
|---|---|---|
permissionrequired | string | -One of customers.view, trunks.view, routing.view, rates.view, billing.view, noc.view, audit.view, team.view, customers.edit, trunks.edit, rates.edit, billing.edit and 12 more |
enabledrequired | boolean | - |
minAmountUsd | number | null | -min 0 |
requireDifferentPerson | boolean | - |
expiresAfterHours | integer | -1 to 2160 |
requireReason | boolean | - |
Response 200
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
Response 202
| Field | Type | Description |
|---|---|---|
datarequired | object | - |
approvalRequireddata.approvalRequired | boolean | -One of true |
approvalRequestIddata.approvalRequestId | string (uuid) | null | - |
permissiondata.permission | string | - |
expiresAtdata.expiresAt | string (date-time) | - |
messagedata.message | string | - |
Errors
- 400
VALIDATION_ERROR,INVALID_INPUTorBAD_REQUEST. ForVALIDATION_ERROR,error.detailsis an array of{ path, message }. - 401
UNAUTHORIZED: missing, invalid, expired or revoked credential. - 402
SWITCH_SUBSCRIPTION_REQUIRED: the account has no active Switch plan or trial. - 403
FORBIDDEN: not allowed - a scoped key lacks the scope, or the endpoint is session-only. - 409
CONFLICT(or a code-specific 409): the change clashes with existing state. - 429
RATE_LIMITED: slow down and retry after theRetry-Afterseconds. - 500
INTERNAL_ERROR: unexpected failure. QuoteX-Request-Idto support.