API Docs

Welcome to the Getatext API. Here you'll find all the information you need to integrate our services into your applications. Automate SMS verifications with ease.

Authentication

All API requests must be authenticated. Include your API key in the request headers as `Auth: YOUR_API_KEY`. You can find your API key in your user profile page.

Example Header

"Auth": "sk_your_very_secret_api_key"

POST /api/v1/rent-a-number

This endpoint allows you to request a new phone number for a specific service. You need to provide the service code you want to verify. The code can be viewed on the "Services" in our platform.

Request Body

{ "service": "whatsapp" }

Example cURL Request

curl -X POST https://getatext.com/api/v1/rent-a-number \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "service": "whatsapp" }'

Successful Response (201 CREATED)

{ "id": 12345, "status": "success", "message": "Number rented successfully.", "errors": null, "end_time": "2025-07-06 15:43:37" "number": "1234567890" "service_name": "Whatsapp" "price": "0.55" "new_balance": "113.32" }

We have multiple errors messages if the request failed. 400, 403, 401, etc. In all cases, you get whole response in null except errors with the detailed issue.

POST /api/v1/cancel-rental

Use this endpoint to cancell a rental. You must wait 1 min before request a cancellation.

Request Body

{ "id": 1234 }

Example cURL Request

curl -X POST https://getatext.com/api/v1/cancel-rental \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 1234 }'

Successful Response (200 OK)

{ "id": 12345, "status": "cancelled", "code": null, "errors": null, "end_time": "2025-07-06 15:43:37" "number": "1234567890" "service_name": "Whatsapp" "cost": "0.55" "balance": "113.87" }

POST /api/v1/rental-status

Use this endpoint to retrieve the status of a specific rental.

Request Body

{ "id": 1234 }

Example cURL Request

curl -X POST https://getatext.com/api/v1/rental-status \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "id": 1234 }'

Successful Response (200 OK)

{ "id": 12345, "status": "active", "code": null, "errors": null, "end_time": "2025-07-06 15:43:37" "number": "1234567890" "service_name": "Whatsapp" "cost": "0.55" "balance": "113.32" }

POST /api/v1/rental-status/{id}/completed

Use this endpoint to mark a specific rental as completed.

Example cURL Request

curl -X POST https://getatext.com/api/v1/rental-status/{id}/completed \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \

Successful Response (200 OK)

{ "status": "success", "message": "Rental marked as completed successfully.", "errors": "null", "rental": { "id": 12345, "end_time": "2025-08-12 00:19:30", "number": "1234567890", "service_name": "Whatsapp", "price": "0.1", "new_balance": "9.9" } }

GET /api/v1/prices-info

Use this endpoint to retrieve the available services in the platform.

Example cURL Request

curl -X GET https://getatext.com/api/v1/prices-info \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \'

Successful Response (200 OK)

{ "service_name": "Whatsapp", "api_name": "whatsapp", "multiple_sms": "true", "price": "0.55", "ttl": 5, }

POST /api/v1/re-rent

Use this endpoint to retrieve the available services in the platform.

Request Body

{ "rental_id": 1234 }

Example cURL Request

curl -X POST https://getatext.com/api/v1/re-rent \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "rental_id": 1234 }'

Successful Response (201 OK)

{ "id": 12345, "status": "success", "message": "Number rented successfully.", "errors": null, "end_time": "2025-07-06 15:43:37" "number": "1234567890" "service_name": "Whatsapp", "price": "0.55", "new_balance": "113.32" }

GET /api/v1/balance

Use this endpoint to retrieve the user's balance.

Example cURL Request

curl -X GET https://getatext.com/api/v1/balance \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \'

Successful Response (200 OK)

{ "status": "success", "balance": "10.55", "errors": "null", }

GET /api/v1/long-rentals

Use this endpoint to retrieve the user's long rentals.

Example cURL Request

curl -X GET https://getatext.com/api/v1/long-rentals \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \'

Successful Response (200 OK)

{ "status": "success", "long_rentals": [ { "id": 1, "number": "1234567890", "end_time": "2025-07-06", "rented_at": "2025-07-01", "price": "10.55", "status": "Active", "period": "1 Week", "auto_renew": true }, .... ], "errors": "null", }

POST /api/v1/long-rentals

Use this endpoint to create a new long rental.

Request Body

{ "auto_renew": true, "rental_time": "1w" }

Example cURL Request

curl -X POST https://getatext.com/api/v1/long-rentals \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auto_renew": true, "rental_time": "1w", // Can be "1w", "2w", "1m", "1y" }'

Successful Response (200 OK)

{ "status": "success", "long_rental": "id": 1, "number": "1234567890", "end_time": "2025-07-06", "rented_at": "2025-07-01", "price": "10.55", "status": "Active", "period": "1 Week", "auto_renew": true, "errors": "null", }

POST /api/v1/long-rentals/{id}/update

Use this endpoint to update an existing long rental.

Request Body

{ "action": "renew", "auto_renew": true }

Example cURL Request

curl -X POST https://getatext.com/api/v1/long-rentals/{id}/update \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": "renew", // or "cancel", "auto_renew" "auto_renew": true, // Optional, only for "auto_renew" action }'

Successful Response (200 OK)

{ "status": "success", "long_rental": "id": 1, "number": "1234567890", "end_time": "2025-07-06", "rented_at": "2025-07-01", "price": "10.55", "status": "Active", "period": "1 Week", "auto_renew": true, "errors": "null", }

GET /api/v1/long-rentals/{id}/messages

Use this endpoint to retrieve messages for a specific long rental.

Example cURL Request

curl -X GET https://getatext.com/api/v1/long-rentals/{id}/messages \ -H "Auth: YOUR_API_KEY" \ -H "Content-Type: application/json" \

Successful Response (200 OK)

{ "status": "success", "messages": [ { "message": "This is a example message", "number": "1234567890", "rented_at": "2025-07-28T12:39:32-04:00", "sender": "8888", }, .... ], "errors": "null", }

POST Webhook

Also, you can configure a webhook in your profile, so we can send codes when our platform receives it. Note: for you security, we recommended use "ip whitelist" on your service, we send webhook request from 104.198.170.54

Webhook Request to Your Endpoint:

{ "id": 12345, "code": 654321, "received_at": "2025-07-06 15:43:37" "number": "1234567890" "service_name": "Whatsapp" }

GET /stubs/handler_api

Use this endpoint to handle various user requests if you server can't send post request.

Example cURL Request

curl -X GET https://getatext.com/stubs/handler_api?api_key=YOUR_API_KEY&action=ACTION_KEY

Actions Availables:

getPrices - Get all prices available in the platform.
getRentalStatus - Get the status of a rental. You must specify the rental_id in the query parameters.
getNumber - Rent a number for a specific service. You must specify the service in the query parameters.
cancelRental - Cancel a rental. You must specify the rental_id in the query parameters.
getBalance - Get your balance.

Successful Response (200 OK)

The response to the requests are the same as those shown above.