Skip to main content
PATCH
/
workers
/
{id}
/
chats
/
{chat_id}
curl --request PATCH \
  --url https://api.roostedhr.com/api/1_12/workers/{id}/chats/{chat_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "name": "Project Alpha Team"
}
'
{
  "id": "yJjarB5xUW",
  "name": "Project Alpha Team",
  "chat_admin": "1",
  "silenced": "0",
  "on_chat": "1",
  "locked": "0",
  "date_created": "2024-01-05T20:13:00.000Z",
  "most_recent_message_id": null,
  "last_message_timestamp": null,
  "message": null,
  "name_first": null,
  "selected_picture_location": null,
  "chats_order": "2024-01-05T20:13:00.000Z",
  "unread_count": "0",
  "members": [
    {
      "id": "3158",
      "name_first": "Chris",
      "name_last": "Davis",
      "selected_picture_location": "example/1"
    },
    {
      "id": "120915",
      "name_first": "Aaron",
      "name_last": "Labrado",
      "selected_picture_location": "example/2"
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

Worker ID

chat_id
string
required

Chat ID

Body

application/json
name
string

New chat name.

members
string[]

Updated array of worker IDs. Replaces the current member list.

Response

OK

id
string

Chat ID.

name
string

Chat name.

chat_admin
integer

Whether the current worker is the chat admin.

Required range: 0 <= x <= 1
silenced
integer

Whether the chat is silenced for the current worker.

Required range: 0 <= x <= 1
on_chat
integer

Whether the current worker is on the chat.

Required range: 0 <= x <= 1
locked
integer

Whether the chat is locked.

Required range: 0 <= x <= 1
date_created
string<date-time>

Timestamp when the chat was created.

most_recent_message_id
string | null

ID of the most recent message.

last_message_timestamp
string<date-time> | null

Timestamp of the most recent message.

message
string | null

Preview of the most recent message.

name_first
string | null

First name of the most recent message sender.

selected_picture_location
string | null

Profile picture URL of the most recent message sender.

chats_order
string<date-time>

Sort timestamp for chat ordering.

unread_count
integer

Number of unread messages.

Required range: x >= 0
members
object[]

List of chat members.