Update Rule
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": {},
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId"
payload = {
"title": "<string>",
"description": {},
"actingUserId": "<string>"
}
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({title: '<string>', description: {}, actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId', 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/rules/:ruleId",
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([
'title' => '<string>',
'description' => [
],
'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/v8/:projectId/spaces/:spaceId/rules/:ruleId"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\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/v8/:projectId/spaces/:spaceId/rules/:ruleId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId")
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 \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySpace — Rules
Update Rule
Update an existing community rule
Update Rule
curl --request PATCH \
--url https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"description": {},
"actingUserId": "<string>"
}
'import requests
url = "https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId"
payload = {
"title": "<string>",
"description": {},
"actingUserId": "<string>"
}
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({title: '<string>', description: {}, actingUserId: '<string>'})
};
fetch('https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId', 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/rules/:ruleId",
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([
'title' => '<string>',
'description' => [
],
'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/v8/:projectId/spaces/:spaceId/rules/:ruleId"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\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/v8/:projectId/spaces/:spaceId/rules/:ruleId")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/spaces/:spaceId/rules/:ruleId")
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 \"title\": \"<string>\",\n \"description\": {},\n \"actingUserId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdates a rule’s title or description. Only space admins can update rules.
See also: useUpdateRule
Path Parameters
string
required
UUID of the space.
string
required
UUID of the rule to update.
Body Parameters
string
Updated title.
string | null
Updated description. Pass
null to clear.string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are an admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (
400 space/acting-user-not-allowed).Response
The updated Rule object.Error Responses
Invalid Id — 400
Invalid Id — 400
Returned when
spaceId or ruleId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.{ "error": "Invalid space id: expected a UUID.", "code": "space/invalid-params" }
Missing Acting User — 400
Missing Acting User — 400
A service key sent no
actingUserId.{ "error": "A service key must send actingUserId: the user this request acts as.", "code": "space/missing-user-id" }
Invalid Acting User — 400
Invalid Acting User — 400
actingUserId is not a user id.{ "error": "actingUserId must be a user id.", "code": "space/invalid-body" }
Acting User Not Allowed — 400
Acting User Not Allowed — 400
A user token sent
actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.{ "error": "actingUserId is only accepted with a service key. A user's own token always acts as that user.", "code": "space/acting-user-not-allowed" }
Wrong Location — 400
Wrong Location — 400
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.{ "error": "`actingUserId` goes in the request body on this endpoint.", "code": "space/wrong-location", "param": "actingUserId" }
User Not Found — 404
User Not Found — 404
Returned when a service key names an
actingUserId that isn’t a user in this project.{ "error": "No user with this actingUserId exists in this project.", "code": "space/user-not-found" }
Not an Admin — 403
Not an Admin — 403
The caller (or the user named by
actingUserId) is not an admin of the space.{ "error": "Admin access required", "code": "space/admin-required" }

