Save a revisioned page document
Requires the configured page-editor feature (spaces by default) and current subject/page access. Workspace pages use a null subject; subject pages inherit their space access. Only page-owned documents are supported. Document and owner UUIDs must belong to the authenticated tenant. Requires base_revision to match the current revision. The request envelope is limited to3 MB and the document itself to2 MB, at most 12 nested levels. Root type must be doc; content follows each node allowed children, unique block IDs and profile rules. Newly inserted mentions and Library files are reauthorized. Archived owners reject edits; HTML changes require Manage HTML blocks.
curl --request PATCH \
--url https://api.gratona.com/v1/admin/page-documents/{document} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "018fd5a0-1331-7000-8000-000000000123"
},
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
},
"base_revision": 2,
"label": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/page-documents/{document}"
payload = {
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": { "id": "018fd5a0-1331-7000-8000-000000000123" },
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
},
"base_revision": 2,
"label": "<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({
document: {
type: 'doc',
content: [
{
type: 'paragraph',
attrs: {id: '018fd5a0-1331-7000-8000-000000000123'},
content: [{type: 'text', text: 'Program update'}]
}
]
},
base_revision: 2,
label: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/page-documents/{document}', 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.gratona.com/v1/admin/page-documents/{document}",
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([
'document' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'attrs' => [
'id' => '018fd5a0-1331-7000-8000-000000000123'
],
'content' => [
[
'type' => 'text',
'text' => 'Program update'
]
]
]
]
],
'base_revision' => 2,
'label' => '<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.gratona.com/v1/admin/page-documents/{document}"
payload := strings.NewReader("{\n \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<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.gratona.com/v1/admin/page-documents/{document}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/page-documents/{document}")
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 \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uuid": "<string>",
"owner_type": "<string>",
"owner_uuid": "<string>",
"profile": "<string>",
"revision": 123,
"updated_by": 123,
"updated_at": "2023-11-07T05:31:56Z",
"can_edit": true,
"can_manage_html": true,
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "018fd5a0-1331-7000-8000-000000000123"
},
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "<string>",
"code": "<string>",
"current_revision": 123
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "<string>",
"code": "invalid_document",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Document.
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Show child attributes
Show child attributes
{
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "018fd5a0-1331-7000-8000-000000000123"
},
"content": [
{ "type": "text", "text": "Program update" }
]
}
]
}
Validation: required|integer|min:1.
x >= 1Validation: nullable|string|max:120.
120Response
Save a revisioned page document response.
Show child attributes
Show child attributes
curl --request PATCH \
--url https://api.gratona.com/v1/admin/page-documents/{document} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "018fd5a0-1331-7000-8000-000000000123"
},
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
},
"base_revision": 2,
"label": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/page-documents/{document}"
payload = {
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": { "id": "018fd5a0-1331-7000-8000-000000000123" },
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
},
"base_revision": 2,
"label": "<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({
document: {
type: 'doc',
content: [
{
type: 'paragraph',
attrs: {id: '018fd5a0-1331-7000-8000-000000000123'},
content: [{type: 'text', text: 'Program update'}]
}
]
},
base_revision: 2,
label: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/page-documents/{document}', 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.gratona.com/v1/admin/page-documents/{document}",
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([
'document' => [
'type' => 'doc',
'content' => [
[
'type' => 'paragraph',
'attrs' => [
'id' => '018fd5a0-1331-7000-8000-000000000123'
],
'content' => [
[
'type' => 'text',
'text' => 'Program update'
]
]
]
]
],
'base_revision' => 2,
'label' => '<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.gratona.com/v1/admin/page-documents/{document}"
payload := strings.NewReader("{\n \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<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.gratona.com/v1/admin/page-documents/{document}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/page-documents/{document}")
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 \"document\": {\n \"type\": \"doc\",\n \"content\": [\n {\n \"type\": \"paragraph\",\n \"attrs\": {\n \"id\": \"018fd5a0-1331-7000-8000-000000000123\"\n },\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Program update\"\n }\n ]\n }\n ]\n },\n \"base_revision\": 2,\n \"label\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uuid": "<string>",
"owner_type": "<string>",
"owner_uuid": "<string>",
"profile": "<string>",
"revision": 123,
"updated_by": 123,
"updated_at": "2023-11-07T05:31:56Z",
"can_edit": true,
"can_manage_html": true,
"document": {
"type": "doc",
"content": [
{
"type": "paragraph",
"attrs": {
"id": "018fd5a0-1331-7000-8000-000000000123"
},
"content": [
{
"type": "text",
"text": "Program update"
}
]
}
]
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "<string>",
"code": "<string>",
"current_revision": 123
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "<string>",
"code": "invalid_document",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}