# Client organizations

Source: [Client organizations](<https://docs.gptunnel.ru/en/business/orgs-list/>)

<a id="_top"></a>
> **Note: Partner organization key**
>
> Use an API key from a partner organization with access to the partner endpoints. See the [Business API overview](<https://docs.gptunnel.ru/en/business/#partner-clients>) for eligibility and activation.

<a id="client-organizations"></a>
## Client organizations

`POST https://gptunnel.ru/api/v1/orgs/list`

Returns the organizations the user currently owns, with the balance and registration details of each. To read the user’s personal balance, call [`balance/get`](<https://docs.gptunnel.ru/en/business/balance-get/>) with `user_id`.

Use the returned `org_id` for [transfers](<https://docs.gptunnel.ru/en/business/transfer/>), [balance queries](<https://docs.gptunnel.ru/en/business/balance-get/>), [spending reports](<https://docs.gptunnel.ru/en/business/balance-spending/>), and [refunds](<https://docs.gptunnel.ru/en/business/balance-refund/>). 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` (required) | `string` | Organization API key |
| `Content-Type` (required) | `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. |

<a id="example-request"></a>
### Example request

Set `GPTUNNEL_API_KEY` and replace the placeholders with values for your organization.

<a id="tab-panel-0-0"></a>
**Python**

```python
import json
import os
from 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))
```

<a id="tab-panel-0-1"></a>
**cURL**

```bash
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"
}'
```

<a id="tab-panel-0-2"></a>
**JavaScript (Node.js)**

```javascript
const key = process.env.GPTUNNEL_API_KEY
if (!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())
```

<a id="response"></a>
### 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 |

<a id="tab-panel-1-0"></a>
**200 OK**

```json
{
  "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"
    }
  ]
}
```

<a id="tab-panel-1-1"></a>
**200 Organizations not available**

```json
{
  "code": 0,
  "user_id": "6ad72133269dc8d9f75a33bc",
  "orgs": []
}
```

<a id="errors"></a>
### 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](<https://docs.gptunnel.ru/en/business/errors/>) for all error codes, including the `401` response for an invalid key.
