Publish a site
Try itPuts the draft live as a new numbered version. The public site shows only published versions, so this is the one call that changes what visitors see. Runs the editor's sample check first: while made-up sample reviews, numbers, a logo strip, team members, a sample banner's figures, any (555) phone number or the template's business details (River City address, (555) phone, .test email) would go live, it refuses with 409 sample_content and lists them in error.items — replace or hide them, or send publish_sample_anyway: true.
/api/v1/sites/{site_id}/publishAuthentication
An API key as Authorization: Bearer or x-api-key. It needs the sites:publish scope — publish sites (put the draft live).
Parameters
Named placeholders go in the path; the rest in a JSON body.
site_idstringPath · required- The site's id.1 to 100 characters
notestringBody · optional- What changed, for the version history.At most 200 characters
publish_sample_anywaybooleanBody · optional- true puts the site live even though made-up sample content is still on it (the editor's "Publish anyway" tick). Leave it out unless a person has said so.
Response
200 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/publish' \
-H "Authorization: Bearer $WEBSITEBUDDY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note":"New spring menu","publish_sample_anyway":false}'{
"site_id": "SITE_ID",
"note": "New spring menu",
"publish_sample_anyway": false
}{
"type": "object",
"properties": {
"site_id": {
"type": "string"
},
"version": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"version_id": {
"type": "string"
},
"published_at": {
"type": "string"
},
"address": {
"type": "string"
},
"sample_kept": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "How many made-up sample parts went live because publish_sample_anyway was true (0 normally)."
}
},
"required": [
"site_id",
"version",
"version_id",
"published_at",
"address",
"sample_kept"
],
"additionalProperties": false
}