curl --request POST \
--url http://localhost:4200/publish \
--header 'Content-Type: application/json' \
--data '
{
"session": "<string>",
"siteId": "<string>",
"siteOrigin": "<string>",
"slugs": [
"<string>"
],
"includeSiteConfig": true
}
'import requests
url = "http://localhost:4200/publish"
payload = {
"session": "<string>",
"siteId": "<string>",
"siteOrigin": "<string>",
"slugs": ["<string>"],
"includeSiteConfig": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
session: '<string>',
siteId: '<string>',
siteOrigin: '<string>',
slugs: ['<string>'],
includeSiteConfig: true
})
};
fetch('http://localhost:4200/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4200",
CURLOPT_URL => "http://localhost:4200/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session' => '<string>',
'siteId' => '<string>',
'siteOrigin' => '<string>',
'slugs' => [
'<string>'
],
'includeSiteConfig' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:4200/publish"
payload := strings.NewReader("{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:4200/publish")
.header("Content-Type", "application/json")
.body("{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:4200/publish")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}"
response = http.request(request)
puts response.read_bodyPublish the draft to the live site target
Computes the diff against the currently-published state first, then hands the selected pages to the registered publish target and records a publish-log row either way. Requires the publish token when one is configured; a siteOrigin that is not an allowed URL is refused with 400.
The site-contract target POSTs the pages to {siteOrigin}/api/editor/publish, forwarding this orchestrator’s PUBLISH_TOKEN as x-publish-token. That endpoint has guards of its own — it refuses a publish that would remove every page, and refuses to run at all under NODE_ENV=production with no token configured — and whatever it refuses arrives here as a 400 carrying its explanation.
curl --request POST \
--url http://localhost:4200/publish \
--header 'Content-Type: application/json' \
--data '
{
"session": "<string>",
"siteId": "<string>",
"siteOrigin": "<string>",
"slugs": [
"<string>"
],
"includeSiteConfig": true
}
'import requests
url = "http://localhost:4200/publish"
payload = {
"session": "<string>",
"siteId": "<string>",
"siteOrigin": "<string>",
"slugs": ["<string>"],
"includeSiteConfig": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
session: '<string>',
siteId: '<string>',
siteOrigin: '<string>',
slugs: ['<string>'],
includeSiteConfig: true
})
};
fetch('http://localhost:4200/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "4200",
CURLOPT_URL => "http://localhost:4200/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session' => '<string>',
'siteId' => '<string>',
'siteOrigin' => '<string>',
'slugs' => [
'<string>'
],
'includeSiteConfig' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:4200/publish"
payload := strings.NewReader("{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:4200/publish")
.header("Content-Type", "application/json")
.body("{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:4200/publish")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"session\": \"<string>\",\n \"siteId\": \"<string>\",\n \"siteOrigin\": \"<string>\",\n \"slugs\": [\n \"<string>\"\n ],\n \"includeSiteConfig\": true\n}"
response = http.request(request)
puts response.read_bodyBody
Publish only these pages and leave every other page as the live site already has it. Absent or empty means the whole draft. The non-destructive merge lives in publish-selection.ts; a selection is refused with 400 when no trustworthy published baseline can be loaded to merge against.
Whether the site header/navigation configuration ships with this publish. Defaults to true.
Response
{ status, session, slugs, ... } — what the target reported, plus whatever that target can say about where the content went (commitSha, message, inspectUrl, deploymentId). ready means the write has already happened; triggered means a deployment is running and a later GET /publish/status is the only thing that learns how it ended. Read status rather than the HTTP code alone: a deploy-hook target whose hook rejected the call still answers 200, with status: "failed".