Skip to content

Rent a number

POST
/numbers/rent
curl --request POST \
--url https://api.clearance.rest/numbers/rent \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "type": "temporary", "country": "example", "service": "example", "operator": "example", "phone_number": "example", "line_type": "local", "max_price": 1, "metadata": { "additionalProperty": "example" } }'

temporary: a short-lived number for receiving one verification SMS (service required); the price is held first (the cap, max_price or about twice the catalog price) and the hold is released when the rental fails; the amount charged is the actual rental price and the rest of the hold is returned. monthly: a number you keep for a month at a time; the first month is charged now and renewed every month.

Media typeapplication/json

What to rent: a temporary number for a target service or a monthly number.

object
type
required
string
Allowed values: temporary monthly
country
required

ISO 3166-1 alpha-2 country code (e.g. US).

string
>= 2 characters <= 2 characters
service

Target service code (temporary).

string
>= 1 characters <= 64 characters
operator

Operator (temporary, optional).

string
>= 1 characters <= 128 characters
phone_number

A number from /numbers/catalog/available (monthly).

string
>= 5 characters <= 32 characters
line_type

Line type to search when phone_number is omitted (monthly, default local).

string
Allowed values: local mobile national toll_free
max_price

Highest price in USD you accept; the request fails with 409 max_price_too_low when it is below the current catalog price. Temporary numbers: the catalog price is tried first and higher prices only up to this value; without it the limit is about twice the catalog price.

number
> 0
metadata

Free-form JSON object (at most 16 KB, 5 levels deep, keys up to 64 characters).

object
key
additional properties

Default Response

Media typeapplication/json
object
success
required
boolean
item
required

A number of the project with its status and metadata.

object
id
required
string
phone_number
required
string
type
required
string
Allowed values: temporary monthly device
status
required
string
Allowed values: ACTIVE OFFLINE SIM_REMOVED MOVED RELEASED EXPIRED UNASSIGNED
status_reason
required
string | null
country
required
string | null
capabilities
required
Any of:
object
key
additional properties
boolean
assigned_at
required
Any of:

UTC timestamp (ISO 8601).

string
ended_at
required
Any of:

UTC timestamp (ISO 8601).

string
expires_at
required
Any of:

UTC timestamp (ISO 8601).

string
renews_at
required
Any of:

UTC timestamp (ISO 8601).

string
released_reason
required
string | null
created_at
required

UTC timestamp (ISO 8601).

string
updated_at
required

UTC timestamp (ISO 8601).

string
temporary
required
Any of:
object
service
required
string | null
operator
required
string | null
first_sms_at
required
Any of:

UTC timestamp (ISO 8601).

string
device
required
Any of:
object
carrier_name
required
string | null
present
required
boolean
verified_at
required
Any of:

UTC timestamp (ISO 8601).

string
last_seen_at
required
Any of:

UTC timestamp (ISO 8601).

string
online
required
boolean
metadata
required
Any of:

Free-form JSON object (at most 16 KB, 5 levels deep, keys up to 64 characters).

object
key
additional properties
metadata_version
required

Increases on every change; use it in If-Match.

integer
>= -9007199254740991 <= 9007199254740991
price
required

Amount charged in USD.

number
balance
required

Available balance after the charge in USD.

number
Example
{
"success": true,
"item": {
"type": "temporary",
"status": "ACTIVE"
}
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}

Default Response

Media typeapplication/json

Error envelope returned by every JSON endpoint.

object
success
required
boolean
error
required
object
code
required

Machine-readable error code (snake_case).

string
message
required

Human-readable message.

string
details

Extra context for the error.

object
key
additional properties
Example
{
"success": false
}