Publish a theme as the live theme (spend-class; approval-gated by store policy).
curl --request POST \
--url https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish"
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'X-Agent-Key': '<api-key>'}
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/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_URL => "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"X-Agent-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Agent-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"job_id": "<string>",
"status": "queued",
"existing": true
},
"meta": {}
}{
"success": true,
"message": "<string>",
"data": {
"job_id": "<string>",
"status": "queued",
"existing": false
},
"meta": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {},
"data": {
"ok": true,
"errors": [
{
"path": "<string>",
"rule": "<string>",
"severity": "error",
"message": "<string>",
"line": 123,
"column": 123,
"hint": "<string>"
}
],
"warnings": [
{
"path": "<string>",
"rule": "<string>",
"severity": "error",
"message": "<string>",
"line": 123,
"column": 123,
"hint": "<string>"
}
]
}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}themes
Publish a theme as the live theme (spend-class; approval-gated by store policy).
Runs theme check in publish mode first; any error returns 422 CHECK_FAILED and nothing is published or queued. Then follows the same publish path as the dashboard (role flip → instant deploy → bake). With the store setting agent_theme_publish_policy = approval_required (default) the job is created in pending_approval and runs after the merchant approves; with auto it is queued immediately. Webhooks theme.published / theme.publish_failed fire on the outcome.
POST
/
themes
/
{theme_id}
/
publish
Publish a theme as the live theme (spend-class; approval-gated by store policy).
curl --request POST \
--url https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Agent-Key: <api-key>'import requests
url = "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish"
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Agent-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'X-Agent-Key': '<api-key>'}
};
fetch('https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/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_URL => "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"X-Agent-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Agent-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Agent-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.platformdtc.com/api/v1/agent/v1/themes/{theme_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Agent-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"job_id": "<string>",
"status": "queued",
"existing": true
},
"meta": {}
}{
"success": true,
"message": "<string>",
"data": {
"job_id": "<string>",
"status": "queued",
"existing": false
},
"meta": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {},
"data": {
"ok": true,
"errors": [
{
"path": "<string>",
"rule": "<string>",
"severity": "error",
"message": "<string>",
"line": 123,
"column": 123,
"hint": "<string>"
}
],
"warnings": [
{
"path": "<string>",
"rule": "<string>",
"severity": "error",
"message": "<string>",
"line": 123,
"column": 123,
"hint": "<string>"
}
]
}
}{
"success": false,
"message": "<string>",
"error_code": "NOT_FOUND",
"errors": {}
}Authorizations
AgentApiKeyAgentBearer
Service-account key, format sq_agt_*. Carries least-privilege scopes.
Headers
Unique per logical operation; identical key+body returns the cached response, different body → 409.
Maximum string length:
200Target store; required when the key is bound to multiple stores.