Pages
Summary of page endpoints
- GET /admin/api/pages - list all available pages for the current site.
- POST /admin/api/pages - create a new page for the current site.
- GET /admin/api/pages/1 - get data for a single page.
- PUT /admin/api/pages/1 - overwrite all attributes of a page.
- PATCH /admin/api/pages/1 - merge new attributes into a single page.
- POST /admin/api/pages/1/duplicate - duplicate the page with content.
- DELETE /admin/api/pages/1 - remove a page.
- PUT /admin/api/pages/1/data/key_1 - update custom data field of a page.
- DELETE /admin/api/pages/1/data/key_1 - remove custom field of a page.
Related endpoints:
List all available pages for the current site
GET /admin/api/pages
Example response:
Status: 200 OK
[
{
"id": 1,
"title": "Home Page",
"menu_title" null,
"slug": null,
"path": "",
"content_type": "page",
"keywords": null,
"description": null,
"data": {},
"root": true,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": "site",
"title_separator": null,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2013-12-13T09:19:04.000Z",
"published_at": "2013-12-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/1",
"public_url": "http://helloworld.voog.co/",
"contents_url": "http://helloworld.voog.co/admin/api/pages/1/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=1",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:53:00.000Z",
"updated_at": "2013-04-11T10:08:54.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 1,
"title": "Front page",
"layout_name": "page_front",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/1",
"created_at": "2013-04-05T13:53:00.000Z",
"updated_at": "2013-04-11T10:08:54.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 1,
"parent_id": null,
"title": "Home Page",
"position": 1,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2013-12-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/1",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=1",
"parent_url": null
},
"seo": {
"full_title": "My new site",
"title_format": "<site_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
}
}, {
"id": 2,
"title": "Products",
"menu_title" null,
"slug": "products",
"path": "products",
"content_type": "page",
"keywords": null,
"description": null,
"data": {
"my_key_1": "Value 1",
"my_key_2": 2
},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": null,
"title_separator": null,
"permanent_redirect_url": "http://helloworld.voog.co/our-products",
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-03T12:14:34.000Z",
"published_at": "2013-12-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/2",
"public_url": "http://helloworld.voog.co/products",
"contents_url": "http://helloworld.voog.co/admin/api/pages/2/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=2",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 2,
"parent_id": 1,
"title": "Products",
"position": 2,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-03T12:14:34.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/2",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=2",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
},
"seo": {
"full_title": "Products – My new site",
"title_format": "<page_title> <separator> <site_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
}
}
]
Parameters
content_type
- page type (e.g.?content_type=blog
). Accepted values arepage
,blog
,elements
andlink
.include_seo
- includes SEO-related output.language_code
- language code (e.g.?language_code=en
). Returns only pages with requested language code.language_id
- language id (e.g.?language_id=1
). Returns only pages for requested language.node_id
- page node id (e.g.?node_id=1
). Returns only pages for requested node.page
- requested page (default:1
).parent_id
- parent page id (e.g.?parent_id=1
). Returns only children pages for requested parent page.path
- path (e.g.?path=products/books
). Returns only page with requested path.path_prefix
- path prefix (e.g.?path_prefix=products/
). Returns only those pages whose path begins with the given prefix.per_page
- elements per response (default:50
; maximum:250
).search
- a generic search string matching if eithertitle
,menu_title
,description
orpath
contains the passed value.
Filter attributes
Read more about filters.
- Object
page
attributes:id
,language_id
,node_id
,layout_id
,title
,menu_title
,path
,content_type
,keywords
,description
,hidden
,publishing
,privacy
,isprivate
,created_at
,updated_at
,published_at
. - Object
language
attributes:id
,code
,title
,position
,default_language
,created_at
,updated_at
. - Object
node
attributes:id
,parent_id
,title
,position
,created_at
,updated_at
.
Create a new page for the current site
POST /admin/api/pages
Example data:
{
"title": "Contacts",
"slug": "contacts",
"layout_id": 2,
"parent_id": 1
}
Example response:
Status: 201 Created
{
"id": 3,
"title": "Contacts",
"menu_title" null,
"slug": "contacts",
"path": "contacts",
"content_type": "page",
"keywords": null,
"description": null,
"data": {},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": null,
"title_separator": null,
"created_at": "2014-01-10T09:19:04.000Z",
"updated_at": "2014-01-10T09:19:04.000Z",
"published_at": "2014-01-10T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/3",
"public_url": "http://helloworld.voog.co/contacts",
"contents_url": "http://helloworld.voog.co/admin/api/pages/3/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages/3?parent_id=3",
"robots_header": "noindex",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 3,
"parent_id": 1,
"title": "Contacts",
"position": 3,
"created_at": "2014-01-10T09:19:04.000Z",
"updated_at": "2014-01-10T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/3",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=3",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
},
"seo": {
"full_title": "Contacts – My new site",
"title_format": "<page_title> <separator> <site_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
}
}
Parameters
title
- page title in the<title>
tag.menu_title
- page title in menu, defaults totitle
.layout_id
- page layout id.slug
- page url part in current folder. Value''
means the root page. Slug is unique in given subfolder. If not set thentitle
value is used to generate it.parent_id
- parent page id.node_id
- related node id.language_id
- language id. Creates new page undercontent_type
- page's content type (used only when creating a link)path
- URL the link points to (used only when creating a link)description
- page meta description.image_id
- id of the page descriptive image (commonly used for OG tags) - should be id of asset with image type (default:null
).hidden
- hidden in site menu. (Default:false
).publishing
- publish changes automatically. If turned on then every page (or page content) update is published automatically. (Default:true
).privacy
(aliasisprivate
) - enable or disable password protection for page and it's sub pages (default:false
).data
- key/value based custom hash store. (NB! Keys with prefixesinternal_
are protected and read only.)permanent_redirect_url
- fully qualified url. If set then current page returns 301 redirect response to it (default:null
). Example:http://www.mysite.com/some_subpage
.robots_header
- HTTPX-Robots-Tag
header value (read more). When set then HTTP headerX-Robots-Tag
is added to current page response. Example values:noindex
ornoindex, nofollow
(default:null
).title_format
- default title format for the page title tag. Defaults to sitetitle_format
value. Supported values and their corresponding patterns:page_site
-<page_title> <separator> <site_title>
site_page
-<site_title> <separator> <page_title>
page
-<page_title>
site
-<site_title>
title_separator
- default title format separator for the page title tag. Defaults to sitetitle_separator
value.include_seo
- includes SEO-related output.keywords
[deprecated] - page meta keywords.
Minimum required parameters when creating a page object
New subpage:
parent_id
- creates a new page under the given parent page. Creates a new node and uses parent page's language.
Translation of existing page:
parent_id
and node_id
- creates a new page under the given parent page, bound to an existing node. Uses the parent page's language.
or
language_id
and node_id
- creates a new page for the given language, bound to the given node. (NB! parent page should already be created for the given language.)
Additional required parameters when creating a page
title
- page title in menulayout_id
- page layout id
Addditional required parameters when creating a link
title
- link title in menucontent_type
- specifies the page as a link. Only valid value islink
.path
- URL the link points to
URL format
For full URLs, the protocol is mandatory. Allowed protocols are "http" and "https". HTTP query parameters are also supported.
Examples:
http://example.com/page?parameter=value&also=another
https://www.google.com/search?q=test
/products
(initial slash is mandatory for relative paths)//subpage
(double slash uses site's current protocol)
Get data for a single page
GET /admin/api/pages/1
Example request:
GET http://helloworld.voog.co/admin/api/pages/2
Example response:
Status: 200 OK
{
"id": 2,
"title": "Products",
"menu_title" null,
"slug": "products",
"path": "products",
"content_type": "page",
"keywords": null,
"description": null,
"data": {
"my_key_1": "Value 1",
"my_key_2": 2
},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": null,
"title_separator": null,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-03T12:14:34.000Z",
"published_at": "2013-12-13T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/2",
"public_url": "http://helloworld.voog.co/products",
"contents_url": "http://helloworld.voog.co/admin/api/pages/2/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=2",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 2,
"parent_id": 1,
"title": "Products",
"position": 2,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-03T12:14:34.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/2",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=2",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
},
"seo": {
"full_title": "Products – My new site",
"title_format": "<page_title> <separator> <site_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
},
"image": {
"id": 1,
"content_type": "image/jpeg",
"width": 1024,
"height": 768,
"url": "http://helloworld.voog.co/admin/api/assets/1",
"public_url": "http://media.voog.com/0000/0000/0001/photos/Chrysanthemum.jpg",
"sizes": [
{
"content_type": "image/jpeg",
"width": 600,
"height": 450,
"url": "http://media.voog.com/0000/0000/0001/photos/Chrysanthemum_block.jpg"
},
{
"content_type": "image/jpeg",
"width": 1024,
"height": 768,
"url": "http://media.voog.com/0000/0000/0001/photos/Chrysanthemum.jpg"
}
]
},
"contents": [
{
"id": 4,
"name": "body",
"position": 1,
"content_type": "text",
"url": "http://helloworld.voog.co/admin/api/pages/2/contents/4",
"created_at": "2013-12-13T09:19:05.000Z",
"updated_at": "2013-12-13T09:19:05.000Z"
},
{
"id": 5,
"name": "slogan",
"position": 1,
"content_type": "text",
"url": "http://helloworld.voog.co/admin/api/pages/2/contents/5",
"created_at": "2013-12-13T09:19:05.000Z",
"updated_at": "2013-12-13T09:19:05.000Z"
}
]
}
The output may depend on page content_type
.
For "content_type="blog"" there are additional attributes:
{
"...": "...",
"articles_url": "http://helloworld.voog.co/admin/api/articles?page_id=4
"...": "..."
}
For "content_type="elements"" there are additional attributes:
{
"...": "...",
"elements_url": "http://helloworld.voog.co/admin/api/elements?page_id=4
"...": "..."
}
Parameters
include_children
- includes list of subpages to response. (Eg?include_children=true
)include_seo
- includes SEO-related output.
Update attributes of a page
PUT /admin/api/pages/1
This request updates the page with provided attributes. It replaces data
attribute with new key set if data
attribute is present in request.
PATCH /admin/api/pages/1
This request updates the page with provided attributes. It merges provided keys to data
attribute if data
attribute is present in request.
Example request:
PUT http://helloworld.voog.co/admin/api/pages/3
Example data:
{
"title": "About",
"slug": "about",
"title_format": "site_page",
"description": "We are a small crew of designers and developers passionate about usability.",
"data": {
"key_1": "value_1",
"key_2": "value_2"
}
}
Example response:
Status: 200 OK
{
"id": 3,
"title": "About",
"menu_title" null,
"slug": "about",
"path": "about",
"content_type": "page",
"keywords": null,
"description": "We are a small crew of designers and developers passionate about usability.",
"data" : {
"key_1": "value_1",
"key_2": "value_2"
},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": "site_page",
"title_separator": null,
"created_at": "2014-01-10T09:19:04.000Z",
"updated_at": "2014-01-10T10:10:10.000Z",
"published_at": "2014-01-10T10:10:10.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/3",
"public_url": "http://helloworld.voog.co/contacts",
"contents_url": "http://helloworld.voog.co/admin/api/pages/3/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=3",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 3,
"parent_id": 1,
"title": "About",
"position": 3,
"created_at": "2014-01-10T09:19:04.000Z",
"updated_at": "2014-01-10T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/3",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=3",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
},
"seo": {
"full_title": "My new site – About",
"title_format": "<site_title> <separator> <page_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
}
}
Parameters
Optional parameters:
title
- page title in the<title>
tag.menu_title
- page title in menu, defaults totitle
.slug
- page url part in current folder.layout_id
- page layout id.description
- page meta description.image_id
- id of the page descriptive image (commonly used for OG tags) - should be id of asset with image type (default:null
).hidden
- hidden in site menu.publishing
- publish changes automatically.privacy
(aliasisprivate
) - enable or disable password protection for page and it's sub pages.data
- key/value based custom hash store. If attributedata
is present in request then new value replaces existing data value. (NB! Keys with prefixesinternal_
are protected and read only.)permanent_redirect_url
- fully qualified url. If set then current page returns 301 redirect response to it (default:null
). Example:http://www.mysite.com/some_subpage
.robots_header
- HTTPX-Robots-Tag
header value (read more). When set then HTTP headerX-Robots-Tag
is added to current page response. Example values:noindex
ornoindex, nofollow
(default:null
).title_format
- default title format for the page title tag. Defaults to sitetitle_format
value. Supported values and their corresponding patterns:page_site
-<page_title> <separator> <site_title>
site_page
-<site_title> <separator> <page_title>
page
-<page_title>
site
-<site_title>
title_separator
- default title format separator for the page title tag. Defaults to sitetitle_separator
value.include_seo
- includes SEO-related output.keywords
[deprecated] - page meta keywords.
Duplicate the page with content
POST /admin/api/pages/1/duplicate
This request creates new duplicate page from the source page with related content (including blog articles and element) to same page level. It also accepts same optional parameters as the page update method.
Example request:
POST http://helloworld.voog.co/admin/api/pages/3/duplicate
{
"id": 4,
"title": "About",
"menu_title" null,
"slug": "about-1",
"path": "about-1",
"content_type": "page",
"keywords": null,
"description": "We are a small crew of designers and developers passionate about usability.",
"data" : {
"key_1": "value_1",
"key_2": "value_2"
},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": "site_page",
"title_separator": null,
"created_at": "2019-08-14T09:19:00.000Z",
"updated_at": "2019-08-14T10:19:00.000Z",
"published_at": "2019-08-14T10:19:00.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/4",
"public_url": "http://helloworld.voog.co/contacts",
"contents_url": "http://helloworld.voog.co/admin/api/pages/4/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=4",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 4,
"parent_id": 1,
"title": "About",
"position": 4,
"created_at": "2019-08-14T09:19:00.000Z",
"updated_at": "2019-08-14T09:19:00.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/4",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=4",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
},
"seo": {
"full_title": "My new site – About",
"title_format": "<site_title> <separator> <page_title>",
"score": 87,
"metrics": [
{
"key": "title_length",
"score": 75,
"result": "warning"
},
{
"key": "description_length",
"score": 100,
"result": "pass"
}
]
}
}
Remove a page
DELETE /admin/api/pages/3
This request deletes the page from the database.
Example request:
DELETE http://helloworld.voog.co/admin/api/pages/3
Example response:
Status: 204 No Content
Limits:
- If page has at least one subpage, it will not be deleted.
Update custom data field of a page
PUT /admin/api/pages/1/data/key
Updates or adds a new key to page data
keyset.
Example request:
PUT http://helloworld.voog.co/admin/api/pages/2/data/my_key_1
Example data:
{
"value": "new value"
}
Example response:
Status: 200 OK
{
"id": 2,
"title": "Products",
"menu_title" null,
"slug": "products",
"path": "products",
"content_type": "page",
"keywords": null,
"description": null,
"data": {
"my_key_1": "new value",
"my_key_2": "value_2"
},
"root": false,
"hidden": false,
"publishing": true,
"isprivate": false,
"title_format": null,
"title_separator": null,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-10T12:14:34.000Z",
"published_at": "2014-01-10T09:19:04.000Z",
"url": "http://helloworld.voog.co/admin/api/pages/2",
"public_url": "http://helloworld.voog.co/products",
"contents_url": "http://helloworld.voog.co/admin/api/pages/2/contents",
"children_url": "http://helloworld.voog.co/admin/api/pages?parent_id=2",
"language": {
"id": 1,
"code": "en",
"title": "ENG",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"url": "http://helloworld.voog.co/admin/api/languages/1"
},
"layout": {
"id": 2,
"title": "Common page",
"layout_name": "page_default",
"content_type": "page",
"url": "http://helloworld.voog.co/admin/api/layouts/2",
"created_at": "2013-04-05T13:54:32.000Z",
"updated_at": "2013-04-11T10:09:51.000Z",
"mime_type": "application/vnd.voog.design.custom+liquid"
},
"node": {
"id": 2,
"parent_id": 1,
"title": "Products",
"position": 2,
"created_at": "2013-12-13T09:19:04.000Z",
"updated_at": "2014-01-03T12:14:34.000Z",
"url": "http://helloworld.voog.co/admin/api/nodes/2",
"children_url": "http://helloworld.voog.co/admin/api/nodes?parent_id=2",
"parent_url": "http://helloworld.voog.co/admin/api/nodes/1"
}
}
Remove custom field of a page
DELETE /admin/api/pages/1/data/key
Example request:
DELETE http://helloworld.voog.co/admin/api/pages/2/data/my_key_1
Example response:
Status: 204 No Content