Getting Started
Base URL
All public API v1 endpoints are under this base URL:
https://wantsms.com/api/public/v1
Authentication
API key authentication
Create an API key in your dashboard and send it as a bearer token. Do not expose API keys in browser JavaScript.
Authorization: Bearer wms_your_api_key
`X-API-Key` is accepted for simple clients, but do not send both authentication headers in the same request.
Errors
Response format
Success response
{
"ok": true
}
Error response
{
"ok": false,
"error": "Missing or invalid API key."
}
400 Bad request
401 Missing or invalid API key
402 Insufficient credits
404 Not found
409 Already processed
422 Validation error
Durations
Allowed duration values
Reserve renewable rental
thirtyDay, ninetyDay, oneYear
Reserve standard rental
oneDay, threeDay, sevenDay, fourteenDay, thirtyDay, ninetyDay, oneYear
Extend standard rental
threeDay, sevenDay, fourteenDay, thirtyDay, ninetyDay, oneYear
US Area Codes
Optional area code selection
List available US area codes. Use q to search by area code or state, page to move through results, and limit to control how many area codes are returned per page.
/rentals/us/area-codes.php
Use the exact area_code value from this response when passing area_code to a renewable or standard reserve endpoint. area_code is optional. Exclude it if you do not want to select an area code.
Example response
{
"ok": true,
"country_iso": "US",
"items": [
{
"area_code": "726",
"state": "Texas"
}
],
"total": 317,
"next_page": 2,
"page": 1,
"limit": 50
}
US Renewable Rentals
Renewable rental endpoints
/rentals/us/renewable/services.php
List available renewable rental services.
By default, this endpoint returns all available renewable service names with pagination. Use q to search services, page to move through results, and limit to control how many services are returned per page.
Use the exact name value from this response when calling the reserve endpoint.
/rentals/us/renewable/pricing.php
Get the current sell price for a US renewable rental before reserving a number.
Send values as query parameters. Required: service_name, duration, capability. Optional: area_code.
Allowed renewable durations: thirtyDay, ninetyDay, oneYear.
Example request
GET /rentals/us/renewable/pricing.php?service_name=airbnb&duration=thirtyDay&capability=sms
area_code is optional. Add it only if you want to price area-code selection.
Example response
{
"ok": true,
"category": "us_renewable",
"service_name": "airbnb",
"capability": "sms",
"duration": "thirtyDay",
"area_code": null,
"sell_price_usd": "14.60",
"currency": "USD"
}
/rentals/us/renewable/reserve.php
Reserve a US renewable rental number.
JSON request body
{
"service_name": "airbnb",
"duration": "thirtyDay",
"capability": "sms",
"area_code": "726"
}
area_code is optional. Exclude it if you do not want to select an area code.
/rentals/us/renewable/renew.php
Renew an active renewable rental.
When you reserve a rental, the response includes a unique WantSMS rental id. Use that id here to renew the rental.
Renewable rentals renew for the same duration used when the rental was first bought. For example, a thirtyDay rental renews for thirtyDay, and a ninetyDay rental renews for ninetyDay.
JSON request body
{
"id": 456
}
US Standard Rentals
Standard rental endpoints
US standard rentals are non-renewable rentals.
/rentals/us/standard/services.php
List available standard rental services.
By default, this endpoint returns all available standard service names with pagination. Use q to search services, page to move through results, and limit to control how many services are returned per page.
Use the exact name value from this endpoint when calling the reserve endpoint.
/rentals/us/standard/pricing.php
Get the current sell price for a US standard rental before reserving a number.
Send values as query parameters. Required: service_name, duration, capability. Optional: area_code.
Allowed standard durations: oneDay, threeDay, sevenDay, fourteenDay, thirtyDay, ninetyDay, oneYear.
Example request
GET /rentals/us/standard/pricing.php?service_name=airbnb&duration=oneDay&capability=sms
area_code is optional. Add it only if you want to price area-code selection.
Example response
{
"ok": true,
"category": "us_standard",
"service_name": "airbnb",
"capability": "sms",
"duration": "oneDay",
"area_code": null,
"sell_price_usd": "3.30",
"currency": "USD"
}
/rentals/us/standard/reserve.php
Reserve a US standard rental number.
JSON request body
{
"service_name": "airbnb",
"duration": "thirtyDay",
"capability": "sms",
"area_code": "726"
}
area_code is optional. Exclude it if you do not want to select an area code.
/rentals/us/standard/extend.php
Extend an active standard rental.
When you reserve a rental, the response includes a unique WantSMS rental id. Use that id here to extend the rental.
JSON request body
{
"id": 456,
"extension_duration": "threeDay"
}
Need Help?
API support
If you need help with integration or have questions regarding the API, contact WantSMS support.
Contact us