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"
}
]
}
PUT
/pages/{id}PUT
Base URLstring
Target server for requests. Edit to use your own host.
API Key (header: x-site-id)
x-site-idstring
RequiredThe 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)
path
idstring
RequiredThe ID of the page to update
Content-Typestring
RequiredThe media type of the request body
Options: application/json
merge_metadataboolean
When true (default), merges provided metadata with existing metadata. When false, replaces it entirely.
slugstring
Must be unique. Only validated if the slug is being changed.
Request Preview
Response
Response will appear here after sending the request
Authentication
header
x-api-keystring
RequiredAPI Key for authentication. Your Siteglide API key
header
x-site-idstring
RequiredAPI 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
application/json
merge_metadataboolean
When true (default), merges provided metadata with existing metadata. When false, replaces it entirely.
Example:
truelayoutstring
Example:
applicationformatstring
Example:
htmlredirect_tostring
Example:
/other-pageredirect_codestring
Example:
301request_methodstring
Example:
GETsearchableboolean
Example:
trueResponses
OK
Was this page helpful?