Use the MainWP Postman collection as the source of truth for request and response schemas.
{id_or_domain} accepts either a numeric site ID or a site domain.
Route Matrix
Global Site Routes
Per-Site Routes
Site Relationship Routes
When creating a site through REST API, the site URL and administrator username are always required. Include
adminpassword when Password Authentication is enabled on the child site, include uniqueid when Unique Security ID is enabled, or include both when both methods are enabled. MainWP Child no longer allows both Password Authentication and Unique Security ID to be disabled.Representative Requests
Connection Input Types
When adding or editing sites, use the expected JSON types instead of relying on automatic conversion:
Omitting
force_use_ipv4 when adding a site uses the global setting for the connection attempt. Invalid values, such as 3 for force_use_ipv4 or null for ssl_verify, return HTTP 400. Check the error response for the affected parameter and correct it before retrying. Site creation inside /sites/batch and global /batch uses the same connection input validation.
Update Site Tags
Usegroupids when updating tags through /sites/{id_or_domain}/edit. It replaces the site’s tag assignments rather than adding to them.
Each ID must be a positive integer identifying an existing tag accessible to the authenticated API user. Duplicate IDs are removed, and spaces around IDs are allowed. Tag names, zero, negative IDs, nonexistent or inaccessible IDs, and empty entries such as
"3,,7" are rejected. The endpoint does not create tags.
tags, even with an empty value, or sending groupids as an array or another non-string type returns HTTP 400 with rest_invalid_param. Invalid tag IDs are checked before any site fields are saved and return success: 0, group_updated: false, and group_message explaining the failure.
Check the response body even when the HTTP status is 200. A successful tag update includes success: 1, group_updated: true, and group_message: "Tags updated successfully.".
If valid IDs pass validation but saving the tag assignments fails, other requested site fields may already have been saved. That response is:
success: 0 does not guarantee that the entire edit was rolled back.
