Set an application's publish state
View as MarkdownSets the application's publish state.
Full description
Sets the application's publish state.
{ "published": true }takes the site live aturls.publish;{ "published": false }takes it back behind its Coming Soon page. Returns202 Acceptedwith anAppOperationthat carries noapp; theLocationheader andlinks[rel=self]give the poll URL. PollGET /app-operations/{operationId}untilstatusisCOMPLETEDorFAILED, then readGET /apps/{appId}/publish-state. A request for the state the application is already in is accepted with202and runs no change; the returnedAppOperationis alreadyCOMPLETED. The body is aPublishStatecarrying onlypublished: exactly{ "published": <boolean> }. A body that lackspublished, whosepublishedis not a boolean, or that has any other field, the read-onlyfirstPublishedAt,updatedAtandlinksincluded, is a400. Going live is subject to the subscription's plan: a plan that allows no live sites, or one whose live-site limit is reached, answers422withdetails[].issuePUBLISH_LIMIT_EXCEEDED. The limit is checked again as the change runs, so a concurrent publish that takes the last slot ends the operationFAILEDwitherror.details[].issuePUBLISH_LIMIT_EXCEEDED; any other failure ends itFAILEDwithPUBLISH_STATE_CHANGE_FAILED. A subscription that is not active cannot take a site live and answers403withdetails[].issueSUBSCRIPTION_INACTIVE. Taking a site offline is never limited. An application whosestatusisDELETINGanswers422withdetails[].issueAPP_DELETING, whichever state is requested. While another write holds the application's lock, the request answers503withdetails[].issueUPSTREAM_UNAVAILABLEandRetry-After: 5; retry after that delay. The request is idempotent by nature, soIdempotency-Keyis not used. While a change for this application is still running, aPUTfor the same state returns202with that running operation; aPUTfor the opposite state is refused with409anddetails[].issuePUBLISH_STATE_CHANGE_IN_PROGRESS. Poll the running operation, then retry. The same409is returned for a moment while another publish-state request on the same subscription is being accepted; retry shortly. Offered for the same products asGET /apps/{appId}/publish-state;NODEJS-ids answer501NOT_APPLICABLE.
Authorization
bearerAuth Personal Access Token (PAT). Generate one from the developer dashboard. Pass as: Authorization: Bearer <token>.
In: header
Path Parameters
Application identifier in {PRODUCT}-{id} form. The prefix is the application type in upper case — an upper-case letter followed by any number of upper-case letters, digits, or underscores — then a hyphen, then the identifier. For NODEJS, the suffix is a 10-character nanoid. Example: NODEJS-aBcDeFgHiJ. For MHWP, the suffix is a 10-character nanoid of lower-case letters and digits only. Example: MHWP-a1b2c3d4e5.
^[A-Z][A-Z0-9_]*-[A-Za-z0-9_-]+$Header Parameters
W3C Trace Context identifier for this request. Clients should send a traceparent on every request so the trace can be correlated across services. See https://www.w3.org/TR/trace-context/ for the format.
^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$Request Body
application/json
Whether an application is live. The go-live resource for products that have no build or deploy step, such as Managed Hosting for WordPress (MHWP): a WordPress site is provisioned ready to serve and is taken live, or back behind its Coming Soon page, by changing this state. GET returns the current state. PUT with { "published": true } or { "published": false } starts the change and returns 202 Accepted; poll the operation in Location and links[rel=self] until it is COMPLETED or FAILED. A PUT that asks for the state the application is already in is accepted with 202 and runs no change; the returned AppOperation is already COMPLETED.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/apps/string/publish-state" \ -H "Content-Type: application/json" \ -d '{ "published": true }'{ "operationId": "string", "type": "CREATE_APP", "status": "PENDING", "app": { "id": "NODEJS-aBcDeFgHiJ", "status": "CREATING", "region": "na", "createdAt": "stringstringstringst", "links": [ { "href": "http://example.com", "rel": "string", "title": "string", "targetMediaType": "string", "targetSchema": null, "method": "string", "submissionMediaType": "application/json", "submissionSchema": null } ] }, "error": { "name": "string", "correlationId": "string", "message": "string", "informationLink": "string", "details": [ { "field": "string", "value": "string", "location": "body", "issue": "string", "description": "string" } ], "links": [ { "href": "http://example.com", "rel": "string", "title": "string", "targetMediaType": "string", "targetSchema": null, "method": "string", "submissionMediaType": "application/json", "submissionSchema": null } ] }, "createdAt": "stringstringstringst", "links": [ { "href": "http://example.com", "rel": "string", "title": "string", "targetMediaType": "string", "targetSchema": null, "method": "string", "submissionMediaType": "application/json", "submissionSchema": null } ]}Agent & Automation Notes
hosting.deployment:executeRelated
Last updated on
How is this guide?