Publish site assets
POST
/api/sites/{id}/publish
const url = 'https://example.com/api/sites/example/publish';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"items":["example"],"force":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/sites/example/publish \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "items": [ "example" ], "force": true }'Publishes all draft items on the site
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
Site ID
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
items
Specific item IDs to publish (publishes all if empty)
Array<string>
force
Force republish even if already published
boolean
Examplegenerated
{ "items": [ "example" ], "force": true}Responses
Section titled “Responses”Assets published successfully
Media typeapplication/json
object
success
required
Whether publish was successful
boolean
publishedCount
Number of items published
number
message
Status message
string
Examplegenerated
{ "success": true, "publishedCount": 1, "message": "example"}