ResourcesPhone Numbers

Phone Numbers

Search, purchase, retrieve, and release phone numbers for Talkturo telephony, plus carrier webhook endpoints for KYC and compliance status updates.

curl -G "https://app.talkturo.com/api/phone-numbers/search" \
  -H "Cookie: sb-session=sb-session-example-a92k3m" \
  --data-urlencode "countryCode=US" \
  --data-urlencode "areaCode=415" \
  --data-urlencode "features=sms,voice"
{
  "success": true,
  "numbers": [
    {
      "phoneNumber": "+14155550182",
      "country": "US",
      "type": "local",
      "cost": "1.00",
      "features": ["sms", "voice"]
    },
    {
      "phoneNumber": "+14155550347",
      "country": "US",
      "type": "local",
      "cost": "1.00",
      "features": ["voice"]
    }
  ]
}
curl -X POST "https://app.talkturo.com/api/phone-numbers/purchase" \
  -H "Content-Type: application/json" \
  -H "Cookie: sb-session=sb-session-example-a92k3m" \
  -d '{
    "phoneNumber": "+14155550182",
    "accountSlug": "acme-sales",
    "bundleId": "BU7d2c9f4e18a2"
  }'
{
  "success": true,
  "phoneNumber": {
    "id": "pn_7c9c4f2a61d1",
    "phoneNumber": "+14155550182",
    "status": "active",
    "accountSlug": "acme-sales"
  }
}

Manage phone numbers

Use the phone number endpoints to search carrier inventory, provision numbers to an account, inspect an existing number, and release numbers you no longer need. This page also documents the carrier webhook endpoints Talkturo uses to keep KYC and compliance status in sync.

All phone number endpoints require an authenticated session cookie unless noted otherwise. The two webhook endpoints are exceptions because carriers call them directly.

Endpoint summary

MethodPathAuthPurpose
GET/api/phone-numbers/searchSession cookieSearch available numbers from the carrier
POST/api/phone-numbers/purchaseSession cookiePurchase and provision a phone number
GET/api/phone-numbers/{id}Session cookieRetrieve a specific phone number
DELETE/api/phone-numbers/{id}Session cookieRelease a phone number
POST/api/phone-numbers/telnyx-webhookCarrier signatureReceive Telnyx KYC status updates
POST/api/phone-numbers/twilio-webhookNoneReceive Twilio bundle status callbacks

Search available phone numbers

Search returns numbers currently available from the configured carrier, filtered by location and feature requirements.

Query parameters

query
areaCodestring

Filter results to a local area code. Support depends on the carrier and country.

query
countryCodestring

Filter results by country. Use a carrier-supported country code such as US.

query
phoneNumberPatternstring

Match numbers against a pattern supported by the carrier. Use this when you want vanity-style or partially constrained numbers.

query
featuresstring

Filter by required number capabilities. Available values depend on the carrier. Pass carrier-specific feature names as a comma-separated string in the request URL.

Response fields

successboolean
Required

Returns true when the search request succeeds.

numbersarray
Required

List of available numbers returned by the carrier after filters are applied.

numbers[].phoneNumberstring
Required

The purchasable phone number in E.164 format when provided by the carrier.

numbers[].countrystring

Country associated with the returned number.

numbers[].typestring

Carrier number type, such as local.

numbers[].coststring

Recurring or quoted provisioning cost returned by the carrier.

numbers[].featuresarray

Capabilities available on the number, such as sms or voice.

Purchase a phone number

Purchase provisions a number to an account. The request body always includes the selected phone number and account slug, and may include additional carrier-specific fields.

Request body

body
phoneNumberstring
Required

The phone number to provision. Pass the exact value returned by the search endpoint.

body
accountSlugstring
Required

Slug of the account that will own the purchased number.

body
carrier-specific fieldsobject

Additional fields required by the carrier or compliance workflow. The accepted shape depends on the carrier handling the purchase request.

Response fields

successboolean
Required

Returns true when provisioning succeeds.

phoneNumberobject
Required

The newly provisioned phone number record.

phoneNumber.idstring
Required

Talkturo identifier for the phone number record.

phoneNumber.phoneNumberstring
Required

Provisioned phone number value.

phoneNumber.statusstring

Current lifecycle status for the number, such as active.

Provisioning notes

Carrier requirements vary by country, number type, and regulatory flow. If the carrier requires compliance data, include those fields in the same purchase request body.

Retrieve a phone number

Retrieve a single phone number record by its Talkturo identifier.

Path parameters

path
idstring
Required

Unique phone number identifier.

Example response

{
  "success": true,
  "phoneNumber": {
    "id": "pn_7c9c4f2a61d1",
    "phoneNumber": "+14155550182",
    "status": "active"
  }
}

Response fields

successboolean
Required

Returns true when the record is found and the request succeeds.

phoneNumberobject
Required

Phone number record associated with the requested identifier.

phoneNumber.idstring
Required

Unique identifier for the phone number record.

phoneNumber.phoneNumberstring
Required

Stored phone number value.

phoneNumber.statusstring

Current status of the number in Talkturo.

Release a phone number

Release removes a provisioned number so it is no longer assigned to your account. Use this endpoint when you no longer need the number.

Path parameters

path
idstring
Required

Unique phone number identifier to release.

Example response

{
  "success": true,
  "message": "Phone number released"
}

Response fields

successboolean
Required

Returns true when the release request succeeds.

messagestring
Required

Human-readable confirmation that the number was released.

Telnyx webhook

Telnyx calls this endpoint when KYC or requirement group status changes. Talkturo verifies the request signature, extracts the requirement_group_id, and updates the matching compliance request.

This endpoint requires ED25519 signature verification using the TELNYX_PUBLIC_KEY environment variable. If the public key is not configured, the endpoint returns 503. If signature verification fails, the endpoint returns 400.

Endpoint behavior

  • Method: POST
  • Path: /api/phone-numbers/telnyx-webhook
  • Authentication: Telnyx ED25519 signature verification
  • Body format: Raw JSON body from Telnyx
  • Retry behavior: After successful verification and processing, the endpoint always returns 200 to prevent carrier retries

Request body

body
Telnyx event payloadobject
Required

Raw Telnyx event JSON. Talkturo reads the raw request body to verify the signature before parsing the payload.

Response fields

receivedboolean
Required

Returns true after Talkturo accepts the webhook request for processing.

statusstring

Current requirement group or compliance status after synchronization.

updatedboolean

Indicates whether Talkturo updated a matching compliance record.

matchedRequestboolean

Indicates whether the webhook matched an existing compliance request in Talkturo.

Twilio webhook

Twilio calls this endpoint when bundle status changes. Talkturo does not trust the posted status value directly and instead re-fetches the current bundle status from Twilio before updating internal records.

This endpoint does not require a signature header. For security, Talkturo reads BundleSID, BundleSid, or bundle_sid from the form-encoded payload and verifies the current state by querying Twilio directly.

Endpoint behavior

  • Method: POST
  • Path: /api/phone-numbers/twilio-webhook
  • Authentication: None
  • Body format: Form-encoded callback payload
  • Retry behavior: The endpoint always returns 200 to prevent Twilio retries

Request body

body
BundleSIDstring

Twilio bundle identifier. The endpoint also accepts BundleSid and bundle_sid.

body
BundleSidstring

Alternative Twilio field name for the bundle identifier.

body
bundle_sidstring

Lowercase variant of the Twilio bundle identifier field.

Response fields

receivedboolean
Required

Returns true after Talkturo accepts the callback.

statusstring

Bundle status retrieved directly from Twilio.

matchedRequestboolean

Indicates whether the callback matched an existing compliance request in Talkturo.

Common response patterns

Most phone number endpoints return a success envelope around the resource payload.

Success envelope

{
  "success": true
}

Webhook acknowledgement envelope

{
  "received": true
}