Skip to main content
POST
Buy phone lines
This is a real purchase. Each number costs the full monthly price, taken from your wallet credits first and then from your saved card. Use a new Idempotency-Key for each purchase, and repeat a key only to retry that same purchase. See Buy phone lines.

Authorizations

x-api-key
string
header
required

Your ps_ API key

Headers

Idempotency-Key
string
required

Required. Any string up to 255 characters with no control characters — a UUID per purchase is the usual choice. Tracked per number for one hour, scoped to your workspace: a retry with the same key never charges twice for the same number (the item answers REQUEST_ALREADY_PROCESSED). Missing, empty or whitespace-only → 400 IDEMPOTENCY_KEY_REQUIRED; too long or with a control character (tab included) → 400 IDEMPOTENCY_KEY_INVALID. It is a header, never a body field.

Required string length: 1 - 255

Body

application/json
numbers
string[]
required

1 to 10 distinct numbers, each exactly as GET /v1/phone-lines/available returned it in number: E.164 digits without + — 55, a two-digit area code starting 1–9, then 8 digits (551148637200). Numbers from different area codes can go in the same request. numbers is the only accepted field: anything else is refused with 400 UNKNOWN_FIELDS (the dashboard's requestId does not exist here).

Required array length: 1 - 10 elements
Pattern: ^55[1-9][0-9][0-9]{8}$
Example:

Response

Processed: one result per number, in the order sent. Read results[i].ok — every item may have failed.

results
object[]

One entry per number, in the order sent.