/activationsnumbers:writeBuy a number
Reserves a number for one service and one verification. The number is held for twenty minutes; if no message arrives inside that window the activation is closed and refunded in full by the expiry sweep, without you calling anything.
Parámetros
| Parámetro | Tipo | En | Descripción |
|---|---|---|---|
serviceobligatorio | string | body | Service slug or legacy short code — telegram and tg both resolve to the same service. Required unless you send service_id. |
service_id | integer | body | Numeric service id from GET /services. Use it instead of service, never alongside it. |
country | string | body | ISO 3166-1 alpha-2, upper or lower case. Omit it and the cheapest country that currently has stock is chosen for you. |
country_id | integer | body | Numeric country id from GET /countries. Takes precedence over country when both are sent. |
max_price_cents | integer | body | Refuse the purchase above this price, in euro cents. Between 1 and 100000. Offers over the ceiling are skipped, and 409 no_stock is returned if none are left. |
allow_multiple_sms | boolean | body | Keep the number listening after the first message so POST /activations/{id}/resend can ask for another. Defaults to false. |
Idempotency-Key | string | header | Up to 128 characters. Replaying the same key within 24 hours returns the original activation with status 200 and an Idempotent-Replay: true header, instead of buying a second number. |
Notas
- The account's first top-up has to settle before any purchase succeeds. Until it does, every call here returns 402 with code
top_up_required. - Up to four candidate offers are tried in price order before the request gives up, so a single operator glitch does not surface as a failure.
price_centsis the final charge. It is debited when the number is reserved and refunded in full if nothing arrives.
Petición
-kw">curl -X POST https://virtualsmsnumbers.com/api/v1/activations \
-H "Authorization: Bearer $VSN_KEY" \
-H "Idempotency-Key: 9f1c2a44-2f0e-4c8e-9a2b-6f9a2c7d3e10" \
-H "Content-Type: application/json" \
-d '{"service":"telegram","country":"PT","max_price_cents":25}'Respuesta201 Created
{
"id": "1043872915",
"object": "activation",
"status": "waiting",
"phone_number": "351926114508",
"country": "PT",
"country_id": 117,
"country_name": "Portugal",
"service": "telegram",
"service_code": "tg",
"service_name": "Telegram",
"price_cents": 11,
"price": "0.11",
"currency": "EUR",
"refunded_cents": 0,
"allow_multiple_sms": false,
"created_at": "2026-08-26T12:21:07.412Z",
"expires_at": "2026-08-26T12:41:07.412Z",
"completed_at": null,
"messages": [],
"code": null
}