Services API
Last updated
Browse available SMS verification services with current pricing, stock levels and the time you have to receive the code.
The service object
Both endpoints return services with these fields. An order can receive its code for code_window_seconds after purchase. The value depends on the service: the window ends shortly before its reservation (ttl_minutes) runs out. An order with no code expires when its window ends and its price is credited back to your balance.
| Field | Type | Description |
|---|---|---|
name | string | Service identifier; use this value when placing orders |
display_name | string | Human-readable service name |
price | number | Price in USD per number rental |
carrier_price | number | Price in USD when you choose a specific carrier (AT&T or T-Mobile): about 20% more |
stock | integer | Numbers available right now. 0 means temporarily out of stock; the service is still listed. |
ttl_minutes | integer | Minutes the number is reserved for this service. Not the order deadline; see code_window_seconds. |
code_window_seconds | integer | Seconds you have to receive the code after renting. It can differ from one service to another. |
GET /v1/services
List services with price, carrier price, stock and code window
Query parameters for listing services
| Name | Type | Required | Description |
|---|---|---|---|
search | string | No | Filter services by name |
page | integer | No | Page number (default: 1) |
per_page | integer | No | Results per page, 1-100 (default: 20) |
Response
{
"services": [
{
"name": "google",
"display_name": "Google",
"price": 1.50,
"carrier_price": 1.80,
"stock": 142,
"ttl_minutes": 10,
"code_window_seconds": 540
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total_pages": 1
}
}Error responses
| Status | Code | Meaning |
|---|---|---|
| 503 | SERVICE_UNAVAILABLE | Temporarily unable to load services. Please try again. |
GET /v1/services/{service_name}
Get the price, stock and code window of one service
Path parameter for a single service
| Name | Type | Required | Description |
|---|---|---|---|
service_name | string | Yes | Service identifier (e.g. "google") |
curl https://api.diddysms.com/v1/services/google \
-H "Authorization: Bearer dsk_your_api_key_here"Response
{
"name": "google",
"display_name": "Google",
"price": 1.50,
"carrier_price": 1.80,
"stock": 142,
"ttl_minutes": 10,
"code_window_seconds": 540
}Error responses
| Status | Code | Meaning |
|---|---|---|
| 404 | NOT_FOUND | Service does not exist |
| 503 | SERVICE_UNAVAILABLE | Temporarily unable to load the service. Please try again. |