PagesCreate a page

Create a page

curl -X POST "https://www.my-site.com/api/site/v2/pages/create" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-site-id: YOUR_API_KEY" \
  -d '{
  "physical_file_path": "views/pages/my-page.liquid",
  "metadata": {
    "name": "My Page",
    "enabled": true,
    "file_type": "page",
    "seo_searchable": true,
    "secure_zones": [
      "example_string"
    ],
    "user_roles": "1,2,3"
  },
  "slug": "my-page",
  "content": "example_string",
  "layout": "application",
  "format": "html",
  "redirect_to": "/other-page",
  "redirect_code": "301",
  "request_method": "GET",
  "response_headers": {},
  "searchable": true
}'
{}
POST
/pages/create
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: x-api-key)
x-api-keystring
Required

Your Siteglide API key

Your Siteglide API key
API Key (header: x-site-id)
x-site-idstring
Required

The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)

The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)
Content-Typestring
Required

The media type of the request body

Options: application/json
physical_file_pathstring
Required

Unique identifier for the page file. Must match pattern [a-zA-Z0-9\-\_\/\.]+, start with views/pages/ or modules/, and end with .liquid.

slugstring

URL slug for the page. Derived from physical_file_path if not provided. Must be unique.

contentstring

Page content (Liquid)

layoutstring

Layout template name

formatstring

Content format. Defaults to 'json'.

redirect_tostring

URL to redirect to

redirect_codestring

HTTP redirect status code

request_methodstring

HTTP method override

response_headersobject

Custom response headers as key-value pairs

searchableboolean

Whether the page is searchable. Defaults to true.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
x-api-keystring
Required

API Key for authentication. Your Siteglide API key

header
x-site-idstring
Required

API Key for authentication. The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)

Body

application/json
physical_file_pathstring
Required

Unique identifier for the page file. Must match pattern [a-zA-Z0-9-_/.]+, start with views/pages/ or modules/, and end with .liquid.

Example:
views/pages/my-page.liquid
metadataobject
Required
slugstring

URL slug for the page. Derived from physical_file_path if not provided. Must be unique.

Example:
my-page
contentstring

Page content (Liquid)

layoutstring

Layout template name

Example:
application
formatstring

Content format. Defaults to 'json'.

Example:
html
redirect_tostring

URL to redirect to

Example:
/other-page
redirect_codestring

HTTP redirect status code

Example:
301
request_methodstring

HTTP method override

Example:
GET
response_headersobject

Custom response headers as key-value pairs

searchableboolean

Whether the page is searchable. Defaults to true.

Example:
true

Responses

OK