Client organizations
Client organizations
Section titled “Client organizations”POST
https://gptunnel.ru/api/v1/orgs/listReturns the organizations the user currently owns, with the balance and registration details of each. To read the user’s personal balance, call balance/get with user_id.
Use the returned org_id for transfers, balance queries, spending reports, and refunds. Each endpoint documents its own permissions and requirements.
This read-only operation does not require an Idempotency-Key header.
Request headers
| Parameter | Type | Description |
|---|---|---|
Authorization* | string | Organization API key |
Content-Type* | string | application/json |
Request parameters
| Parameter | Type | Description |
|---|---|---|
user_id | string | Client user ID, 24 lowercase hexadecimal characters. Provide exactly one of user_id and user_data. |
user_data | object | Look up a user by phone: {"phone":"+79XXXXXXXXX"}. This feature requires separate activation. |
Example request
Section titled “Example request”Set GPTUNNEL_API_KEY and replace the placeholders with values for your organization.
import jsonimport osfrom urllib.request import Request, urlopen
key = os.environ.get("GPTUNNEL_API_KEY")if not key: raise SystemExit("Set GPTUNNEL_API_KEY")
body = { "user_id": "6ad72133269dc8d9f75a33bc"}request = Request( "https://gptunnel.ru/api/v1/orgs/list", method="POST", headers={ "Authorization": key, "Content-Type": "application/json", }, data=json.dumps(body).encode("utf-8"),)with urlopen(request, timeout=30) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/api/v1/orgs/list' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "user_id": "6ad72133269dc8d9f75a33bc"}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "user_id": "6ad72133269dc8d9f75a33bc"}const response = await fetch("https://gptunnel.ru/api/v1/orgs/list", { method: "POST", headers: { Authorization: key, "Content-Type": "application/json", }, body: JSON.stringify(body),})if (!response.ok) throw new Error(await response.text())console.log(await response.json())Response
Section titled “Response”Response fields
| Parameter | Type | Description |
|---|---|---|
code | number | 0 on success |
user_id | string | ID user whose organizations are returned |
orgs | array | User organizations by date of creation, from old to new |
Organization's fields on the list (orgs)
| Parameter | Type | Description |
|---|---|---|
org_id | string | Organization ID |
name | string | Name |
account | string | null | Organization account number |
balance | number | The balance in the rubles may be negative |
credit_limit | number | Credit limit in rubles, 0 if not assigned |
inn | string | null | Russian taxpayer identification number (INN) |
ogrn | string | null | Russian primary state registration number (OGRN) |
spend_blocked | boolean | true – frozen account, prohibited write-offs (Balance/setSpendBlocked method) |
created_at | string | Date of establishment, ISO 8601 |
{ "code": 0, "user_id": "6ad72133269dc8d9f75a33bc", "orgs": [ { "org_id": "6ad7a4f2269dc8d9f75a41d0", "name": "ООО «Ромашка»", "account": "ЛСО-10452", "balance": 18250, "credit_limit": 0, "inn": "7701234567", "ogrn": "1027700123456", "spend_blocked": false, "created_at": "2026-10-21T10:02:44.000Z" } ]}{ "code": 0, "user_id": "6ad72133269dc8d9f75a33bc", "orgs": []}Errors
Section titled “Errors”| HTTP | code | When |
|---|---|---|
| 400 | 3 | Specify the user with exactly one supported field. The request contains an extra field or an invalid ID, or does not identify exactly one user. An ID must contain exactly 24 characters from 0-9a-f. See details. |
| 403 | 13 | The key belongs to a personal account rather than an organization |
| 403 | 27 | Phone lookup with user_data is disabled for the organization. |
| 403 | 36 | This endpoint is not enabled for the organization that owns the key. |
| 404 | 17 | User not found, deleted or not a customer of partner |
The API checks the key’s permissions before validating the request body. A key without access receives HTTP 403 even if the body is invalid.
See the Business API error reference for all error codes, including the 401 response for an invalid key.