---
title: "Update chat"
method: POST
path: "/v2/chats/{id}"
tags: ["Chats"]
---

# Update chat

`POST /v2/chats/{id}`

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.

## Path parameters

- `id` string, uuid, required

## Headers

- `api-token` string, required

## Request body

- object
  - `user_id` string, 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.

## Response `200`

The updated chat object

- object
  - `status` integer — Response status
  - `data` Chat
    - `id` string, uuid
    - `created_at` string, date-time
    - `contact_id` string, uuid
    - `user_id` string, uuid
    - `status` 'OPEN' | 'CLOSED' | 'WAITING' | 'SNOOZED' | 'REOPENED'
    - `seen` boolean
    - `unread` boolean
    - `replied` boolean
    - `unseen_count` integer
    - `last_message_at` string, date-time
    - `last_response_at` string, date-time, nullable
    - `last_status_at` string, date-time, nullable
    - `first_response_at` string, date-time, nullable
    - `channel_account_id` string, uuid
    - `team_id` string, uuid, nullable
    - `closed_at` string, date-time, nullable — Timestamp when the chat was closed
    - `first_customer_message_at` string, date-time, nullable — Timestamp of the first customer message in the chat
    - `close_window_at` string, date-time, nullable — Timestamp when the WhatsApp messaging window closes (24h after last customer message)

## Other responses

- `400` — At least one of user_id or status is required
- `401` — Authentication error - invalid or missing api-token
- `404` — Chat not found

---

[API](https://skmtc.net/clint/apis/clint-api.md) · [All operations](https://skmtc.net/clint/apis/clint-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clint/clint-api/revisions/12b8f9eff943/schema)
