Use these endpoints to manage child sites in MainWP Dashboard.
{id_or_domain} accepts either a numeric site ID or a site domain.
Route Matrix
Global Site Routes
| Method | Path | Purpose | Key Params |
|---|
| GET | /sites | List sites | page, per_page, search, include, exclude, status, with_tags, full_data |
| GET | /sites/basic | List lightweight site records | page, per_page, search, include, exclude, status |
| GET | /sites/count | Count sites | include, exclude, status |
| POST, PUT, PATCH | /sites/sync | Trigger sync for all sites | Optional filters like include, exclude |
| POST, PUT, PATCH | /sites/reconnect | Trigger reconnect for all sites | Optional filters |
| POST, PUT, PATCH | /sites/disconnect | Disconnect all matched sites | Optional filters |
| POST, PUT, PATCH | /sites/check | Run connection checks for all sites | Optional filters |
| POST | /sites/add | Add a child site | url, admin, plus adminpassword and/or uniqueid; optional name, groupids, client_id |
| POST | /sites/batch | Batch create/update/delete sites | create[], update[], delete[] payload; site creates use the same connection authentication fields as /sites/add |
Per-Site Routes
| Method | Path | Purpose | Key Params |
|---|
| GET | /sites/{id_or_domain} | Get full site details | id_or_domain, optional with_tags |
| POST, PUT, PATCH | /sites/{id_or_domain}/edit | Update site fields | name, groupids, client_id, other editable site fields |
| POST, PUT, PATCH | /sites/{id_or_domain}/sync | Sync one site | id_or_domain |
| GET | /sites/{id_or_domain}/security | Fetch security snapshot | id_or_domain |
| GET | /sites/{id_or_domain}/plugins | List plugins on one site | status, search, page, per_page, must_use |
| POST, PUT, PATCH | /sites/{id_or_domain}/plugins/activate | Activate plugin(s) | slug (single or comma list) |
| POST, PUT, PATCH | /sites/{id_or_domain}/plugins/deactivate | Deactivate plugin(s) | slug |
| DELETE | /sites/{id_or_domain}/plugins/delete | Delete plugin(s) | slug |
| GET | /sites/{id_or_domain}/plugins/abandoned | List abandoned plugins | Standard list filters |
| GET | /sites/{id_or_domain}/themes | List themes on one site | status, search, page, per_page |
| POST, PUT, PATCH | /sites/{id_or_domain}/themes/activate | Activate a theme | slug |
| DELETE | /sites/{id_or_domain}/themes/delete | Delete theme(s) | slug |
| GET | /sites/{id_or_domain}/themes/abandoned | List abandoned themes | Standard list filters |
| GET | /sites/{id_or_domain}/non-mainwp-changes | Show external/non-MainWP changes | id_or_domain, optional source, actions, contexts, total_count, page, per_page |
| POST, PUT, PATCH | /sites/{id_or_domain}/reconnect | Reconnect one site | id_or_domain |
| POST, PUT, PATCH | /sites/{id_or_domain}/disconnect | Disconnect one site | id_or_domain |
| POST, PUT, PATCH | /sites/{id_or_domain}/suspend | Suspend one site | id_or_domain |
| POST, PUT, PATCH | /sites/{id_or_domain}/unsuspend | Unsuspend one site | id_or_domain |
| POST, PUT, PATCH | /sites/{id_or_domain}/check | Run check for one site | id_or_domain |
| DELETE | /sites/{id_or_domain}/remove | Remove site from Dashboard | id_or_domain |
Site Relationship Routes
| Method | Path | Purpose | Key Params |
|---|
| GET | /sites/{id_or_domain}/client | Get client linked to a site | id_or_domain |
| GET | /sites/{id_or_domain}/costs | Get costs linked to a site | id_or_domain |
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
List sites
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://your-dashboard.com/wp-json/mainwp/v2/sites?page=1&per_page=20&status=connected"
{
"success": 1,
"total": 2,
"data": [
{
"id": 12,
"name": "Example Site",
"url": "https://example.com",
"status": "connected"
}
]
}
Activate a plugin on one site
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slug":"akismet/akismet.php"}' \
"https://your-dashboard.com/wp-json/mainwp/v2/sites/12/plugins/activate"
{
"success": 1,
"message": "Plugin activated successfully."
}
Batch site operations
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"create": [{"url":"https://new-site.com","name":"New Site","admin":"admin","uniqueid":"xxxxx"}],
"update": [{"id":12,"name":"Renamed Site"}],
"delete": [31]
}' \
"https://your-dashboard.com/wp-json/mainwp/v2/sites/batch"
{
"create": [{"success": 1}],
"update": [{"success": 1}],
"delete": [{"success": 1}]
}