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
}'
import requests
import json
url = "https://www.my-site.com/api/site/v2/pages/create"
headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"x-site-id": "YOUR_API_KEY"
}
data = {
"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
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://www.my-site.com/api/site/v2/pages/create", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"x-site-id": "YOUR_API_KEY"
},
body: JSON.stringify({
"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
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"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
}`)
req, err := http.NewRequest("POST", "https://www.my-site.com/api/site/v2/pages/create", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("x-site-id", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://www.my-site.com/api/site/v2/pages/create')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = 'YOUR_API_KEY'
request['x-site-id'] = 'YOUR_API_KEY'
request.body = '{
"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
}'
response = http.request(request)
puts response.body
{}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Unprocessable Entity",
"message": "The request was well-formed but contains semantic errors",
"code": 422,
"details": [
{
"field": "password",
"message": "Password must be at least 8 characters long"
}
]
}
/pages/create
Target server for requests. Edit to use your own host.
The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)
The media type of the request body
Unique identifier for the page file. Must match pattern [a-zA-Z0-9\-\_\/\.]+, start with views/pages/ or modules/, and end with .liquid.
URL slug for the page. Derived from physical_file_path if not provided. Must be unique.
Page content (Liquid)
Layout template name
Content format. Defaults to 'json'.
URL to redirect to
HTTP redirect status code
HTTP method override
Custom response headers as key-value pairs
Whether the page is searchable. Defaults to true.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Your Siteglide API key
API Key for authentication. The ID of the Siteglide site you are working with (not an API key — just the numeric site ID)
Body
Unique identifier for the page file. Must match pattern [a-zA-Z0-9-_/.]+, start with views/pages/ or modules/, and end with .liquid.
views/pages/my-page.liquidWhether the page is enabled. Defaults to true. If false, redirect_to is automatically set to /404.
trueArray of secure zone IDs to restrict access
URL slug for the page. Derived from physical_file_path if not provided. Must be unique.
my-pagePage content (Liquid)
Custom response headers as key-value pairs
Responses
OK
Unauthorized - Credentials incorrect
Forbidden - You cannot access this site
Unprocessable Entity - Required data missing or invalid