https://api.callnode.io. Requests are signed with the same X-Api-Key / X-Timestamp / X-Signature HMAC scheme as the Calls and Messaging APIs — one API key works everywhere. See Authentication.Signing GET / DELETE requests
// GET and DELETE requests sign an EMPTY body: the payload is timestamp + "\n".
const crypto = require('crypto');
const ts = Math.floor(Date.now() / 1000).toString();
const sig = crypto.createHmac('sha256', apiSecret).update(ts + '\n').digest('hex');
// GET https://api.callnode.io/api/v1/numbers/available?type=local&areaCode=828
// Headers: X-Api-Key: <apiKey>, X-Timestamp: ts, X-Signature: sigSearch available numbers
/api/v1/numbers/availableQuery parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Optional | local (default) or tollfree. |
areaCode | string | local only | 3-digit area code, e.g. 828. Required when type=local. |
prefix | string | Optional | Toll-free prefix: 800–888. 800 and 822 inventory is usually exhausted; 833–888 have stock. |
vanity | string | Optional | Toll-free vanity word, 4–7 letters or digits (e.g. NEWCAR). Takes precedence over prefix. Matches are sparse. |
quantity | integer | Optional | Candidates to return, 1–25. Defaults to 10. |
Response — 200 OK
{
"numbers": [
{
"phoneNumber": "+18282129522",
"type": "local",
"city": "GRANITE FALLS",
"region": "NC",
"rateCenter": "GRANITEFLS"
}
],
"count": 1,
"pricing": {
"setupFee": 0,
"monthlyFee": 1.99,
"perMinuteRate": 0.02,
"totalDueNow": 1.99,
"includedInSubscription": false
}
}The pricing block is account-specific and authoritative: it reflects your plan's current rates and any included-number slots, sototalDueNow is exactly what a purchase would deduct from your wallet right now. The amounts in these examples are those of a Pro Bundle account adding a local number beyond the ones its plan includes; on pay as you go you see the rates on the pricing page. An empty numbers array means no inventory in that area — try a neighboring area code or another toll-free prefix.
Pro Bundle included numbers are assigned in purchase order.The plan's included-number slots are filled by your earliest-purchased active CallNode API numbers (any mix of local and toll-free). A new purchase is included only while a slot is free; releasing an included number hands its slot to the next number you bought. The slots are never chosen at random or picked by you, wholesale numbers never occupy one, and the dashboard marks which numbers are currently included.
Purchase a number
/api/v1/numbers402 without side effects. A failed carrier order returns 502 and nothing is billed.Request body
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber | string (E.164) | Required | A number returned by the availability search. |
type | string | Optional | local or tollfree. Derived from the number itself when omitted (8NN prefixes are toll-free). |
friendlyName | string | Optional | Display label, up to 100 characters. |
tags | string[] | Optional | Your own labels for the number (up to 10, each 1–24 characters: letters, digits, spaces, dots, underscores, hyphens). Trimmed and de-duplicated case-insensitively; returned on every number and filterable on the dashboard. Replace the whole list with PATCH; send [] to clear. |
voice | object | Optional | Voice config: webhook, realtime WebSocket, or SIP trunk delivery — see Webhook configuration. |
messaging | object | Optional | Messaging webhook config — see Webhook configuration. |
Example request body
{
"phoneNumber": "+18282129522",
"friendlyName": "Support line",
"tags": ["support", "east-coast"],
"voice": {
"webhookUrl": "https://yourcrm.example.com/voice/n8n",
"webhookAuth": {
"type": "header",
"headerName": "X-API-Key",
"value": "your-n8n-secret"
},
"webhookTimeout": 30000
},
"messaging": {
"webhookUrl": "https://yourcrm.example.com/sms/n8n",
"webhookAuth": { "type": "bearer", "value": "your-token" },
"enabled": true
}
}Success response — 201 Created
{
"number": {
"id": "cmcx1a2b30001pp4hexample",
"phoneNumber": "+18282129522",
"type": "local",
"friendlyName": "Support line",
"status": "active",
"purchaseSource": "api",
"tags": ["support", "east-coast"],
"voice": {
"webhookUrl": "https://yourcrm.example.com/voice/n8n",
"webhookAuth": { "type": "header", "headerName": "X-API-Key", "valueSet": true },
"webhookTimeout": 30000
},
"messaging": {
"webhookUrl": "https://yourcrm.example.com/sms/n8n",
"webhookAuth": { "type": "bearer", "valueSet": true },
"enabled": true,
"ready": false
},
"monthlyRate": 1.99,
"perMinuteRate": 0.02,
"includedInSubscription": false,
"createdAt": "2026-07-12T22:10:04.000Z",
"updatedAt": "2026-07-12T22:10:04.000Z"
},
"charged": 1.99,
"breakdown": { "setupFee": 0, "monthlyFee": 1.99, "total": 1.99 },
"wallet": { "previousBalance": 25.00, "newBalance": 23.01 },
"includedInSubscription": false,
"idempotencyReplay": false
}Purchase semantics
Idempotent on the number. Re-purchasing a number you already own returns200 with the existing record andidempotencyReplay: true — nothing is billed twice. Safe to retry after a timeout.
Released numbers restore automatically.If you previously released the number, purchasing it again restores it from your account's recycle bin (with fresh billing) instead of placing a new carrier order.
Messaging activates asynchronously.Voice is routable on activation; carrier messaging registration (10DLC for local, Toll-Free Verification for toll-free) completes in the background. Poll the number's messaging.ready flag — sends before registration completes return 403 from the Messaging API.
Webhook configuration
The same voice and messaging objects are accepted at purchase time and by PATCH /api/v1/numbers/:id. Send only the fields you want to change.
| Field | Type | Description |
|---|---|---|
voice.webhookUrl | string | Where your AI agent runs. Invoked when an inbound call connects, then once per caller utterance — the same contract as the conversational webhook. Empty string disconnects it. Must be a public address: a loopback, private or internal address is refused with 400 validation_error. |
voice.webhookAuth | object | How CallNode authenticates to your endpoint — see auth types below. |
voice.webhookTimeout | integer | How long each turn of the voice webhook may take on calls to this number (Web Voice and SIP trunk calls to it included), in milliseconds, 1000–120000. Default 30000. Calls you place through the API wait 30 seconds. See timeouts and retries. |
voice.realtime | object | Realtime WebSocket mode: { "url": "wss://…", "auth": { … }, "voice": "…" }. Inbound calls stream over your socket and the webhook stays the fallback. Accepted at purchase and on update; null turns it off. See Realtime WebSocket. |
voice.trunkId | string | Deliver inbound calls to one of your SIP trunks instead of an agent. Exclusive with voice.sipUri; setting one clears the other. See SIP trunking. |
voice.sipUri | string | Deliver inbound calls straight to a SIP address, sip:user@host[:port][;transport=udp|tcp|tls]. Exclusive with voice.trunkId. |
voice.srtp | boolean | Encrypt the audio on that delivery leg (SRTP, AES-CM-128 via SDES). Accepted only beside a voice.sipUri ending in ;transport=tls; cleared when the address changes to UDP/TCP or to a trunk. Default false. See encrypted delivery. |
messaging.webhookUrl | string | POSTed for each inbound SMS/MMS to this number. Must be a public address: a loopback, private or internal address is refused with 400 validation_error. |
messaging.webhookAuth | object | Same shape as voice.webhookAuth. |
messaging.enabled | boolean | Master switch for inbound message forwarding. Default true. |
Webhook auth types
| Type | Fields | What we send |
|---|---|---|
none | — | No auth header. |
basic | value = user:pass | Authorization: Basic <base64> |
bearer | value = token | Authorization: Bearer <token> |
header | headerName + value | <headerName>: <value> (e.g. an n8n header-auth credential) |
{ "type": "header", "headerName": "X-API-Key", "valueSet": true } — to rotate a secret, just PATCH a new value.List your numbers
/api/v1/numbersRetrieve a number
/api/v1/numbers/:idUpdate webhooks & config
/api/v1/numbers/:idExample request body
{
"tags": ["support", "after-hours"],
"voice": {
"webhookUrl": "https://yourcrm.example.com/voice/n8n",
"webhookAuth": {
"type": "header",
"headerName": "X-API-Key",
"value": "your-n8n-secret"
}
},
"messaging": {
"enabled": true
}
}Returns 200 with the updated number object. Changes take effect for the next inbound call or message.
A number can also receive faxes: the same endpoint takes a fax object (receive mode, notify emails, fax webhook). See Hosted fax.
Release a number
/api/v1/numbers/:id{
"id": "cmcx1a2b30001pp4hexample",
"phoneNumber": "+18282129522",
"released": true,
"restorable": true
}Released numbers are parked in a recycle bin tied to your account rather than discarded — when restorable is true, purchasing the same number again later restores it. Inbound calls and messages stop immediately on release.
SIP trunk ingress (inbound)
Beyond the public phone network, you can send calls into CallNode straight from your own SIP infrastructure — a PBX, SBC, or softswitch — and reach the same AI agents that answer your CallNode numbers. This direction is inbound: your equipment originates the call and CallNode answers it. It is configured on a SIP trunk in the dashboard, not through this API. See SIP Trunking for the full guide covering egress, ingress, and BYOC inbound delivery.
- Create a SIP trunk and list the public IPv4 source addresses your PBX/SBC will send from (up to 10; private ranges are rejected). Ingress is IP-authenticated — only calls from these addresses are accepted.
- Point your PBX/SBC at
sip.callnode.io:5062over UDP or TCP. Audio is G.711 (PCMU/PCMA) and DTMF is RFC 2833. - Set the dialed numberto one of your CallNode numbers — the call routes to that number's voice webhook agent. If the dialed number isn't one of yours, the trunk's default agent number answers instead.
voice.webhookUrl exactly like a call from the public phone network — the conversational webhook contract is identical. Configure the webhook per number with PATCH /api/v1/numbers/:id above.HTTP response codes
| Status | Meaning |
|---|---|
| 200 | Success (retrieve/list/update/release), or an idempotent purchase replay. |
| 201 | Number purchased and billed. |
| 400 | validation_error — malformed number, bad webhook URL/auth, missing areaCode, etc. The message field says exactly what to fix. |
| 401 | Auth failed (invalid signature, clock skew, revoked key). |
| 402 | insufficient_balance — body includes required, current, and needed. Top up and retry. |
| 404 | No such number on your account. |
| 409 | number_unavailable — already owned by another account or reserved. Search again and pick another. |
| 429 | Rate limit exceeded. |
| 502 | search_failed / provider_error — the carrier operation failed. Nothing was billed; retry or pick another number. |