API reference/Pages
Add a page
Try itAdds a page to the draft, optionally with its sections. The site's package decides how many pages can show; a hidden page never counts. Goes live with the next publish.
POST
/api/v1/sites/{site_id}/pagesAuthentication
An API key as Authorization: Bearer or x-api-key. It needs the sites:write scope — edit draft pages and sections.
sites:writeChanges the draft or a recordIdempotency-Key requiredMCP tool: create_page
Parameters
Named placeholders go in the path; the rest in a JSON body.
site_idstringPath · required- The site's id.1 to 100 characters
titlestringBody · required- The page's name in the menu.1 to 80 characters
slugstringBody · optional- The web address. Omitted = from the title (a number is added if taken).At most 60 characters
parent_idstring | nullBody · optional- Put the page under another (one level deep) — its menu shows it as a dropdown.At most 100 characters
positionintegerBody · optional- Menu order, 0-based. Omitted = last.0 to 200
show_in_navbooleanBody · optional- Listed in the site's menu.Default
true hiddenbooleanBody · optional- Hidden pages are never published.Default
false hide_from_searchbooleanBody · optional- Hide from search engines: the live page stays public but says noindex and is left out of sitemap.xml and the site's own search (a thank-you or ad landing page). Not the home page. Live with the next publish.Default
false seo_titlestring | nullBody · optional- At most 120 characters
seo_descriptionstring | nullBody · optional- At most 300 characters
sectionsarray of objectBody · optional- Sections to start the page with, in order.Default
[]
Response
201 with JSON on success (schema on the right). Errors use the standard envelope; a retry with the same Idempotency-Key gets the first answer back (how retries work).
curl -X POST 'https://websites.workflowcorp.com/api/v1/sites/SITE_ID/pages' \
-H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"title":"Catering","sections":[{"type":"text","content":{"heading":"Catering for any size","body":"Office lunches, parties and weddings. Call two days ahead."}}]}'{
"site_id": "SITE_ID",
"title": "Catering",
"sections": [
{
"type": "text",
"content": {
"heading": "Catering for any size",
"body": "Office lunches, parties and weddings. Call two days ahead."
}
}
]
}{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"slug": {
"type": "string",
"description": "\"\" for the home page."
},
"path": {
"type": "string",
"description": "Where it lives on the site, e.g. /about."
},
"is_home": {
"type": "boolean"
},
"parent_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"position": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"show_in_nav": {
"type": "boolean"
},
"hidden": {
"type": "boolean",
"description": "Hidden pages stay in the draft and are never published."
},
"hide_from_search": {
"type": "boolean",
"description": "Hidden from search engines: noindex, left out of sitemap.xml and site search (the draft's setting; live with the next publish)."
},
"seo_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"seo_description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"section_count": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"is_sample": {
"type": "boolean"
}
},
"required": [
"id",
"title",
"slug",
"path",
"is_home",
"parent_id",
"position",
"show_in_nav",
"hidden",
"hide_from_search",
"seo_title",
"seo_description",
"section_count",
"is_sample"
],
"additionalProperties": false
}