Skip to content

Authentication

All endpoints except GET /stock require authentication.

Every user receives a unique API key when they register with the Supersim bot. Send it in the X-API-Key header on every request:

X-API-Key: supersim_YOUR_API_KEY
HTTP code Meaning
401 Missing or invalid X-API-Key.
403 The account owning this key has been suspended.
429 Rate limit exceeded (see Errors & Rate Limits).
GET /api/v1/user/me
import requests
resp = requests.get(
"https://su-persim.uz/api/v1/user/me",
headers={"X-API-Key": "supersim_YOUR_API_KEY"},
)
print(resp.json())
{
"telegram_id": 123456789,
"username": "dev",
"balance": 48.5,
"referral_code": "123456789",
"api_key_configured": true,
"webhook_url": null,
"is_banned": false,
"created_at": "2026-08-15T18:00:00"
}

If your key leaks, or you simply want a new one, regenerate it. The old key is invalidated immediately.

POST /api/v1/user/key/regenerate
import requests
resp = requests.post(
"https://su-persim.uz/api/v1/user/key/regenerate",
headers={"X-API-Key": "supersim_OLD_KEY"},
)
data = resp.json()
print(data["api_key"]) # new key — shown only once
{
"telegram_id": 123456789,
"api_key": "supersim_9f2c4b...",
"balance": 48.5
}