Skip to main content

List account teams

This endpoint returns the teams of the 2Chat account associated with your API key. Use it to get the team_uuid to assign a conversation to a team.

Endpoint​

GET https://api.p.2chat.io/open/teams

Authentication​

Include your API key in the X-User-API-Key header. Learn more about authentication.

Parameters​

This endpoint takes no parameters.

Invocation​

curl --location --request GET 'https://api.p.2chat.io/open/teams' \
--header 'X-User-API-Key: your_api_key_here'

Response​

Success (HTTP 200 OK)​

{
"success": true,
"data": {
"teams": [
{
"uuid": "VUGa71c3e09-8b52-4f0d-9d1e-5c6b2f8e4a10",
"name": "Sales"
},
{
"uuid": "VUG0c9e5b71-3d2a-4e8f-a6b4-91f7d2c08e35",
"name": "Support"
}
]
}
}
FieldDescription
successtrue when the request was successful
data.teamsArray of the account's teams
data.teams[].uuidThe team's UUID
data.teams[].nameThe team's name

Error​

{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}
FieldDescription
errortrue when the request failed
error_messageA description of what went wrong