Skip to main content

Assign a conversation to a team

Assign a conversation to a team of your account. Every member of the team can then open it. It replaces the team it was assigned to before, if any.

Endpoint​

POST https://api.p.2chat.io/open/conversations/<session-key>/assignment/team
  • <session-key> is the session_key of the conversation, e.g. WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176. See where to get it.

Authentication​

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

Body​

FieldTypeRequiredDescription
team_uuidstringYesUUID of a team of your account. Get it from List Account Teams.

Invocation​

curl --location --request POST 'https://api.p.2chat.io/open/conversations/WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176/assignment/team' \
--header 'X-User-API-Key: your_api_key_here' \
--header 'Content-Type: application/json' \
--data-raw '{
"team_uuid": "VUGa71c3e09-8b52-4f0d-9d1e-5c6b2f8e4a10"
}'

Response​

Success (HTTP 200 OK)​

{
"success": true,
"data": {
"assigned_user": null,
"assigned_team": {
"uuid": "VUGa71c3e09-8b52-4f0d-9d1e-5c6b2f8e4a10",
"name": "Sales"
}
}
}
FieldDescription
data.assigned_userThe user the conversation is assigned to, or null. See the assignment object.
data.assigned_teamThe team the conversation is assigned to, or null.

Error​

{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}
HTTP statusWhen
400team_uuid is empty, or it's not a team of your account
422team_uuid is missing from the body
401The API key is missing or invalid
403The user who owns the API key can't open this conversation. See permissions
404There is no conversation with that session_key in your account