Site routes: publish
The Site Verbs publish as api.sb routes, with inputs, result, refusals and an example.
Reference for Site, one group of Site routes.
Site.publish
Publish puts a Site’s current Pages live on its Domains, under its Brand. Verb page.
POST /{namespace}/ sites/ {site}/ publishPath: site. Emits Site.published.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
site | Site | required | The Site to publish. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
site | Site | required | The Site, now live. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
curl -X POST https: //api.sb/ kilnbakery.com/ sites/ site_kqt1HxwFab/ publish \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ kilnbakery.com",
"site": {
"$id": "https: //api.sb/ kilnbakery.com/ sites/ site_kqt1HxwFab",
"$type": "Site",
"kind": "api"
},
"action": {
"$id": "https: //api.sb/ kilnbakery.com/ actions/ act_0y76a1jB6k",
"operation": "Site.publish",
"status": "done"
},
"links": {
"self": "https: //api.sb/ kilnbakery.com/ actions/ act_0y76a1jB6k"
}
}