Create a page
curl --request POST \
--url https://api.neuraldraft.io/v1/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": false,
"is_active": true,
"exclude_from_search": false,
"meta_title": "<string>",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>"
}
'const url = 'https://api.neuraldraft.io/v1/pages';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: 'about',
title: 'About us',
type: 'landing',
is_homepage: false,
is_active: true,
exclude_from_search: false,
meta_title: '<string>',
meta_description: '<string>',
og_title: '<string>',
og_description: '<string>',
og_image: '<string>',
canonical_url: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/pages"
payload = {
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": False,
"is_active": True,
"exclude_from_search": False,
"meta_title": "<string>",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/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([
'slug' => 'about',
'title' => 'About us',
'type' => 'landing',
'is_homepage' => false,
'is_active' => true,
'exclude_from_search' => false,
'meta_title' => '<string>',
'meta_description' => '<string>',
'og_title' => '<string>',
'og_description' => '<string>',
'og_image' => '<string>',
'canonical_url' => '<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;
}{
"data": {
"id": 42,
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": false,
"is_active": true,
"exclude_from_search": false,
"meta_title": "About — Acme",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}Pages
Create a page
Create a TenantPage with optional SEO meta. Promoting a page to
homepage demotes any previously-homepage page.
Costs 1 credit per successful create (page_update).
POST
/
pages
Create a page
curl --request POST \
--url https://api.neuraldraft.io/v1/pages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": false,
"is_active": true,
"exclude_from_search": false,
"meta_title": "<string>",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>"
}
'const url = 'https://api.neuraldraft.io/v1/pages';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
slug: 'about',
title: 'About us',
type: 'landing',
is_homepage: false,
is_active: true,
exclude_from_search: false,
meta_title: '<string>',
meta_description: '<string>',
og_title: '<string>',
og_description: '<string>',
og_image: '<string>',
canonical_url: '<string>'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.neuraldraft.io/v1/pages"
payload = {
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": False,
"is_active": True,
"exclude_from_search": False,
"meta_title": "<string>",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.neuraldraft.io/v1/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([
'slug' => 'about',
'title' => 'About us',
'type' => 'landing',
'is_homepage' => false,
'is_active' => true,
'exclude_from_search' => false,
'meta_title' => '<string>',
'meta_description' => '<string>',
'og_title' => '<string>',
'og_description' => '<string>',
'og_image' => '<string>',
'canonical_url' => '<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;
}{
"data": {
"id": 42,
"slug": "about",
"title": "About us",
"type": "landing",
"is_homepage": false,
"is_active": true,
"exclude_from_search": false,
"meta_title": "About — Acme",
"meta_description": "<string>",
"og_title": "<string>",
"og_description": "<string>",
"og_image": "<string>",
"canonical_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Body
application/json
Pattern:
^[a-z0-9\-/]+$Example:
"about"
Example:
"About us"
Available options:
landing, blog_list, blog_post, legal Response
Created
Show child attributes
Show child attributes
⌘I