Skip to content

List employees

POSThttps://gptunnel.ru/api/v1/employees/getEmployees

Returns up to 25 employees per page with their roles and teams. You can filter by email, login, team, or role.

The key creator can see employees with an equal or lower role. An owner can see other owners, administrators, team managers and members. An administrator can see other administrators, team managers and members.

Request headers

ParameterTypeDescription
Authorization*stringAPI key

Request parameters

ParameterTypeDescription
pagenumberPage number from 1 to 40,000
emailstringFilter by email address. Partial matches are supported.
loginstringFilter by login. Partial matches are supported.
teamIdstringFilter by team ID. Returns HTTP 404 if the team does not belong to the organization.
rolestringRole filter: owner, admin, member or manager (team manager)

Top level:

Response

ParameterTypeDescription
code*numberResult code. 0 indicates success.
items*Employee[]Employees on the current page. See Employee fields below.
page*numberCurrent page number
pageSize*numberMaximum number of employees per page (25).
count*numberNumber of employees on the current page (at most pageSize; the last page may contain fewer)
total*numberTotal number of employees matching the filters across all pages.
totalPages*numberTotal pages

Each element of items is an Employee object.

Employee fields

ParameterTypeDescription
email*stringEmail address. May be an empty string.
login*stringLogin
phone*stringPhone number. May be an empty string.
firstName*stringGiven name. May be an empty string.
lastName*stringFamily name. May be an empty string.
role*string | nullRole in the organization: owner, admin, member or manager (null — if the role is outside this set)
teamIds*string[]IDs of the teams the employee belongs to. An empty array means no teams.

If an existing account has a pending invitation, the employee still appears in the list. The response includes login, role and teamIds, but email, phone, firstName and lastName are empty, so an email filter will not find that employee. The remaining fields become available after the invitation is accepted.

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 = {
"page": 1,
"login": "iv"
}
request = Request(
"https://gptunnel.ru/api/v1/employees/getEmployees",
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))
{
"code": 0,
"items": [
{
"email": "ivanov@example.com",
"login": "ivanov",
"phone": "+70000000000",
"firstName": "Иван",
"lastName": "Иванов",
"role": "member",
"teamIds": ["66a346f64dcb57627c03d596", "5f1c9a0b2e3d4c5a6b7c8d9e"]
}
],
"page": 1,
"pageSize": 25,
"count": 1,
"total": 1,
"totalPages": 1
}