Update Space
curl --request PATCH \
--url https://api.sublay.io/v7/:projectId/spaces/:spaceId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"readingPermission": "<string>",
"postingPermission": "<string>",
"visibility": "<string>",
"requireJoinApproval": true,
"metadata": {}
}
'import requests
url = "https://api.sublay.io/v7/:projectId/spaces/:spaceId"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"readingPermission": "<string>",
"postingPermission": "<string>",
"visibility": "<string>",
"requireJoinApproval": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
readingPermission: '<string>',
postingPermission: '<string>',
visibility: '<string>',
requireJoinApproval: true,
metadata: {}
})
};
fetch('https://api.sublay.io/v7/:projectId/spaces/:spaceId', 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/spaces/:spaceId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'readingPermission' => '<string>',
'postingPermission' => '<string>',
'visibility' => '<string>',
'requireJoinApproval' => true,
'metadata' => [
]
]),
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/spaces/:spaceId"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v7/:projectId/spaces/:spaceId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/spaces/:spaceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodySpace Endpoints
Update Space
Update a space’s settings, name, description, or images
Update Space
curl --request PATCH \
--url https://api.sublay.io/v7/:projectId/spaces/:spaceId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"readingPermission": "<string>",
"postingPermission": "<string>",
"visibility": "<string>",
"requireJoinApproval": true,
"metadata": {}
}
'import requests
url = "https://api.sublay.io/v7/:projectId/spaces/:spaceId"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"readingPermission": "<string>",
"postingPermission": "<string>",
"visibility": "<string>",
"requireJoinApproval": True,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
description: '<string>',
readingPermission: '<string>',
postingPermission: '<string>',
visibility: '<string>',
requireJoinApproval: true,
metadata: {}
})
};
fetch('https://api.sublay.io/v7/:projectId/spaces/:spaceId', 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/spaces/:spaceId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'readingPermission' => '<string>',
'postingPermission' => '<string>',
'visibility' => '<string>',
'requireJoinApproval' => true,
'metadata' => [
]
]),
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/spaces/:spaceId"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sublay.io/v7/:projectId/spaces/:spaceId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/spaces/:spaceId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"readingPermission\": \"<string>\",\n \"postingPermission\": \"<string>\",\n \"visibility\": \"<string>\",\n \"requireJoinApproval\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodyUpdates a space. Only the space’s admin can update it. Supports multipart form data for avatar/banner image uploads.
See also: useUpdateSpace
Path Parameters
Body Parameters
All fields are optional. Only provided fields are updated.Updated display name: 3–100 characters after trimming. Leave it out to keep the current name. It can’t be cleared:
null returns 400 space/invalid-body."public", "unlisted", or "private". Controls who can find and see the space, independent of readingPermission. "private" hides it, and the spaces under it, from everyone except its active members; the content inside it stays readable in v7 (see Content inside a space and the v8 rules). Changes take effect immediately and are freely reversible. See Space visibility.Whether joining the space needs admin approval. Applies to joins from this point on — memberships that are already pending or active are unaffected.
Response
Returns the updated SpaceDetailed object.Error Responses
Invalid Name — 400
Invalid Name — 400
name was sent as null (a space can’t lose its name) or isn’t 3–100 characters after trimming. Nothing is updated.{ "error": "name: A space must have a name", "code": "space/invalid-body" }
Not Found — 404
Not Found — 404
{ "error": "Space not found.", "code": "space/not-found" }
Forbidden — 403
Forbidden — 403
Caller is not an admin of the space.

