Team access settings
Team settings
Section titled “Team settings”https://gptunnel.ru/api/v1/access/setTeamRestrictionsSet access for a whole team using the same feature switches as employee settings. Send up to 25 { teamId, settings } entries. Each entry is processed independently. If a team ID repeats, only the first entry is used.
To find a teamId as an owner, admin, or manager, see read team settings.
Feature switches and values
Section titled “Feature switches and values”In the object settings you can transfer any set of five settings (only those that need to be changed):
Fields settings
| Parameter | Type | Description |
|---|---|---|
showBalance | string | Show Balance |
webSearch | string | Web search |
imageGeneration | string | Image Generation |
thinkingMode | string | Reasoning mode |
useOrgBalance | string | Allow spending from the organization balance |
Each setting accepts one of three values: allow to grant access, forbid to block it, or default to remove the team override.
Who can make changes
Section titled “Who can make changes”Request headers
| Parameter | Type | Description |
|---|---|---|
Authorization* | string | API key |
Request parameters
| Parameter | Type | Description |
|---|---|---|
items* | object[] | Array of 1 to 25 { teamId, settings } entries. |
items[].teamId* | string | Team ID from POST /api/v1/employees/getTeams. |
items[].settings* | object | At least one setting. Each accepts allow, forbid, or default. |
The response counts successful updates in updated and failures in failed. Each entry in failedTeams identifies the team and explains the failure.
Error reasons in failedTeams:
Error reasons
| Parameter | Type | Description |
|---|---|---|
not_found | string | No team in the organization has this ID |
forbidden | string | The team is outside the manager’s scope or the change weakens the organization’s restrictions. |
error | string | Unexpected error processing this team |
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 = { "items": [ { "teamId": "664f0a1b2c3d4e5f60718293", "settings": { "webSearch": "forbid", "imageGeneration": "allow" } } ]}request = Request( "https://gptunnel.ru/api/v1/access/setTeamRestrictions", 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/access/setTeamRestrictions' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "items": [ { "teamId": "664f0a1b2c3d4e5f60718293", "settings": { "webSearch": "forbid", "imageGeneration": "allow" } } ]}'const key = process.env.GPTUNNEL_API_KEYif (!key) throw new Error("Set GPTUNNEL_API_KEY")
const body = { "items": [ { "teamId": "664f0a1b2c3d4e5f60718293", "settings": { "webSearch": "forbid", "imageGeneration": "allow" } } ]}const response = await fetch("https://gptunnel.ru/api/v1/access/setTeamRestrictions", { 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())Example response
Section titled “Example response”{ "code": 0, "updated": 1, "failed": 0, "failedTeams": []}{ "code": 3, "message": "Invalid input, check schema issues.", "details": []}{ "error": { "message": "Unauthorized", "type": "unauthorized_request_error", "param": null, "code": null }}{ "code": 7, "message": "Not allowed to perform this action for the organization."}{ "code": 13, "message": "This section is not available from a personal account. Use a business organization API key."}{ "code": 1, "message": "Internal server error.", "trace_id": "66a346f64dcb57627c03d596"}