Remove a member from a chat workspace
curl --request DELETE \
--url https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"member_type": "user",
"member": "<string>",
"role": "owner",
"added_by": "<string>",
"added_at": "2023-11-07T05:31:56Z"
}
]{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "<string>",
"code": 500
}Chat
Remove a member from a chat workspace
Owners can remove anyone; any user can remove themselves (leave). Removing the last owner is a 409. URL-encode the member.
DELETE
/
api
/
chat
/
workspaces
/
{workspace_id}
/
members
/
{member_type}
/
{member}
Remove a member from a chat workspace
curl --request DELETE \
--url https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/chat/workspaces/{workspace_id}/members/{member_type}/{member}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"member_type": "user",
"member": "<string>",
"role": "owner",
"added_by": "<string>",
"added_at": "2023-11-07T05:31:56Z"
}
]{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"error": "<string>",
"code": 500
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"error": "<string>",
"code": 500
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Who a workspace membership is for.
Available options:
user, role Username or realm role.
Required string length:
1 - 255Response
Successful Response
user for one person, role for everyone holding a realm role.
Available options:
user, role The username, or the realm role name.
What the member can do.
Available options:
owner, editor, viewer Who last set this membership.
When it was last set.
Was this page helpful?

