Create an organization
Establishment of the organization
Section titled “Establishment of the organization”POST
https://gptunnel.ru/api/v1/orgs/createCreates a business organization and assigns an existing user as its owner. The organization appears in the owner’s dashboard immediately. Use the returned org_id to transfer funds to its account.
The partner handles billing for the new organization. Monthly invoices are not issued automatically.
Request headers
| Parameter | Type | Description |
|---|---|---|
Authorization* | string | Organization API key |
Idempotency-Key* | string | Unique operation key, 8–64 characters from A-Za-z0-9_- |
Content-Type* | string | application/json |
Request parameters
| Parameter | Type | Description |
|---|---|---|
name* | string | Name of organization, 1 - 255 characters |
owner* | object | Provide exactly one field: user_id (24 lowercase hexadecimal characters) for a registered owner, or phone (+79XXXXXXXXX) if lookup by phone is enabled. |
inn | string | Russian taxpayer identification number (INN), 10 or 12 digits |
ogrn | string | Russian registration number (OGRN or OGRNIP), 13 or 15 digits |
An unknown field in the request body or in owner returns HTTP 400, code 3.
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 = { "name": "ООО Ромашка", "owner": { "user_id": "6ad72133269dc8d9f75a33bc" }, "inn": "7707083893", "ogrn": "1027700132195"}request = Request( "https://gptunnel.ru/api/v1/orgs/create", method="POST", headers={ "Authorization": key, "Content-Type": "application/json", "Idempotency-Key": "client-4821-org", }, 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/create' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: client-4821-org' \ --data '{ "name": "ООО Ромашка", "owner": { "user_id": "6ad72133269dc8d9f75a33bc" }, "inn": "7707083893", "ogrn": "1027700132195"}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "name": "ООО Ромашка", "owner": { "user_id": "6ad72133269dc8d9f75a33bc" }, "inn": "7707083893", "ogrn": "1027700132195"}const response = await fetch("https://gptunnel.ru/api/v1/orgs/create", { method: "POST", headers: { Authorization: key, "Content-Type": "application/json", "Idempotency-Key": "client-4821-org", }, 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 |
org_id | string | ID of the new organization. Use it for transfers. |
account | string | Account number: ЛСО-<number> if inn or ogrn was supplied, otherwise B-RU-<number>. |
owner_user_id | string | ID owner |
owner_created | boolean | Always false when designating an existing user |
inn | string | null | The organization’s INN, or null if omitted |
ogrn | string | null | The organization’s OGRN or OGRNIP, or null if omitted |
created_at | string | Time of Organization Establishment, ISO 8601 |
replayed | boolean | true if the same Idempotency-Key was used to create this organization earlier |
{ "code": 0, "org_id": "67f3b9d1a0c4e2f345678901", "account": "ЛСО-16966", "owner_user_id": "6ad72133269dc8d9f75a33bc", "owner_created": false, "inn": "7707083893", "ogrn": "1027700132195", "created_at": "2026-10-20T09:15:42.000Z", "replayed": false}{ "code": 41, "message": "An organization with this OGRN is already registered."}Repeating a request with the same Idempotency-Key, name, owner, INN and OGRN returns the existing organization with replayed: true. Reusing the key with different data returns HTTP 409, code 20.
Errors
Section titled “Errors”| HTTP | code | When |
|---|---|---|
| 400 | 3 | Invalid request body, unknown field, or an employee service account specified as the owner. For schema errors, see details. |
| 400 | 21 | The Idempotency-Key header is missing or has an invalid format. |
| 403 | 13 | The key belongs to a personal account. |
| 403 | 32 | Organization creation is not enabled for your organization. |
| 403 | 33 | Your organization cannot specify the owner by phone number. |
| 404 | 17 | The user identified by owner.user_id does not exist or has been deleted. |
| 409 | 20 | The Idempotency-Key has already been used with different request data. |
| 409 | 41 | An organization with this OGRN is already registered. |
| 409 | 42 | An organization with this INN is already registered. |