Teams¶
Teams group agents together for organized ticket routing and collaboration. Tickets can be assigned to teams, and team members can work on assigned tickets.
Endpoints¶
| Method | Endpoint | Description | Scope Required |
|---|---|---|---|
| GET | /v1/teams |
List teams | teams:read |
| GET | /v1/teams/{id} |
Get team | teams:read |
| POST | /v1/teams |
Create team | teams:write |
| PATCH | /v1/teams/{id} |
Update team | teams:write |
| DELETE | /v1/teams/{id} |
Delete team | teams:delete |
| POST | /v1/teams/{id}/members |
Add member | teams:write |
| DELETE | /v1/teams/{id}/members/{user_id} |
Remove member | teams:write |
The Team Object¶
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Technical Support",
"description": "Handles technical issues and bug reports",
"members": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "agent1@company.com",
"full_name": "Alice Johnson"
},
{
"id": "234f5678-e90c-12d3-b456-526714174111",
"email": "agent2@company.com",
"full_name": "Bob Smith"
}
],
"created_at": "2025-01-05T08:00:00Z",
"updated_at": "2025-01-10T14:30:00Z"
}
Attributes¶
| Field | Type | Description |
|---|---|---|
id |
UUID | Unique team identifier |
name |
string | Team name |
description |
string | Team description |
members |
array | List of team members |
created_at |
datetime | Creation timestamp |
updated_at |
datetime | Last modification timestamp |
List Teams¶
Retrieve a paginated list of teams.
Query Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
skip |
integer | 0 | Number of records to skip |
limit |
integer | 50 | Maximum records to return (max: 100) |
Examples¶
Response¶
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Technical Support",
"description": "Handles technical issues",
"created_at": "2025-01-05T08:00:00Z"
},
{
"id": "661f9511-f30c-52e5-b827-557766551111",
"name": "Billing Support",
"description": "Handles billing inquiries",
"created_at": "2025-01-05T09:00:00Z"
}
]
Get Team¶
Retrieve a team with its members.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
team_id |
UUID | The team ID |
Examples¶
Response¶
Returns the full team object including members.
Create Team¶
Create a new team.
Request Body¶
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Team name (max 255 chars) |
description |
string | No | Team description |
Examples¶
Response (201 Created)¶
Returns the created team object.
Update Team¶
Update an existing team.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
team_id |
UUID | The team ID |
Request Body¶
| Field | Type | Description |
|---|---|---|
name |
string | Updated team name |
description |
string | Updated description |
Examples¶
Response¶
Returns the updated team object.
Delete Team¶
Delete a team.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
team_id |
UUID | The team ID |
Examples¶
Response¶
Returns 204 No Content on success.
Team Assignments
Deleting a team will unassign all tickets currently assigned to that team.
Add Team Member¶
Add a user to a team.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
team_id |
UUID | The team ID |
Request Body¶
| Field | Type | Required | Description |
|---|---|---|---|
user_id |
UUID | Yes | ID of the user to add |
Examples¶
import requests
TEAM_ID = "550e8400-e29b-41d4-a716-446655440000"
USER_ID = "123e4567-e89b-12d3-a456-426614174000"
response = requests.post(
f"https://api.toptickets.app/v1/teams/{TEAM_ID}/members",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={"user_id": USER_ID}
)
Response¶
Remove Team Member¶
Remove a user from a team.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
team_id |
UUID | The team ID |
user_id |
UUID | The user ID to remove |
Examples¶
import requests
TEAM_ID = "550e8400-e29b-41d4-a716-446655440000"
USER_ID = "123e4567-e89b-12d3-a456-426614174000"
response = requests.delete(
f"https://api.toptickets.app/v1/teams/{TEAM_ID}/members/{USER_ID}",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
if response.status_code == 204:
print("Member removed from team")
Response¶
Returns 204 No Content on success.