πŸš€ New v3 API is now live! Faster, more secure, and robust. ⚑
Authentication

Introduction

The API is organized around REST. It uses standard HTTP response codes, authentication, and verbs. All requests must be made over HTTPS.

How to authenticate?

All protected routes require an API Token. You must send this token in the header of every request.

Header Format
Key Authorization
Value Bearer YOUR_API_TOKEN
CURL EXAMPLE
curl -X GET "https://directsms.net/api/v1/user" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
General

Get User Info

GET

Returns profile information and account balance for the currently authenticated user.

Response Schema

balance string

Available account balance (Formatted with 2 decimals).

Request Example
curl -X GET "https://directsms.net/api/v1/user" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": {
    "id": 1,
    "name": "John",
    "balance": "150.00",
    "email": "john@example.com"
  }
}
Status Codes
200 Success - User data returned
401 Unauthorized - Invalid or missing token
403 Forbidden - Token expired or revoked
SMS Activations

List Categories

GET

Retrieves all available categories (Countries) with their nested services.

Request Example
curl -X GET "https://directsms.net/api/v1/categories" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "United States",
      "services": [...]
    }
  ]
}
Status Codes
200 Success - Categories list returned
401 Unauthorized - Invalid or missing token
SMS Activations

New Activation

POST

Request a new virtual phone number for a specific service.

Request Body

service_id integer Required

The ID of the service you want to buy (e.g., WhatsApp, Google).

operator string

Specific operator if desired (any if null).

Request Example
curl -X POST "https://directsms.net/api/v1/orders" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_id": 125, "operator": "any"}'
Response Example (200)
{
  "success": true,
  "message": "Order created successfully",
  "data": {
    "id": 12345,
    "service_id": 125,
    "operator": "any",
    "phone_number": "+1234567890",
    "status": "PENDING",
    "price": "0.50",
    "created_at": "2024-01-15T10:30:00.000Z"
  }
}
Status Codes
200 Success - Number activated
400 Invalid service_id
402 Insufficient balance
503 No numbers available
SMS Activations

List Activations

GET

Returns a paginated list of all activation orders for the authenticated user, sorted by most recent.

Security

Returns only orders belonging to the authenticated user. Cross-user access is blocked at the query level.

Query Parameters

per_page integer Optional

Number of results per page. Default: 15. Maximum: 100.

page integer Optional

Page number for pagination. Default: 1.

Request Example
curl -X GET "https://directsms.net/api/v1/orders?per_page=15" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": [
    {
      "id": 12345,
      "operator": "any",
      "phone_number": "+1234567890",
      "status": "OK",
      "sms_code": "847291",
      "price": "0.50",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 4,
    "per_page": 15,
    "total": 56
  }
}
Status Codes
200 Success β€” paginated order list
401 Unauthenticated β€” invalid or missing token
SMS Activations

Get Activation

GET

Retrieve the full details of a single activation order, including the received SMS code if available.

Security

Order ownership is verified server-side. Requesting an order that belongs to another user returns 404, not 403, to prevent enumeration attacks.

Path Parameters

id integer Required

The unique ID of the activation order.

Order Status Values

PENDING Waiting for a number to be assigned
WAIT_CODE Number assigned β€” waiting for SMS
OK SMS received β€” check sms_code field
CANCEL Order cancelled by user
TIMEOUT Expired β€” no SMS received
Request Example
curl -X GET "https://directsms.net/api/v1/orders/12345" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": {
    "id": 12345,
    "operator": "any",
    "phone_number": "+1234567890",
    "status": "OK",
    "sms_code": "847291",
    "price": "0.50",
    "created_at": "2024-01-15T10:30:00.000Z",
    "updated_at": "2024-01-15T10:32:00.000Z"
  }
}
Status Codes
200 Success β€” order details returned
401 Unauthenticated
404 Order not found or belongs to another user
SMS Activations

Check SMS Status

POST

Polls the upstream provider for the latest status of an activation. Use this to check whether an SMS code has arrived. Poll at a reasonable interval β€” excessive polling is rate-limited.

Rate Limit

Poll no faster than every 3 seconds per order. Excessive requests will result in temporary throttling. The upstream provider may also impose its own limits.

Path Parameters

id integer Required

The activation order ID to poll.

Request Example
curl -X POST "https://directsms.net/api/v1/orders/12345/update-status" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response β€” SMS Received
{
  "success": true,
  "message": "Order status updated",
  "data": {
    "id": 12345,
    "status": "OK",
    "sms_code": "847291",
    "updated_at": "2024-01-15T10:32:00.000Z"
  }
}
Status Codes
200 Status refreshed β€” check status field
404 Order not found
429 Too many requests β€” slow down polling
SMS Activations

Cancel Activation

POST

Cancels an active activation order and refunds the balance to your account. Only orders in a cancellable state can be cancelled.

Security

Only the order owner can cancel. Attempting to cancel another user's order returns 404 to prevent enumeration.

Path Parameters

id integer Required

The activation order ID to cancel.

Cancellable Statuses

PENDING Order is waiting for number assignment β€” fully refunded
WAIT_CODE Number assigned, no SMS yet β€” refund issued
OK SMS received but order still active β€” refund issued
CANCEL Already cancelled β€” returns 422
TIMEOUT Expired β€” nothing to refund β€” returns 422
Request Example
curl -X POST "https://directsms.net/api/v1/orders/12345/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response β€” Success (200)
{
  "success": true,
  "message": "Order cancelled and balance refunded",
  "data": {
    "id": 12345,
    "status": "CANCELLED"
  }
}
Status Codes
200 Cancelled and balance refunded
404 Order not found or belongs to another user
422 Order is in a non-cancellable state
TEMP MAIL

List Domains

GET

Returns all active domains grouped by their category (Free, Premium, Edu, etc.)

Request Example
curl -X GET "https://directsms.net/api/v1/temp-mail/domains" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "categories": {
    "Free": [
      { "id": 1, "name": "cloudmail.life", "type": "free" }
    ],
    "Premium": [
      { "id": 5, "name": "pro-inbox.com", "price": 0.5 }
    ]
  }
}
Status Codes
200 Success - Domains list returned
401 Unauthorized - Invalid or missing token
TEMP MAIL

Create Account

POST

Creates a new temporary email account on the specified domain.

Request Body

domain_id integer Required

The ID of the domain to create the email on.

Request Example
curl -X POST "https://directsms.net/api/v1/temp-mail/generate" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domain_id": 5}'
Response Example (200)
{
  "success": true,
  "data": {
    "id": 125,
    "email": "randomuser@pro-inbox.com",
    "expires_at": "2024-12-25T23:59:59Z"
  }
}
Status Codes
200 Success - Account created
400 Invalid domain_id
402 Insufficient balance
404 Domain not found
TEMP MAIL

Get Messages

GET

Retrieves all messages received by a specific temporary email account.

Path Parameters

id integer Required

The ID of the temporary email account.

Request Example
curl -X GET "https://directsms.net/api/v1/temp-mail/messages/125" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": {
    "email": "randomuser@pro-inbox.com",
    "messages": [
      {
        "from": "noreply@example.com",
        "subject": "Verification Code",
        "body": "Your code is 123456",
        "received_at": "2024-12-25T10:30:00Z"
      }
    ]
  }
}
Status Codes
200 Success - Messages returned
404 Account not found
410 Account expired
TEMP MAIL

Extend Duration

POST

Extends the validity of an existing temporary email account.

Request Body

account_id integer Required

The ID of the temporary email account to extend.

Request Example
curl -X POST "https://directsms.net/api/v1/temp-mail/extend" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"account_id": 125}'
Response Example (200)
{
  "success": true,
  "data": {
    "new_expires_at": "2024-12-26T23:59:59Z"
  }
}
Status Codes
200 Success - Duration extended
400 Invalid account_id
402 Insufficient balance
404 Account not found
TEMP MAIL

Discard Account

DELETE

Permanently deletes a temporary email account and all its messages.

Path Parameters

id integer Required

The ID of the temporary email account to delete.

Request Example
curl -X DELETE "https://directsms.net/api/v1/temp-mail/discard/125" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true
}
Status Codes
200 Success - Account deleted
404 Account not found
403 Not your account
PROXY API

Proxy Services

GET

Lists all available proxy types (Residential, Mobile, Datacenter) and their configurations.

Request Example
curl -X GET "https://directsms.net/api/v1/proxy/services" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": [
    {
      "id": "static-residential-ipv4",
      "name": "Static Residential IPv4",
      "plans": [...]
    }
  ]
}
Status Codes
200 Success - Services list returned
401 Unauthorized - Invalid token
PROXY API

Setup Configuration

POST

Returns available countries, regions, and periods for a specific service ID.

Request Body

service_id string Required

The ID of the proxy service type.

Request Example
curl -X POST "https://directsms.net/api/v1/proxy/setup" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_id": "static-residential-ipv4"}'
Response Example (200)
{
  "success": true,
  "data": {
    "countries": ["US", "UK", "DE", "FR"],
    "periods": ["1day", "7days", "30days"]
  }
}
Status Codes
200 Success - Configuration returned
400 Invalid service_id
404 Service not found
PROXY API

Purchase Proxy

POST

Buys a proxy with the specified configuration. Balance will be deducted immediately.

Request Example
curl -X POST "https://directsms.net/api/v1/proxy/purchase" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_id": "static-residential-ipv4", "country": "US", "period": "1month"}'
Response Example (200)
{
  "success": true,
  "data": {
    "order_id": 552,
    "proxies": [
       { "ip": "1.1.1.1", "port": "8080", "username": "user", ... }
    ]
  }
}
Status Codes
200 Success - Proxy purchased
400 Invalid parameters
402 Insufficient balance
503 Provider unavailable
PROXY API

Check Price

POST

Calculates the final cost including profit margin for a specific proxy configuration.

Request Body

Send the same parameters you would use for purchase to get an exact quote.

Request Example
curl -X POST "https://directsms.net/api/v1/proxy/price" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"service_id": "static-residential-ipv4", "country": "US", "period": "1month"}'
Response Example (200)
{
  "success": true,
  "data": {
    "final_price": 1.83,
    "currency": "USD"
  }
}
Status Codes
200 Success - Price returned
400 Invalid parameters
PROXY API

Get Proxy Details

GET

Retrieves connection details (Host, Port, Credentials) for an active proxy order.

Request Example
curl -X GET "https://directsms.net/api/v1/proxy/order/552/proxies" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
[
  {
    "ip": "185.242.6.15",
    "port": "3456",
    "username": "proxy_user",
    "password": "secure_pass",
    "protocol": "http"
  }
]
Status Codes
200 Success - Proxy list returned
404 Order not found
403 Not your order
Number Rental API

List Countries

GET

Returns all countries where number rental is available. Use the country code returned here when listing services or creating a rental order.

Rental vs Activation

Number rental provides a persistent number for days or weeks, unlike one-time activations. Rental numbers can receive multiple SMS messages over their lifetime.

Response Fields

code string

ISO 3166 country code β€” use as the country param in other rent endpoints

name string

Human-readable country name

flag string

Flag emoji for display

Request Example
curl -X GET "https://directsms.net/api/v1/rent/countries" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": [
    {
      "code": "US",
      "name": "United States",
      "flag": "πŸ‡ΊπŸ‡Έ"
    },
    {
      "code": "GB",
      "name": "United Kingdom",
      "flag": "πŸ‡¬πŸ‡§"
    }
  ]
}
Status Codes
200 Country list returned
401 Unauthenticated
Number Rental API

List Rental Services

GET

Returns available rental services for a given country. Prices are per day β€” multiply by rental duration to estimate total cost.

Query Parameters

country integer Required

Numeric country ID from the List Countries endpoint.

currency integer Optional

ISO 4217 numeric currency code. Default: 840 (USD).

Response Fields

key string

Service identifier β€” use as the service param when purchasing

name string

Human-readable service name

price_day number

Price per day in your account currency

price_week number

7-day bundle price (may differ from 7Γ— daily rate)

price_month number

30-day bundle price

Request Example
curl -X GET "https://directsms.net/api/v1/rent/services?country=1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": {
    "whatsapp": {
      "key": "whatsapp",
      "name": "WhatsApp",
      "price_day": 0.12,
      "price_week": 0.75,
      "price_month": 2.80
    },
    "telegram": {
      "key": "telegram",
      "name": "Telegram",
      "price_day": 0.10,
      "price_week": 0.60,
      "price_month": 2.20
    }
  }
}
Status Codes
200 Service list returned
422 Missing or invalid country code
Number Rental API

Create Rental Order

POST

Creates a number rental order. The cost is calculated server-side based on service pricing and deducted from your account balance. Discounts (if applicable) are applied automatically.

Security

Pricing is not accepted from the client β€” the server computes cost from the service's stored price data. All balance checks happen atomically to prevent double-spending.

Request Body

country integer Required

Numeric country ID from List Countries

service string Required

Service key from List Services (e.g. whatsapp)

rent_time integer Required

Rental duration in hours β€” min 4, max 168 (7 days)

price numeric Required

Expected price (computed server-side, used for balance check)

cost numeric Optional

Raw provider cost β€” omit to use price value

incoming_call boolean Optional

Enable call forwarding on the rented number

webhook_url url Optional

URL to receive SMS webhook notifications

Typical Flow

Call List Services first to get the price_day, then multiply by days (rent_time / 24) to compute the expected price before submitting.

Request Example
curl -X POST "https://directsms.net/api/v1/rent/orders" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "country": 1,
    "service": "whatsapp",
    "rent_time": 168,
    "price": 0.75
  }'
Response β€” Created (201)
{
  "success": true,
  "message": "Kiralama siparişi oluşturuldu",
  "data": {
    "id": 78901,
    "phone_number": "+14155552671",
    "country": 1,
    "service": "whatsapp",
    "status": "active",
    "rent_time": 168,
    "expires_at": "2024-01-22T10:30:00.000Z",
    "created_at": "2024-01-15T10:30:00.000Z"
  }
}
Status Codes
200 Rental order created successfully
402 Insufficient balance
422 Validation error β€” check field constraints
500 Provider error β€” try again
Number Rental API

List Rental Orders

GET

Returns all rental orders for the authenticated user, including active, expired, and cancelled rentals. Results are paginated and sorted by most recent.

Security

Rental orders are strictly scoped to the authenticated user. No cross-account access is possible regardless of the order ID.

Query Parameters

per_page integer Optional

Results per page. Default: 15. Max: 100.

page integer Optional

Page number. Default: 1.

Rental Status Values

ACTIVE Rental is live β€” number is receiving SMS
EXPIRED Rental period ended
CANCELLED Cancelled before expiry
Request Example
curl -X GET "https://directsms.net/api/v1/rent/orders?per_page=10" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": [
    {
      "id": 78901,
      "phone_number": "+14155552671",
      "country": "US",
      "service": "whatsapp",
      "status": "ACTIVE",
      "expires_at": "2024-01-22T10:30:00.000Z",
      "created_at": "2024-01-15T10:30:00.000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 2,
    "per_page": 10,
    "total": 18
  }
}
Status Codes
200 Paginated rental order list
401 Unauthenticated
Number Rental API

Get Rental SMS Messages

GET

Retrieves all SMS messages received by a rental number during its active period. Messages are returned in chronological order. Poll this endpoint to check for new incoming messages.

Polling Recommendation

Poll at most once every 5 seconds for active rentals. Messages are cached server-side so frequent polls don't slow down delivery.

Security

Messages are scoped to the order owner. Requesting messages from another user's rental returns 404, not 403, to prevent enumeration.

Path Parameters

id integer Required

The rental order ID.

Request Example
curl -X GET "https://directsms.net/api/v1/rent/orders/78901/sms" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"
Response Example (200)
{
  "success": true,
  "data": {
    "sms_count": 2,
    "sms_list": [
      {
        "text": "Your WhatsApp code: 291-847",
        "code": "291847",
        "sender": "WhatsApp",
        "date": "2024-01-15 10:31:45"
      },
      {
        "text": "Your WhatsApp code: 104-552",
        "code": "104552",
        "sender": "WhatsApp",
        "date": "2024-01-16 08:22:10"
      }
    ]
  }
}
Status Codes
200 Messages returned (may be empty array)
404 Order not found or belongs to another user
429 Too many requests β€” reduce polling frequency