Skip to main content
POST
/
workers
/
{id}
/
chats
Create Chat
curl --request POST \
  --url https://api.roostedhr.com/api/1_12/workers/{id}/chats \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "members": [
    "<string>"
  ],
  "name": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "chat_admin": 0,
  "silenced": 0,
  "on_chat": 0,
  "locked": 0,
  "date_created": "2023-11-07T05:31:56Z",
  "most_recent_message_id": "<string>",
  "last_message_timestamp": "2023-11-07T05:31:56Z",
  "message": "<string>",
  "name_first": "<string>",
  "selected_picture_location": "<string>",
  "chats_order": "2023-11-07T05:31:56Z",
  "unread_count": 1,
  "members": [
    {
      "id": "<string>",
      "name_first": "<string>",
      "name_last": "<string>",
      "selected_picture_location": "<string>"
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

Worker ID

Body

application/json
members
string[]
required

Array of worker IDs to add to the chat.

name
string

Chat name.

Response

Created

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.