curl --request PATCH \
--url https://{host}/primula/api/v3/spaces/closed_spaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"closed_spaces": [
{
"room_id": "55555555-5555-4555-8555-555555555555",
"period": "2030-09",
"closed_spaces": 2
}
]
}
'import requests
url = "https://{host}/primula/api/v3/spaces/closed_spaces"
payload = { "closed_spaces": [
{
"room_id": "55555555-5555-4555-8555-555555555555",
"period": "2030-09",
"closed_spaces": 2
}
] }
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({
closed_spaces: [
{
room_id: '55555555-5555-4555-8555-555555555555',
period: '2030-09',
closed_spaces: 2
}
]
})
};
fetch('https://{host}/primula/api/v3/spaces/closed_spaces', 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://{host}/primula/api/v3/spaces/closed_spaces",
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([
'closed_spaces' => [
[
'room_id' => '55555555-5555-4555-8555-555555555555',
'period' => '2030-09',
'closed_spaces' => 2
]
]
]),
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://{host}/primula/api/v3/spaces/closed_spaces"
payload := strings.NewReader("{\n \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\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://{host}/primula/api/v3/spaces/closed_spaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/spaces/closed_spaces")
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 \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"school_id": "22222222-2222-4222-8222-222222222222",
"modified": 1
}Update closed spaces
Requires an authenticated user in the Operations or Admin group, school_id assigned to the session, and room IDs belonging to that school. Each room_id/period pair must be unique in the body. closed_spaces must be nonnegative and no greater than room capacity. Positive values create/update overrides; zero removes an existing override. All cells are validated before writes. Upserts and deletes execute separately; a later failure may leave earlier changes applied. modified counts upserts plus existing rows deleted (a zero for a missing override does not increase it).
curl --request PATCH \
--url https://{host}/primula/api/v3/spaces/closed_spaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"closed_spaces": [
{
"room_id": "55555555-5555-4555-8555-555555555555",
"period": "2030-09",
"closed_spaces": 2
}
]
}
'import requests
url = "https://{host}/primula/api/v3/spaces/closed_spaces"
payload = { "closed_spaces": [
{
"room_id": "55555555-5555-4555-8555-555555555555",
"period": "2030-09",
"closed_spaces": 2
}
] }
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({
closed_spaces: [
{
room_id: '55555555-5555-4555-8555-555555555555',
period: '2030-09',
closed_spaces: 2
}
]
})
};
fetch('https://{host}/primula/api/v3/spaces/closed_spaces', 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://{host}/primula/api/v3/spaces/closed_spaces",
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([
'closed_spaces' => [
[
'room_id' => '55555555-5555-4555-8555-555555555555',
'period' => '2030-09',
'closed_spaces' => 2
]
]
]),
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://{host}/primula/api/v3/spaces/closed_spaces"
payload := strings.NewReader("{\n \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\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://{host}/primula/api/v3/spaces/closed_spaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/spaces/closed_spaces")
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 \"closed_spaces\": [\n {\n \"room_id\": \"55555555-5555-4555-8555-555555555555\",\n \"period\": \"2030-09\",\n \"closed_spaces\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"school_id": "22222222-2222-4222-8222-222222222222",
"modified": 1
}Authorizations
Access token issued by POST /sessions and associated with a valid server-side session.
Query Parameters
Company UUID. Must equal the authenticated session company when that session has a company assigned; the equality check is skipped for sessions without one.
School UUID. Must be assigned to the authenticated session.
Body
Update Closed Spaces Request.
1Show child attributes
Show child attributes