removeChannelMember
Requires an authenticated session.
Removes one person from a channel. The channel's creator cannot be removed. Only an admin or manager, or an admin of that channel, can do this. Needs a signed-in user.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation RemoveChannelMember($channelId: String!, $memberId: String!) {
removeChannelMember(channelId: $channelId, memberId: $memberId) {
id
name
createdAt
createdBy
description
isDefault
conversation {
id
title
type
createdAt
channelId
isGroup
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RemoveChannelMember($channelId: String!, $memberId: String!) {\n removeChannelMember(channelId: $channelId, memberId: $memberId) {\n id\n name\n createdAt\n createdBy\n description\n isDefault\n conversation {\n id\n title\n type\n createdAt\n channelId\n isGroup\n }\n }\n}",
"variables": {
"channelId": "string",
"memberId": "string"
}
}
EOF
Variables:
{
"channelId": "string",
"memberId": "string"
}
Response:
{
"data": {
"removeChannelMember": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"createdBy": "string",
"description": "string",
"isDefault": true,
"conversation": {
"id": "id",
"title": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"channelId": "string",
"isGroup": true
}
}
}
}
removeChannelMember(
channelId: String!
memberId: String!
): ChatChannel!
Arguments
removeChannelMember.channelId ● String! non-null scalar
The ID of the chat channel.
removeChannelMember.memberId ● String! non-null scalar
The ID of the person to remove.
Type
ChatChannel object
A chat channel that people can join.