Writes and asynchronous operations
Create, update and delete
Write requests send a JSON body and need a read and write token (see Authentication).
Updates are documented as PATCH. PUT is accepted on the same URLs and does exactly the same: both change only the fields you send.
Creating a resource that is later read at its own URL (a website, a tag, a team, a client, a contact, a global configuration) carries the Location header. Some creations answer 201 without it because what they create has no URL of its own: file uploads, contact methods, the integrations of a notification configuration (POST /alerts/{alert}/integrations, which creates the Slack or Discord integration or replaces its URL) and the tasks created by POST /site-tasks (which answers 200 with an empty data when every website was skipped). Requests that perform an action rather than create a resource document their own answer: creating a connection plugin download, generating a website login link, clearing a website cache and verifying a website connection answer 200.
Asynchronous operations
Some operations reach the WordPress installation of each website, or copy data, and take seconds to minutes. They answer 202 Accepted as soon as the work is queued:
The 202 document lists the resources created, one per website that accepted the work, and the websites that were skipped:
datacan be empty: when every website was skipped, the answer is still202.- Each entry of
meta.skippednames the website (site_id,site_name), carries the id of the related target (site_action_idabove,backup_id,site_scan_idand so on), which isnullwhen there is none, a machine-readablereason_codeand a readablemessage.reason_codeis one ofSITE_UNREACHABLE,UNSUPPORTED,NOT_FOUND,PERMISSION_DENIED,CONFLICT,ALREADY_APPLIEDandQUOTA_EXCEEDED; new codes can be added (see Versioning). site_id,site_nameand the target id can benull: an entry withreason_codePERMISSION_DENIEDnames a website or a target outside your access without disclosing its name (and, for a target, without its website).meta.warningsappears when the work was queued with something you should know about.
202 means queued, not done. Follow each created resource by its id until it settles.
Following a site action
Read the action with its show endpoint and watch status:
Following a backup
A backup copy takes minutes. Read it, or list backups filtered by phase, and watch phase:
Restorations can be read through the API, but they are started from the dashboard.
Synchronous bulk answers
Writes over a selection that change data in place are done before the answer is built, so they answer 200 OK instead of 202. This covers assigning websites to a global configuration (the sites/sync endpoints of Uptime Monitor, Backups, Malware Scanner and Broken Links Checker), syncing or detaching the websites and the contacts of a notification configuration (POST /alerts/{alert}/sites/sync, /sites/detach, /contacts/sync and /contacts/detach), ignoring or restoring Broken Links Checker findings and pages in bulk, and hiding or showing a component on a selection of websites (PATCH /components/{component}/visibility). The document has no data: everything sits under meta.
meta.statusisappliedwhen at least one entry changed andskippedwhen nothing did.meta.updatedlists what changed, andmeta.skippedwhat was refused, with the samereason_codeandmessageas in the202document. Both can be empty. The key of the changed entries and the name of the id inside each entry depend on the endpoint (for examplesite_preset_uptime_idabove, orissue_idfor findings).- There is nothing to poll: the change is already made when the answer arrives.
Polling
Poll gently: a few seconds between reads of the same resource is enough, and every read counts towards your rate limit.
