v1

latestOpenAPI 3.0.22026-08-045831103.6 KB
Chats

Update chat

Update the assigned attendant (user_id) and/or the status of a chat. Assigning an attendant forces the chat status to OPEN, unless an explicit status is sent in the same request (the explicit status wins). Sending user_id: null unassigns the attendant without changing the status. Setting status to CLOSED records closed_at. At least one of user_id or status is required. Only chats belonging to the authenticated owner can be updated.

post/v2/chats/{id}

Path parameters

idstring uuid required
Example:8feade82-d77b-4e8b-9d35-fd43e972b5c8

UUID

Headers

api-tokenstring required

API Token

Request body

user_idstring uuid nullable

UUID of the user (attendant) to assign. Must be a user of the account. Send null to unassign.

status'OPEN' | 'SNOOZED' | 'CLOSED'

New status of the chat. CLOSED records closed_at; reopening does not clear it.

Example request

{
  "user_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "CLOSED"
}

Response

The updated chat object

statusinteger

Response status

Example response

{
  "status": 200,
  "data": {
    "id": "8feade82-d77b-4e8b-9d35-fd43e972b5c8",
    "created_at": "2020-01-01T14:15:00.000000+00:00",
    "contact_id": "8feade82-d77b-4e8b-9d35-fd43e972b5c8",
    "user_id": "8feade82-d77b-4e8b-9d35-fd43e972b5c8",
    "status": "OPEN",
    "unread": true,
    "unseen_count": 3,
    "last_message_at": "2020-01-01T14:15:00.000000+00:00",
    "last_response_at": "2024-01-15T09:00:00.000Z",
    "last_status_at": "2024-01-15T10:30:00.000Z",
    "first_response_at": "2024-01-14T08:00:00.000Z",
    "channel_account_id": "8feade82-d77b-4e8b-9d35-fd43e972b5c8",
    "team_id": "8feade82-d77b-4e8b-9d35-fd43e972b5c8",
    "close_window_at": "2024-01-16T10:30:00.000Z"
  }
}