User API documentation

Use your API key to read account information, browse the catalog, purchase numbers, and renew rentals.

Create or manage your API key in Profile

Authentication and general rules

Send your API key in one of the following headers. Do not send both.

Authorization: Bearer smsu_your_api_key
# or
X-API-Key: smsu_your_api_key

Every response uses a JSON envelope {code, msg, data}. Errors return {code, msg}. Prices and balances are decimal strings to preserve precision.

User information

GET

URL

/api/user-api/user

Parameters

No parameters.

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": {
    "name": "Example User",
    "email": "[email protected]",
    "balance": "12.500000"
  }
}

Response codes

Server list

GET

URL

/api/user-api/servers

Parameters

No parameters.

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "server_id": "server_1",
      "server_name": "Server 1",
      "status": "available"
    },
    {
      "server_id": "server_2",
      "server_name": "Server 2",
      "status": "unavailable"
    }
  ]
}

Response codes

Country list

GET

URL

/api/user-api/countries?serverId=server_1

Parameters

Query parameters:
serverId: string — required; server_1 or server_2.

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "id": "1",
      "name": "United States"
    },
    {
      "id": "2",
      "name": "United Kingdom"
    }
  ]
}

Response codes

Card type list

GET

URL

/api/user-api/card-types?serverId=server_1

Parameters

Query parameters:
serverId: string — required; server_1 or server_2.

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "id": 0,
      "name": "First-time card"
    },
    {
      "id": 1,
      "name": "Secondary card"
    },
    {
      "id": 2,
      "name": "Renewal card purchase"
    }
  ]
}

Response codes

Service list

GET

URL

/api/user-api/services?serverId=server_1&countryId=1&cardType=0

Parameters

Query parameters:
serverId: string — required
countryId: string — required
cardType: integer — optional, defaults to 0
serviceId: string — optional, filter by ID

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": [
    {
      "id": "service-123",
      "name": "Example Service"
    }
  ]
}

Response codes

Prices

GET

URL

/api/user-api/prices?serverId=server_1&countryId=1&serviceId=service-123

Parameters

Query parameters:
serverId: string — required
countryId: string — required
serviceId: string — optional, filter by ID
cardType: integer — optional, defaults to 0

Request

No request body.

Example response

{
  "code": 200,
  "msg": "Success",
  "data": {
    "countryId": "1",
    "countryName": "United States",
    "services": [
      {
        "serviceId": "service-123",
        "serviceName": "Example Service",
        "price": {
          "10": "0.50",
          "30": "1.20",
          "60": "2.00"
        }
      }
    ]
  }
}

Response codes

Purchase

POST

URL

/api/user-api/purchase

Parameters

JSON body:
serverId: string — required
countryId: string — required
cardType: integer — required
serviceId: string — required
quantity: integer — required, from 1 to 20
duration: integer — required, 10, 30 or 60

Request

{
  "serverId": "server_1",
  "countryId": "1",
  "cardType": 0,
  "serviceId": "service-123",
  "quantity": 1,
  "duration": 10
}

Example response

{
  "code": 200,
  "msg": "Success",
  "data": {
    "order_code": "20261109123456789",
    "status": "completed",
    "order_url": "https://smsus.cc/api/links?code=20261109123456789"
  }
}

Response codes

Renewal

POST

URL

/api/user-api/renewal

Parameters

JSON body:
api_token: string — required; API token of a number owned by the user

Request

{
  "api_token": "abcdefghij123456"
}

Example response

{
  "code": 200,
  "msg": "Success",
  "data": {
    "renewal_id": "67890",
    "api_token": "abcdefghij123456",
    "status": "completed"
  }
}

Response codes