---
title: "Assign or Close"
method: PUT
path: "/chatActivities/{chatActivityId}"
tags: ["chatActivities"]
---

# Assign or Close

`PUT /chatActivities/{chatActivityId}`

## Path parameters

- `chatActivityId` string, required

## Request body

- ChatActivityPut
  - `status` string[], required — status
  - `assignee` string — ID of a Staff user or provider to whom the chat will be assigned. If status is "assigned", there must be either an "assignee" or a "groupAssignee"
  - `groupAssignee` string — ID of a Group to whom the chat will be assigned. If status is "assigned", there must be either an "assignee" or a "groupAssignee"
  - `statusReason` string — ID of a ChatActivityStatusReason to specify why a chat was closed. When status is closed, this field is mandatory, and sometimes the "description" is also mandatory.
  - `description` string — Description associated with a ChatActivityStatusReason to specify why a chat was closed. Some ChatActivitiesStatusReasons require a description.

## Response `200`

ChatActivity updated

- ChatActivityResponse — A ChatActivity represents an active conversation thread between a patient and staff in Luma Health's messaging hub, tracking assignment to an individual user or a group, its status such as unassigned, assigned, or closed, and details like the last message sent and any linked facilities. It records why a conversation was closed and flags whether the latest activity resulted from an automated message such as an appointment reminder or from a genuine unexpected reply needing attention. This resource underlies how staff triage, prioritize, and manage incoming patient messages across the organization.
  - `_id` string — Luma's internal ID of an object.
  - `user` string — The ID of the root account user.
  - `deleted` 0 | 1 — Flag for logical deletion where 1 means deleted.
  - `createdBy` string — The ID of the user who created this object.
  - `updatedBy` string — The ID of the user who updated this object.
  - `createdAt` string, date-time — The date/time when this object was created.
  - `updatedAt` string, date-time — The date/time when this object was updated.
  - `patient` object — Patient
    - `_id` string — The ID of patient.
    - `isOnline` boolean — Patient is online or not.
    - `isOnTelehealthSession` boolean — Patient is on telehealth session or not.
  - `lastMessage` string — ID of Message
  - `status` 'closed' | 'assigned' | 'unassigned' — status
  - `assignee` object — Assignee
    - `_id` string — The ID of user.
    - `isOnline` boolean — User is online or not.
    - `isOnTelehealthSession` boolean — User is on telehealth session or not.
  - `groupAssignee` string — ID of Group
  - `previousAssignee` string — ID of User
  - `previousGroupAssignee` string — ID of Group
  - `statusReason` string — ID of a ChatActivityStatusReason, only used when status is "closed"
  - `description` string — Additional description of the statusReason. Some ChatActivityStatusReasons require a description.
  - `facilities` string[] — List of facilities where the patient linked to this chatActivity has appointments.
  - `priorityUpdatedAt` string, date-time — This date/time changes only when the chat is assigned or the patient gets a messsage. It can be used to sort the chatActivities on screen.
  - `lastIrregularAt` string, date-time — Indicates the last time an unexpected message was sent in the chat. An example is when patient gets an automated appointment reminder requesting to answer YES to confirm or NO to cancel, and patient replies with a completely different message.
  - `automated` boolean — Indicates if this chatActivity was created as a consequence of an automated message being sent out, such as an appointment reminder.

## Other responses

- `401` — Not authenticated
- `403` — Access token does not have the required scope

---

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