Create a page
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. Creates page metadata and its initial empty page-profile document. The parent must be active in the same space and the configured maximum tree depth must be respected.
curl --request POST \
--url https://api.gratona.com/v1/admin/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject_id": 2,
"parent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"icon": "<string>",
"full_width": true,
"template_key": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/pages"
payload = {
"subject_id": 2,
"parent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"icon": "<string>",
"full_width": True,
"template_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject_id: 2,
parent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
icon: '<string>',
full_width: true,
template_key: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/pages', 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/pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject_id' => 2,
'parent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'icon' => '<string>',
'full_width' => true,
'template_key' => '<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/pages"
payload := strings.NewReader("{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gratona.com/v1/admin/pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"uuid": "<string>",
"subject_type": "<string>",
"subject_id": 123,
"parent_uuid": "<string>",
"position": "<string>",
"title": "<string>",
"icon": "<string>",
"full_width": true,
"template_key": "<string>",
"document_uuid": "<string>",
"has_children": true,
"pinned": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_by": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"can_edit": true,
"breadcrumbs": [
{
"uuid": "<string>",
"title": "<string>",
"icon": "<string>"
}
]
}
}{
"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": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Required with subject_id. Omit both for a workspace page; reserved or unavailable subjects fail access checks.
program, recipient, event, trip, grant, null Validation: nullable|integer|min:1|required_with:subject_type.
x >= 1Validation: nullable|uuid.
Validation: nullable|string|max:255.
255Validation: nullable|string|max:64.
64Validation: boolean.
Validation: nullable|string|max:64.
64^[a-z0-9_]+$Response
Create a page response.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject_id": 2,
"parent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"icon": "<string>",
"full_width": true,
"template_key": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/pages"
payload = {
"subject_id": 2,
"parent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"icon": "<string>",
"full_width": True,
"template_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject_id: 2,
parent_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
icon: '<string>',
full_width: true,
template_key: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/pages', 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/pages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject_id' => 2,
'parent_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'icon' => '<string>',
'full_width' => true,
'template_key' => '<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/pages"
payload := strings.NewReader("{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gratona.com/v1/admin/pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/pages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject_id\": 2,\n \"parent_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"icon\": \"<string>\",\n \"full_width\": true,\n \"template_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"uuid": "<string>",
"subject_type": "<string>",
"subject_id": 123,
"parent_uuid": "<string>",
"position": "<string>",
"title": "<string>",
"icon": "<string>",
"full_width": true,
"template_key": "<string>",
"document_uuid": "<string>",
"has_children": true,
"pinned": true,
"archived_at": "2023-11-07T05:31:56Z",
"created_by": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"can_edit": true,
"breadcrumbs": [
{
"uuid": "<string>",
"title": "<string>",
"icon": "<string>"
}
]
}
}{
"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": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}