Update a page
curl -X PUT "https://www.my-site.com/api/site/v2/pages/1234" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-site-id: YOUR_API_KEY" \
-d '{
"merge_metadata": true,
"metadata": {
"name": "My Updated Page",
"enabled": true,
"seo_searchable": true,
"secure_zones": [
"example_string"
],
"user_roles": "1,2,3"
},
"slug": "my-updated-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/1234"
headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"x-site-id": "YOUR_API_KEY"
}
data = {
"merge_metadata": true,
"metadata": {
"name": "My Updated Page",
"enabled": true,
"seo_searchable": true,
"secure_zones": [
"example_string"
],
"user_roles": "1,2,3"
},
"slug": "my-updated-page",
"content": "example_string",
"layout": "application",
"format": "html",
"redirect_to": "/other-page",
"redirect_code": "301",
"request_method": "GET",
"response_headers": {},
"searchable": true
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://www.my-site.com/api/site/v2/pages/1234", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
"x-site-id": "YOUR_API_KEY"
},
body: JSON.stringify({
"merge_metadata": true,
"metadata": {
"name": "My Updated Page",
"enabled": true,
"seo_searchable": true,
"secure_zones": [
"example_string"
],
"user_roles": "1,2,3"
},
"slug": "my-updated-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(`{
"merge_metadata": true,
"metadata": {
"name": "My Updated Page",
"enabled": true,
"seo_searchable": true,
"secure_zones": [
"example_string"
],
"user_roles": "1,2,3"
},
"slug": "my-updated-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("PUT", "https://www.my-site.com/api/site/v2/pages/1234", 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/1234')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['x-api-key'] = 'YOUR_API_KEY'
request['x-site-id'] = 'YOUR_API_KEY'
request.body = '{
"merge_metadata": true,
"metadata": {
"name": "My Updated Page",
"enabled": true,
"seo_searchable": true,
"secure_zones": [
"example_string"
],
"user_roles": "1,2,3"
},
"slug": "my-updated-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": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"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/{id}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 ID of the page to update
The media type of the request body
When true (default), merges provided metadata with existing metadata. When false, replaces it entirely.
Must be unique. Only validated if the slug is being changed.
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)
Path Parameters
Body
When true (default), merges provided metadata with existing metadata. When false, replaces it entirely.
trueMy Updated PageToggling to false automatically sets redirect_to to /404. Toggling back to true removes it.
truetrue1,2,3applicationhtml/other-page301GETtrueResponses
OK
Unauthorized - Credentials incorrect
Forbidden - You cannot access this site
Not Found - Page does not exist
Unprocessable Entity - Required data missing or invalid