Overview
CallNode uses paired credentials — a public API key (shown to you in the dashboard) and a private API secret (shown exactly once at creation time). The key identifies which account is making the request; the secret signs the request body so we can detect tampering and replays.
Required headers
Every request to /api/v1/* requires the following four headers:
| Header | Required | Purpose |
|---|---|---|
X-Api-Key | Required | Your API key. |
X-Timestamp | Required | Unix seconds. Must be within ±300s of server clock. |
X-Signature | Required | Hex-encoded HMAC-SHA256(secret, timestamp + "\n" + body). |
X-Idempotency-Key | Required | UUID. Replays within 5 minutes return the original response. |
Content-Type | Required | application/json |
Computing the signature
The signature is an HMAC-SHA256 over the request timestamp, a literal newline (\n), and the exact JSON body bytes you send on the wire. Any change to the body — whitespace, key order, escaping — invalidates the signature.
const crypto = require('crypto');
const ts = Math.floor(Date.now() / 1000).toString();
const body = JSON.stringify(payload); // canonical bytes you send
const sig = crypto.createHmac('sha256', apiSecret)
.update(ts + '\n' + body)
.digest('hex');
// headers
const headers = {
'X-Api-Key': apiKey,
'X-Timestamp': ts,
'X-Signature': sig,
'X-Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json'
};JSON.stringify(payload) twice with different libraries you may get different bytes (different key orders, different whitespace). Build the string once, then use the same variable for both the signature and the body.Clock skew tolerance
The server accepts timestamps within ±300 secondsof its current clock. If your timestamp is outside that window you'll receive:
| HTTP | Error | Behavior |
|---|---|---|
401 | clock_skew | Response includes X-Server-Time header so the client can self-correct and retry. |
Idempotency
Every call to POST /api/v1/outbound/calls requires anX-Idempotency-Key header containing a UUID you generate. If we see the same key from the same account again within 5 minutes, we return the original response instead of placing a duplicate call.
Replay response
Idempotency replays return HTTP 200 OK (not 202 Accepted) and include the original call's current state, plus an idempotencyReplay: true flag.
{
"callId": "cn-ob-7f3a18a2-9b40-4e1e-9c4e-1b8b9b8e6b3a",
"status": "answered",
"idempotencyReplay": true,
"createdAt": "2026-05-24T17:31:08.421Z"
}Secret rotation
When you rotate a key's secret from the dashboard, the previous secret remains valid for 24 hours. During that window, requests signed with either secret are accepted. After 24 hours, only the new secret is valid.
This dual-secret window lets you:
- Rotate keys without downtime.
- Deploy the new secret to your application without a hard cutover.
- Confirm the new secret works in production before the old one expires.
Environments
The key prefix indicates which environment a key belongs to:
| Prefix | Environment | Behavior |
|---|---|---|
cn_live_ | live | Real outbound calls and messages. Real billing. Real concurrency cap. |
cn_test_ | test | Simulated calls and messages: nothing reaches a carrier, no billing. See Test Mode. |