Skip to content
First requestVisit website ↗
Navigation

Buy a phone number and optionally configure SMS and Voice

A successful purchase returns HTTP 200 even if setup fails. Inspect setupErrors; never retry the purchase to repair setup. SMS uses the existing workspace SMS route; Voice uses the existing Voice provisioning endpoint.

POST
https://api.channelautomation.com/api/twilio/purchase-number

Authorization

  • BearerAuth
    HTTP Bearer (JWT)
    required

Header parameters

  • x-workspace-id
    string
    required

Request body JSON required

  • workspaceId
    string
    required
  • phoneNumber
    string
    required

    E.164 phone number

  • messagingServiceSid
    optional
    string

    Optional approved A2P messaging service; requires SMS setup

  • configure
    optional
    object
    • sms
      optional
      boolean
      default: false
    • voice
      optional
      boolean
      default: false

Returns

200

Purchased; configuredChannels, a2pAttachment and setupErrors describe setup results

400

Invalid purchase input

401

Authentication required

403

Workspace does not match authorized context

404

Twilio configuration missing

409

Selected campaign is no longer approved; no attachment attempted

502

Purchase not confirmed; check Twilio before retrying

503

Campaign approval could not be checked before purchase

Type to search…

↑↓ navigate↵ selectEsc close