Skip to main content
The phone primitive provisions US phone numbers and sends/receives SMS via Surge. Numbers are carrier-registered (10DLC) automatically; inbound SMS works immediately while outbound SMS unlocks when the campaign is approved. All endpoints are available company-level (/v1/phone/...) and per-user (/v1/users/:user_id/phone/...). They are gated by the phone primitive in the subject’s AccountKit.

Endpoints

Method & PathDescription
POST /v1/phone/provisionBuy a US number + register the carrier campaign
GET /v1/phoneList phone numbers (optional ?agent=<id>)
GET /v1/phone/statusThe account → campaign → numbers pipeline
GET /v1/phone/:idGet a single phone number
DELETE /v1/phone/:idRelease the number back to the provider (stops billing)
POST /v1/phone/:id/smsSend an outbound SMS (carrier-gated until campaign approval)
GET /v1/phone/:id/messagesList received SMS (newest first, cursor-paginated)
GET /v1/phone/messages/:idRead a single received SMS
GET /v1/phone/:id/campaignThe carrier-registration campaign for a number
GET /v1/phone/:id/assignmentsList agents connected to a number
POST /v1/phone/:id/assignConnect an agent (permissions: send_sms, receive_sms)
DELETE /v1/phone/:id/assign/:agentIdDisconnect an agent

Capabilities object

Every phone row carries a capabilities object reflecting carrier-side state:
{ "voice": false, "sms_inbound": true, "sms_outbound": false, "mms": false }
sms_outbound flips to true automatically when the carrier campaign is approved.

Billing & gating

Provisioning a number charges a one-time carrier registration (first number only) plus the first month’s rental, and is approval-gated by default. Monthly rental recurs per number until released (DELETE /v1/phone/:id). Outbound SMS is billed per 160-char segment and is not approval-gated. Inbound SMS is free. See the guide for credit amounts.

Inbound webhook

Surge delivers inbound events (message.received, campaign.approved, …) to POST /webhooks/surge, verified with the Surge-Signature HMAC-SHA256 header. Received texts are stored and also fan out to your per-user sms.received webhook subscriptions.