⌁GoodSMS

Cooperator API

Offer SMS receive numbers from your own website.

GoodSMS gives your server a private API key. Your application allocates a temporary number, checks only that session’s SMS, then releases the number when it is finished.

How cooperation works

Four steps, server to server.

  1. 01
    Request access

    We create a cooperator account and issue one private psk_live_… key.

  2. 02
    Store the key safely

    Keep it in your server environment. Never place it in browser code or a public repository.

  3. 03
    Allocate and poll

    Your server requests a country-specific number, then polls the SMS endpoint while the session is active.

  4. 04
    Release promptly

    Release the session when you are done so the number returns to the shared pool.

Integration reference

Every request uses JSON body authentication.

Set Content-Type: application/json. The API key is in the request body, never in a URL or browser header.

1. Allocate a number

POST
Request URL
https://goodsms.shop/api/v1/partner/sessions/
Request body
{
  "api_key": "psk_live_your_secret_key",
  "country": "idn",
  "service": "any_other"
}
Success response
{
  "id": "0cb7f6f2-7a2e-4a7a-8ef0-2ed4f194ca99",
  "phone": {
    "number": "628123456789",
    "country": "idn",
    "operator": "Telkomsel",
    "is_online": true,
    "last_seen_at": "2026-11-01T08:30:00Z"
  },
  "service": "any_other",
  "status": "active",
  "started_at": "2026-11-01T08:30:00Z",
  "expires_at": "2026-11-01T08:50:00Z",
  "released_at": null
}

2. List your sessions

POST
Request URL
https://goodsms.shop/api/v1/partner/sessions/query/
Request body
{
  "api_key": "psk_live_your_secret_key"
}
Success response
[
  {
    "id": "0cb7f6f2-7a2e-4a7a-8ef0-2ed4f194ca99",
    "phone": {
      "number": "628123456789",
      "country": "idn",
      "operator": "Telkomsel",
      "is_online": true,
      "last_seen_at": "2026-11-01T08:30:00Z"
    },
    "service": "any_other",
    "status": "active",
    "started_at": "2026-11-01T08:30:00Z",
    "expires_at": "2026-11-01T08:50:00Z",
    "released_at": null
  }
]

3. Read SMS for that number

POST
Request URL
https://goodsms.shop/api/v1/partner/phones/628123456789/sms/
Request body
{
  "api_key": "psk_live_your_secret_key"
}
Success response
{
  "phone": "628123456789",
  "session_id": "0cb7f6f2-7a2e-4a7a-8ef0-2ed4f194ca99",
  "status": "active",
  "messages": [
    {
      "id": 1842,
      "sender": "Example",
      "body": "Your verification code is 123456.",
      "received_at": "2026-11-01T08:32:11Z"
    }
  ]
}

4. Release the number

DELETE
Request URL
https://goodsms.shop/api/v1/partner/sessions/0cb7f6f2-7a2e-4a7a-8ef0-2ed4f194ca99/
Request body
{
  "api_key": "psk_live_your_secret_key"
}
Success response
204 No Content

The number is immediately returned to the shared pool.

Important behavior

  • A number is exclusive while its session is active, for up to 20 minutes.
  • SMS results contain only messages received after the cooperator session begins.
  • 401 means the key is missing or invalid; 404 means the session or phone is not owned by your cooperator; 400 indicates invalid input or no available inventory.