Remove Member
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId"
payload = { "actingUserId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId', 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.sublay.io/v7/:projectId/workspaces/:id/members/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'actingUserId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId"
payload := strings.NewReader("{\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.sublay.io/v7/:projectId/workspaces/:id/members/:userId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyWorkspace — Membership
Remove Member
Remove a member (rank-bounded; sole-owner protected)
Remove Member
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId"
payload = { "actingUserId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId', 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.sublay.io/v7/:projectId/workspaces/:id/members/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'actingUserId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId"
payload := strings.NewReader("{\n \"actingUserId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.sublay.io/v7/:projectId/workspaces/:id/members/:userId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/workspaces/:id/members/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRemoves a member from a workspace. Requires the
A service/master key called this route without naming an
A plain user token sent an
Every path id on the workspaces bundle is checked for UUID shape before the route runs, so a malformed one is a plain
remove-member capability and is rank-bounded (act only on strictly-lower ranks). Fires workspace.member.removed.
Owners have no member row, so removal targets member rows only. Sole-owner protection: the owner cannot be removed while sole owner — they must transfer ownership first.
Path Parameters
string
required
The workspace UUID.
string
required
The member to remove.
Body Parameters
string
required
Service/master keys only — the acting user (sent in the body so the act-as-user path works on
DELETE; the path :userId is the target). Required for a key: this route has no unbounded path, so a key that names nobody is refused with 400 workspace/missing-user-id. The remove-member capability and the rank bound are enforced against the named user — act as the owner for an unrestricted removal.A plain user token omits it — the actor is the token’s own user. The field is not ignored for such a token: sending your own user id is a harmless no-op, but sending anyone else’s is a 403 workspace/unauthorized. See Acting on behalf of a user.Response
204 No Content on success.
Error Responses
Insufficient Rank — 403
Insufficient Rank — 403
{ "error": "You may only remove members ranked strictly below you.", "code": "workspace/insufficient-rank" }
Sole Owner — 409
Sole Owner — 409
{ "error": "The workspace owner cannot be removed. Transfer ownership first.", "code": "workspace/sole-owner" }
Missing Acting User — 400
Missing Acting User — 400
{ "error": "Missing user ID", "code": "workspace/missing-user-id" }
actingUserId. Removal is rank-bounded against the remover’s own standing, so it must be performed as somebody — act as the owner for an unrestricted removal.Acted as Another User — 403
Acted as Another User — 403
{ "error": "Unauthorized", "code": "workspace/unauthorized" }
actingUserId naming a different user. Only a service/master key may act as someone else.Invalid Path Parameter — 400
Invalid Path Parameter — 400
{ "error": "Invalid workspace id: expected a UUID.", "code": "workspace/invalid-params" }
400 rather than a 500 from the database.
