Skip to content

Chat Members

The API type chat_member is a subset of the type user, specific to the needs of the chats feature. This means, for example, that the id value in a chat_member is a valid user ID too.

List of valid attributes:

Attribute Description Specifics
discarded_at Null or timestamp of removal Cannot be set
email Email address of the user Optional, Unique on account if set
name Name of the user -

The following relationships can be included in requests:

Relationship Type Description
roles has_many The chat roles the user has in the specific chat

Example response:

{
"data": [
{
"id": "0e2eb81a-f952-4e8d-a6f8-9f757459a241",
"type": "chat_member",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns all members of a chat.

GET /api/v1/chats/:chat_id/members

Parameter Description
chat_id The ID of the chat of which to return the members

This endpoint removes the specified member from the chat by deleting all of their chat_memberships.

Example response:

{
"data": {
"id": "6d500de8-afc5-4816-ad8d-1b191b97bfd3",
"type": "chat_member",
"attributes": {
...
}
}
}

DELETE /api/v1/chats/:chat_id/members/:user_id

Parameter Desription
 chat_id The ID of the chat to leave
 user_id The ID of the user to remove from the chat