Speko Docs
API Reference

Phone numbers

Provision managed numbers, import SIP-trunk numbers, update routing, and manage phone-number business verification.

GET
/v1/phone-numbers

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

[
  {
    "id": "string",
    "organizationId": "string",
    "e164": "+12015551234",
    "source": "managed",
    "providerResourceId": "string",
    "telnyxPhoneNumberId": "string",
    "sipTrunkId": "string",
    "sipConnectionInstallationId": "string",
    "sipProviderName": "string",
    "direction": "inbound",
    "dispatchMetadataTemplate": {},
    "agentId": "string",
    "label": "string",
    "sms10dlcProfileId": "string",
    "smsCampaignId": "string",
    "smsAssignmentStatus": "string",
    "smsAssignmentUpdatedAt": "2019-08-24T14:15:22Z",
    "setupStatus": {
      "status": "ready",
      "inboundReady": true,
      "outboundReady": true,
      "agentReady": true,
      "forwardingRequired": true,
      "sipConnectionReady": true,
      "issues": [
        "string"
      ]
    },
    "nextChargeAt": "2019-08-24T14:15:22Z",
    "lastChargedAt": "2019-08-24T14:15:22Z",
    "suspendedAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
]
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/phone-numbers

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "e164": "+12015551234",
  "source": "managed",
  "providerResourceId": "string",
  "telnyxPhoneNumberId": "string",
  "sipTrunkId": "string",
  "sipConnectionInstallationId": "string",
  "sipProviderName": "string",
  "direction": "inbound",
  "dispatchMetadataTemplate": {},
  "agentId": "string",
  "label": "string",
  "sms10dlcProfileId": "string",
  "smsCampaignId": "string",
  "smsAssignmentStatus": "string",
  "smsAssignmentUpdatedAt": "2019-08-24T14:15:22Z",
  "setupStatus": {
    "status": "ready",
    "inboundReady": true,
    "outboundReady": true,
    "agentReady": true,
    "forwardingRequired": true,
    "sipConnectionReady": true,
    "issues": [
      "string"
    ]
  },
  "nextChargeAt": "2019-08-24T14:15:22Z",
  "lastChargedAt": "2019-08-24T14:15:22Z",
  "suspendedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/phone-numbers/available

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Query Parameters

areaCode?string
Match^\d{3}$
locality?string
limit?integer
Default10
Range1 <= value <= 50

Response Body

application/json

application/json

[
  {
    "e164": "+12015551234",
    "friendlyName": "string",
    "monthlyCostUsd": 0,
    "upfrontCostUsd": 0,
    "features": [
      "string"
    ],
    "region": {}
  }
]
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/phone-numbers/import

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "e164": "+12015551234",
  "source": "managed",
  "providerResourceId": "string",
  "telnyxPhoneNumberId": "string",
  "sipTrunkId": "string",
  "sipConnectionInstallationId": "string",
  "sipProviderName": "string",
  "direction": "inbound",
  "dispatchMetadataTemplate": {},
  "agentId": "string",
  "label": "string",
  "sms10dlcProfileId": "string",
  "smsCampaignId": "string",
  "smsAssignmentStatus": "string",
  "smsAssignmentUpdatedAt": "2019-08-24T14:15:22Z",
  "setupStatus": {
    "status": "ready",
    "inboundReady": true,
    "outboundReady": true,
    "agentReady": true,
    "forwardingRequired": true,
    "sipConnectionReady": true,
    "issues": [
      "string"
    ]
  },
  "nextChargeAt": "2019-08-24T14:15:22Z",
  "lastChargedAt": "2019-08-24T14:15:22Z",
  "suspendedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/phone-numbers/kyb

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Response Body

application/json

application/json

{
  "status": "missing",
  "submission": {
    "id": "string",
    "organizationId": "string",
    "status": "draft",
    "businessProfile": {
      "legalName": "string",
      "displayName": "string",
      "entityType": "string",
      "country": "string",
      "registrationId": "string",
      "website": "http://example.com",
      "address": {},
      "useCase": "string",
      "expectedUsage": "string"
    },
    "authorizedRepresentative": {
      "name": "string",
      "title": "string",
      "email": "user@example.com",
      "phone": "+12015551234"
    },
    "attestationAccepted": true,
    "attestedAt": "2019-08-24T14:15:22Z",
    "submittedAt": "2019-08-24T14:15:22Z",
    "rejectionReason": "string",
    "slackNotificationStatus": "not_queued",
    "slackNotificationJobId": "string",
    "slackNotificationError": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "prefill": {
    "businessProfile": {
      "legalName": "string",
      "displayName": "string",
      "entityType": "string",
      "country": "string",
      "registrationId": "string",
      "website": "http://example.com",
      "address": {},
      "useCase": "string",
      "expectedUsage": "string"
    },
    "authorizedRepresentative": {
      "name": "string",
      "title": "string",
      "email": "user@example.com",
      "phone": "+12015551234"
    }
  }
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
PUT
/v1/phone-numbers/kyb/draft

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "status": "draft",
  "businessProfile": {
    "legalName": "string",
    "displayName": "string",
    "entityType": "string",
    "country": "string",
    "registrationId": "string",
    "website": "http://example.com",
    "address": {},
    "useCase": "string",
    "expectedUsage": "string"
  },
  "authorizedRepresentative": {
    "name": "string",
    "title": "string",
    "email": "user@example.com",
    "phone": "+12015551234"
  },
  "attestationAccepted": true,
  "attestedAt": "2019-08-24T14:15:22Z",
  "submittedAt": "2019-08-24T14:15:22Z",
  "rejectionReason": "string",
  "slackNotificationStatus": "not_queued",
  "slackNotificationJobId": "string",
  "slackNotificationError": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
POST
/v1/phone-numbers/kyb/submit

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "status": "draft",
  "businessProfile": {
    "legalName": "string",
    "displayName": "string",
    "entityType": "string",
    "country": "string",
    "registrationId": "string",
    "website": "http://example.com",
    "address": {},
    "useCase": "string",
    "expectedUsage": "string"
  },
  "authorizedRepresentative": {
    "name": "string",
    "title": "string",
    "email": "user@example.com",
    "phone": "+12015551234"
  },
  "attestationAccepted": true,
  "attestedAt": "2019-08-24T14:15:22Z",
  "submittedAt": "2019-08-24T14:15:22Z",
  "rejectionReason": "string",
  "slackNotificationStatus": "not_queued",
  "slackNotificationJobId": "string",
  "slackNotificationError": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
GET
/v1/phone-numbers/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "e164": "+12015551234",
  "source": "managed",
  "providerResourceId": "string",
  "telnyxPhoneNumberId": "string",
  "sipTrunkId": "string",
  "sipConnectionInstallationId": "string",
  "sipProviderName": "string",
  "direction": "inbound",
  "dispatchMetadataTemplate": {},
  "agentId": "string",
  "label": "string",
  "sms10dlcProfileId": "string",
  "smsCampaignId": "string",
  "smsAssignmentStatus": "string",
  "smsAssignmentUpdatedAt": "2019-08-24T14:15:22Z",
  "setupStatus": {
    "status": "ready",
    "inboundReady": true,
    "outboundReady": true,
    "agentReady": true,
    "forwardingRequired": true,
    "sipConnectionReady": true,
    "issues": [
      "string"
    ]
  },
  "nextChargeAt": "2019-08-24T14:15:22Z",
  "lastChargedAt": "2019-08-24T14:15:22Z",
  "suspendedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
PATCH
/v1/phone-numbers/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

{
  "id": "string",
  "organizationId": "string",
  "e164": "+12015551234",
  "source": "managed",
  "providerResourceId": "string",
  "telnyxPhoneNumberId": "string",
  "sipTrunkId": "string",
  "sipConnectionInstallationId": "string",
  "sipProviderName": "string",
  "direction": "inbound",
  "dispatchMetadataTemplate": {},
  "agentId": "string",
  "label": "string",
  "sms10dlcProfileId": "string",
  "smsCampaignId": "string",
  "smsAssignmentStatus": "string",
  "smsAssignmentUpdatedAt": "2019-08-24T14:15:22Z",
  "setupStatus": {
    "status": "ready",
    "inboundReady": true,
    "outboundReady": true,
    "agentReady": true,
    "forwardingRequired": true,
    "sipConnectionReady": true,
    "issues": [
      "string"
    ]
  },
  "nextChargeAt": "2019-08-24T14:15:22Z",
  "lastChargedAt": "2019-08-24T14:15:22Z",
  "suspendedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
DELETE
/v1/phone-numbers/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Resource id.

Response Body

application/json

application/json

{
  "released": true
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}