Unban Member
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban', 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/v8/:projectId/spaces/:spaceId/members/:memberId/unban",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban"
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"membership": {}
}Space — Membership
Unban Member
Unban a previously banned member
Unban Member
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban', 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/v8/:projectId/spaces/:spaceId/members/:memberId/unban",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban"
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/members/:memberId/unban")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"membership": {}
}Sets a banned member’s status back to
See also: useUnbanMember
"active", in this space and in the child spaces where they are banned (a ban covers child spaces, and so does lifting it). A request that was pending or rejected in a child space before the ban stays as it was. Unbanning makes the person an active member of this space even if they were never approved, for example when their request was still pending at the time of the ban. The member gets each space’s chat back the next time they open it. Requires the caller to be a moderator or admin. Moderators can only unban regular members, not other moderators or admins. Only the space creator (or a service or master key) can unban an admin, as only they can ban one.
Path Parameters
string
required
UUID of the space.
string
required
UUID of the membership record to unban.
Response
string
Confirmation message.
object
The updated membership record with
status: "active".Error Responses
Not Found — 404
Not Found — 404
{ "error": "Banned membership not found.", "code": "space/membership-not-found" }
Banned in a Parent Space — 409
Banned in a Parent Space — 409
The member is still banned in a parent of this space. Lift that ban first;
bannedSpaceIds lists where.{ "error": "This member is banned in a parent of this space. Lift that ban first.", "code": "space/banned-in-parent", "bannedSpaceIds": ["…"] }
Insufficient Permissions — 403
Insufficient Permissions — 403
A moderator unbanning someone who is a moderator or admin in this space or in one of the child spaces the unban covers.
{ "error": "Moderators can only unban regular members.", "code": "space/insufficient-permissions" }
Creator Required — 403
Creator Required — 403
Unbanning someone who is an admin in this space or in one of the child spaces the unban covers, by anyone but the space creator or a service or master key.
{ "error": "Only the space creator can unban admins.", "code": "space/creator-required" }

