API reference
Four endpoints to list countries, claim a number, read the code and release the number. Send your key as a Bearer token in every request.
https://numvia.org/api/v1Authentication
Create a key on the Developer API page, then add it to the Authorization header. Keys work until you revoke them.
Authorization: Bearer YOUR_KEY Accept: application/json
List countries in stock
Countries that have numbers right now. Each item's id is the country calling code.
GET /api/v1/numbers
countryquery, optionalFilter by country name or calling code, e.g. indonesia or 62curl "https://numvia.org/api/v1/numbers?country=62" \ -H "Authorization: Bearer YOUR_KEY"
const r = await fetch('https://numvia.org/api/v1/numbers', {
headers: { Authorization: 'Bearer YOUR_KEY' }
});
const { data } = await r.json();$r = Http::withToken('YOUR_KEY')->get('https://numvia.org/api/v1/numbers');
$countries = $r->json('data');
Example response
{
"ok": true,
"data": [
{ "id": "62", "country_name": "Indonesia", "stock": 128,
"services": [{ "name": "WhatsApp", "stock": 90 }] }
]
}Claim a number
Reserve a number from a country for 20 minutes. Save the returned id to read messages.
POST /api/v1/numbers/{id}/claim
idpath, requiredCountry calling code from the list, e.g. 62servicebody, optionalService id, e.g. whatsappcurl -X POST "https://numvia.org/api/v1/numbers/62/claim" \ -H "Authorization: Bearer YOUR_KEY"
const r = await fetch('https://numvia.org/api/v1/numbers/62/claim', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_KEY' }
});
const { data } = await r.json(); // data.id, data.number$r = Http::withToken('YOUR_KEY')->post('https://numvia.org/api/v1/numbers/62/claim');
$claimId = $r->json('data.id');
Example response
{
"ok": true,
"data": { "id": 88, "number": "6281234567890",
"country": "Indonesia", "expires_at": "2026-11-24T16:20:00Z" }
}Read messages
Poll every 5 to 10 seconds until a code arrives. status turns expired when time is up.
GET /api/v1/numbers/{claim_id}/messages
claim_idpath, requiredThe id returned by Claim a numbercurl "https://numvia.org/api/v1/numbers/88/messages" \ -H "Authorization: Bearer YOUR_KEY"
const r = await fetch('https://numvia.org/api/v1/numbers/88/messages', {
headers: { Authorization: 'Bearer YOUR_KEY' }
});
const { status, data } = await r.json();$r = Http::withToken('YOUR_KEY')->get('https://numvia.org/api/v1/numbers/88/messages');
$code = $r->json('data.0.verification_code');
Example response
{
"ok": true,
"status": "active",
"data": [
{ "id": 412, "message": "Your code is 482913",
"verification_code": "482913", "received_at": "2026-11-24T16:03:11Z" }
]
}Release a number
Give the number back early when you are done.
POST /api/v1/numbers/{claim_id}/release
claim_idpath, requiredThe id returned by Claim a numbercurl -X POST "https://numvia.org/api/v1/numbers/88/release" \ -H "Authorization: Bearer YOUR_KEY"
await fetch('https://numvia.org/api/v1/numbers/88/release', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_KEY' }
});Http::withToken('YOUR_KEY')->post('https://numvia.org/api/v1/numbers/88/release');
Example response
{ "ok": true, "message": "Number released successfully" }Errors & limits
Errors return "ok": false with an error message.
401Missing or wrong API key
404Country has no stock, or the number isn't yours
409Number already taken, try again
429Too many requests (60 per minute) or too many active numbers
503Number server busy, retry in a few seconds