If you want to send SMS, place calls with your own caller ID or check your balance and prices from your own code, the Spoof Caller ID REST API gives you all of it with one key. This guide walks you through the whole process step by step, with copyable examples.
Updated November 2026: the API moved to https://app.spoofcallerid.com/v1. The old rest.spoofcallerid.com endpoint with tokens in the request body is retired. Everything below describes the current API.
Step 1: Get your API key
Sign in to app.spoofcallerid.com and open Account → API keys. You get two values:
- an API key, which identifies you
- an API secret, which proves it is you
Keep both in an environment variable on your server. Never put the secret inside a web page or a mobile app.
export SPOOFCALLERID_KEY="<api_key>:<api_secret>"
Step 2: Authenticate every request
All endpoints live under one base URL:
https://app.spoofcallerid.com/v1
Your credential always travels in the Authorization header, never in the body or the URL:
Authorization: Bearer <api_key>:<api_secret>
Check your balance
curl -s 'https://app.spoofcallerid.com/v1/balance' \
-H "Authorization: Bearer $SPOOFCALLERID_KEY"
Response:
{ "balance": 42.5, "currency": "EUR" }
GET /v1/me returns your account as well: id, username, email, balance, currency and status.
Send an SMS
One POST to /v1/sms. The server validates the fields, prices the message for the destination, checks your balance and only then sends it.
curl -s -X POST 'https://app.spoofcallerid.com/v1/sms' \
-H "Authorization: Bearer $SPOOFCALLERID_KEY" \
-H 'Content-Type: application/json' \
-d '{"to": "+447700900123", "text": "Your code is 4821", "sender_id": "Spoof", "country": "GB"}'
Fields:
to (required): the recipient, at least 5 digits, ideally in E.164 format
text (required): 1 to 160 characters; longer or Unicode texts are billed per segment
sender_id (required): the sender name shown to the recipient, 1 to 20 letters or digits
country (optional): ISO-2 code or country name; it selects the rate
route (optional): a route option id, when your account has several SMS routes
A successful answer tells you what the message cost and what is left:
{
"success": true,
"message": "SMS sent successfully.",
"data": { "cost": 0.038, "newBalance": 42.462, "segments": 1, "encoding": "gsm7", "route": "", "batchId": "7f3c2a91" }
}
Place a call with your caller ID
curl -s -X POST 'https://app.spoofcallerid.com/v1/calls' \
-H "Authorization: Bearer $SPOOFCALLERID_KEY" \
-H 'Content-Type: application/json' \
-d '{"to": "+447700900123", "caller_id": "+18005550199", "to_country": "GB", "record": false}'
to and caller_id are required.
to_country is needed when to is a local number.
record: true records the call and adds €0.05.
plan (optional) picks a call plan; without it your default plan is used.
The maximum call length (5 minutes unless your account says otherwise) is reserved and charged when the call is placed.
Get coverage and prices
curl -s 'https://app.spoofcallerid.com/v1/prices?type=sms' \
-H "Authorization: Bearer $SPOOFCALLERID_KEY"
type can be all, sms or call. You get one row per country in EUR, with the ISO-2 code to pass as country / to_country, the call rate per minute with its billing increments, and the SMS price per segment (null when there is no SMS route to that country). Prices are cached for an hour, so it is cheap to check them before every send.
Handling errors
Every failure has the same shape:
{ "error": { "code": "insufficient_balance", "message": "…" } }
Program against error.code and the HTTP status, never against the message text:
- 400
invalid_request: the body is not valid JSON
- 401
unauthorized: the key/secret pair is missing, malformed, wrong or was regenerated
- 402
insufficient_balance: top up; details tells you the cost and your balance
- 404 / 405: wrong path or wrong method
- 422
validation_failed: a field is missing or invalid; fix it and send again
- 502
provider_rejected and 503 service_unavailable: nothing was charged; wait and retry
Frequently Asked Questions
What is the maximum message length?
One request carries up to 160 characters. Unicode texts use shorter segments and are billed per segment.
What are the Sender ID requirements?
1 to 20 letters or digits in the API. Many countries and carriers only display up to 11 characters, some require pre-registration, and carrier restrictions apply.
What if my key leaks?
Regenerate it in Account → API keys. The old pair stops working immediately, so update every script right after.
Can I use it from an AI assistant?
Yes. The API page offers an MCP server that exposes the same five endpoints as tools, and marks the two that spend balance so your assistant asks you first.
The full, interactive reference with a playground is in the app under API.