Skip to content

Create an organization

POSThttps://gptunnel.ru/api/v1/orgs/create

Creates 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

ParameterTypeDescription
Authorization*stringOrganization API key
Idempotency-Key*stringUnique operation key, 8–64 characters from A-Za-z0-9_-
Content-Type*stringapplication/json

Request parameters

ParameterTypeDescription
name*stringName of organization, 1 - 255 characters
owner*objectProvide exactly one field: user_id (24 lowercase hexadecimal characters) for a registered owner, or phone (+79XXXXXXXXX) if lookup by phone is enabled.
innstringRussian taxpayer identification number (INN), 10 or 12 digits
ogrnstringRussian registration number (OGRN or OGRNIP), 13 or 15 digits

An unknown field in the request body or in owner returns HTTP 400, code 3.

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

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 = {
"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))

Response fields

ParameterTypeDescription
codenumber0 on success
org_idstringID of the new organization. Use it for transfers.
accountstringAccount number: ЛСО-<number> if inn or ogrn was supplied, otherwise B-RU-<number>.
owner_user_idstringID owner
owner_createdbooleanAlways false when designating an existing user
innstring | nullThe organization’s INN, or null if omitted
ogrnstring | nullThe organization’s OGRN or OGRNIP, or null if omitted
created_atstringTime of Organization Establishment, ISO 8601
replayedbooleantrue 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
}

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.

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.