Documentation Index
Fetch the complete documentation index at: https://mainwp-mintlify-c0f00f42.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
MainWP registers 30 site management abilities into the WordPress Abilities API framework. These enable programmatic control over your WordPress network through standardized schemas.
What You’ll Learn
- Listing, filtering, and retrieving site information
- Adding, updating, and deleting sites
- Managing site connectivity (sync, reconnect, disconnect, suspend)
- Managing plugins and themes on individual sites
- Retrieving security, change logs, and cost data
mainwp/list-sites-v1
List MainWP child sites with pagination and filtering.
Method: GET (readonly)
curl -u 'admin:xxxx' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/list-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
page | integer | No | 1 | Page number (1-based) |
per_page | integer | No | 20 | Items per page (1-100) |
status | string | No | ”any” | Filter: any, connected, disconnected, suspended |
search | string | No | "" | Search term for name or URL |
client_id | integer | No | — | Filter by client ID |
tag_id | integer | No | — | Filter by tag/group ID |
Response:
{
"items": [
{
"id": 1,
"url": "https://site1.example.com",
"name": "Site 1",
"status": "connected",
"client_id": 5
}
],
"page": 1,
"per_page": 20,
"total": 150
}
mainwp/get-site-v1
Get detailed information about a single site.
Method: POST (requires input)
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"include_stats":true}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain/URL |
include_stats | boolean | No | false | Include update counts and health score |
Response:
{
"id": 1,
"url": "https://site1.example.com",
"name": "Site 1",
"status": "connected",
"client_id": 5,
"wp_version": "6.4.2",
"php_version": "8.2.0",
"last_sync": "2024-01-15T10:30:00Z",
"admin_username": "admin",
"child_version": "4.6.1",
"notes": "Production site",
"stats": {
"plugin_updates": 3,
"theme_updates": 1,
"wp_update_available": false,
"health_score": 85
}
}
mainwp/sync-sites-v1
Trigger synchronization for one or more sites. Operations with more than 200 sites are queued for background processing.
Method: POST
# Sync specific sites
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[1, 2, 3]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/sync-sites-v1/run'
# Sync all sites (empty array)
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/sync-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_ids_or_domains | array | No | [] | Site IDs or domains. Empty = all sites |
Response (Immediate - 200 sites or fewer):
{
"queued": false,
"synced": [
{"id": 1, "url": "https://site1.example.com", "name": "Site 1"}
],
"errors": [],
"total_synced": 1,
"total_errors": 0
}
Response (Queued - more than 200 sites):
{
"queued": true,
"job_id": "sync_abc123def456",
"status_url": "https://your-dashboard.com/wp-json/mainwp/v2/jobs/sync_abc123def456",
"sites_queued": 350
}
mainwp/add-site-v1
Add a new MainWP child site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"url":"https://newsite.example.com","admin":"admin","name":"New Site"}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/add-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
url | string | Yes | — | Site URL |
admin | string | Yes | — | Admin username on child site |
name | string | No | — | Display name for the site |
client_id | integer | No | — | Associate with a client |
tags | array | No | — | Array of tag IDs to assign |
http_user | string | No | — | HTTP Auth username |
http_pass | string | No | — | HTTP Auth password |
ssl_verify | boolean | No | true | Verify SSL certificate |
Response:
Returns the created site object (same format as get-site-v1).
mainwp/update-site-v1
Update an existing site’s properties.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"name":"Updated Name","notes":"New notes"}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/update-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
name | string | No | — | Site display name |
notes | string | No | — | Site notes |
client_id | integer | No | — | Client ID (null to unassign) |
tags | array | No | — | Tag IDs (replaces existing) |
Response:
Returns the updated site object.
mainwp/delete-site-v1
Delete a site from MainWP. This is a destructive operation that requires confirmation.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"confirm":true}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/delete-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
confirm | boolean | Yes | — | Must be true to confirm deletion |
dry_run | boolean | No | false | Preview without deleting |
Response:
{
"deleted": true,
"site_id": 1,
"site_url": "https://site1.example.com"
}
mainwp/reconnect-site-v1
Reconnect a single disconnected site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/reconnect-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"reconnected": true,
"site_id": 1,
"site_url": "https://site1.example.com",
"status": "connected"
}
mainwp/disconnect-site-v1
Disconnect a site. The site remains in the database but communication is disabled.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/disconnect-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"disconnected": true,
"site_id": 1,
"site_url": "https://site1.example.com",
"status": "disconnected"
}
mainwp/suspend-site-v1
Suspend a site. Suspended sites are excluded from sync and update operations.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/suspend-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"suspended": true,
"site_id": 1,
"site_url": "https://site1.example.com",
"status": "suspended"
}
mainwp/unsuspend-site-v1
Unsuspend a previously suspended site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/unsuspend-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"unsuspended": true,
"site_id": 1,
"site_url": "https://site1.example.com",
"status": "connected"
}
mainwp/check-site-v1
Check connectivity status of a single site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/check-site-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"site_id": 1,
"site_url": "https://site1.example.com",
"reachable": true,
"response_time_ms": 245,
"http_status": 200
}
mainwp/get-site-plugins-v1
Get list of plugins installed on a child site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"status":"active"}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-plugins-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
status | string | No | ”all” | Filter: all, active, inactive |
has_update | boolean | No | — | Filter to plugins with updates |
Response:
{
"site_id": 1,
"site_url": "https://site1.example.com",
"plugins": [
{
"slug": "akismet/akismet.php",
"name": "Akismet Anti-spam",
"version": "5.3",
"active": true,
"update_version": "5.3.1"
}
],
"total": 15
}
mainwp/activate-site-plugins-v1
Activate plugins on a site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"slugs":["akismet/akismet.php"]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/activate-site-plugins-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
slugs | array | Yes | — | Plugin slugs to activate |
Response:
{
"site_id": 1,
"activated": ["akismet/akismet.php"],
"errors": []
}
mainwp/deactivate-site-plugins-v1
Deactivate plugins on a site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"slugs":["akismet/akismet.php"]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/deactivate-site-plugins-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
slugs | array | Yes | — | Plugin slugs to deactivate |
Response:
{
"site_id": 1,
"deactivated": ["akismet/akismet.php"],
"errors": []
}
mainwp/delete-site-plugins-v1
Delete plugins from a site. This is a destructive operation that requires confirmation.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"slugs":["hello-dolly/hello.php"],"confirm":true}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/delete-site-plugins-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
slugs | array | Yes | — | Plugin slugs to delete |
confirm | boolean | Yes | — | Must be true to confirm deletion |
Response:
{
"site_id": 1,
"deleted": ["hello-dolly/hello.php"],
"errors": []
}
mainwp/get-site-themes-v1
Get list of themes installed on a child site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-themes-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"site_id": 1,
"site_url": "https://site1.example.com",
"active_theme": "twentytwentyfour",
"themes": [
{
"slug": "twentytwentyfour",
"name": "Twenty Twenty-Four",
"version": "1.0",
"active": true,
"update_version": null
}
],
"total": 3
}
mainwp/activate-site-theme-v1
Activate a theme on a site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"slug":"twentytwentyfour"}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/activate-site-theme-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
slug | string | Yes | — | Theme slug to activate |
Response:
{
"site_id": 1,
"activated": "twentytwentyfour",
"previous_theme": "twentytwentythree"
}
mainwp/delete-site-themes-v1
Delete themes from a site. This is a destructive operation that requires confirmation.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"slugs":["twentytwenty"],"confirm":true}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/delete-site-themes-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
slugs | array | Yes | — | Theme slugs to delete |
confirm | boolean | Yes | — | Must be true to confirm deletion |
Response:
{
"site_id": 1,
"deleted": ["twentytwenty"],
"errors": []
}
mainwp/get-abandoned-plugins-v1
Get list of abandoned plugins across all sites. Abandoned plugins have not received updates in 2+ years.
Method: GET (readonly)
curl -u 'admin:xxxx' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-abandoned-plugins-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
page | integer | No | 1 | Page number |
per_page | integer | No | 50 | Items per page |
Response:
{
"items": [
{
"site_id": 1,
"site_url": "https://site1.example.com",
"slug": "old-plugin/old-plugin.php",
"name": "Old Plugin",
"version": "1.0.0",
"last_updated": "2021-01-15"
}
],
"total": 5
}
mainwp/get-abandoned-themes-v1
Get list of abandoned themes across all sites.
Method: GET (readonly)
curl -u 'admin:xxxx' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-abandoned-themes-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
page | integer | No | 1 | Page number |
per_page | integer | No | 50 | Items per page |
Response:
{
"items": [
{
"site_id": 1,
"site_url": "https://site1.example.com",
"slug": "old-theme",
"name": "Old Theme",
"version": "1.0.0",
"last_updated": "2020-06-01"
}
],
"total": 2
}
mainwp/get-site-security-v1
Get security information about a site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-security-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"site_id": 1,
"site_url": "https://site1.example.com",
"security_issues": [
{
"type": "file_permissions",
"severity": "warning",
"message": "wp-config.php is world-readable"
}
],
"ssl_status": {
"valid": true,
"expires": "2025-06-15"
}
}
mainwp/get-site-changes-v1
Get change/activity log for a site. Requires the Logs module to be active.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1,"page":1,"per_page":50}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-changes-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
page | integer | No | 1 | Page number |
per_page | integer | No | 50 | Items per page |
Response:
{
"site_id": 1,
"changes": [
{
"id": 123,
"type": "plugin_updated",
"description": "Plugin 'Akismet' updated from 5.2 to 5.3",
"user": "admin",
"timestamp": "2024-01-15T10:30:00Z"
}
],
"total": 150
}
This ability requires the Logs module. If inactive, returns mainwp_module_not_available error.
mainwp/get-site-client-v1
Get the client associated with a site.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-client-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"site_id": 1,
"client": {
"id": 5,
"name": "Acme Corp",
"email": "contact@acme.com",
"status": "active"
}
}
mainwp/get-site-costs-v1
Get cost tracking data for a site. Requires the Cost Tracker module to be active.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_id_or_domain":1}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-site-costs-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_id_or_domain | integer|string | Yes | — | Site ID or domain |
Response:
{
"site_id": 1,
"costs": [
{
"id": 1,
"name": "Hosting",
"amount": 29.99,
"frequency": "monthly",
"next_due": "2024-02-15"
}
],
"total_monthly": 29.99,
"total_yearly": 359.88
}
This ability requires the Cost Tracker module. If inactive, returns mainwp_module_not_available error.
mainwp/count-sites-v1
Get total count of sites.
Method: GET (readonly)
curl -u 'admin:xxxx' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/count-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
status | string | No | ”any” | Filter: any, connected, disconnected, suspended |
Response:
mainwp/get-sites-basic-v1
Get minimal site information (ID, URL, name only) for all sites.
Method: GET (readonly)
curl -u 'admin:xxxx' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-sites-basic-v1/run'
Response:
{
"sites": [
{
"id": 1,
"url": "https://site1.example.com",
"name": "Site 1"
},
{
"id": 2,
"url": "https://site2.example.com",
"name": "Site 2"
}
],
"total": 150
}
mainwp/reconnect-sites-v1
Batch reconnect multiple disconnected sites.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[1, 2, 3]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/reconnect-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_ids_or_domains | array | No | [] | Site IDs or domains. Empty = all disconnected sites |
Response:
{
"reconnected": [
{"id": 1, "url": "https://site1.example.com"}
],
"errors": [],
"total_reconnected": 1,
"total_errors": 0
}
mainwp/disconnect-sites-v1
Batch disconnect multiple sites.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[1, 2, 3]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/disconnect-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_ids_or_domains | array | Yes | — | Site IDs or domains |
Response:
{
"disconnected": [
{"id": 1, "url": "https://site1.example.com"}
],
"errors": [],
"total_disconnected": 1,
"total_errors": 0
}
mainwp/check-sites-v1
Batch connectivity check for multiple sites.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[1, 2, 3]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/check-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_ids_or_domains | array | No | [] | Site IDs or domains. Empty = all sites |
Response:
{
"results": [
{
"site_id": 1,
"site_url": "https://site1.example.com",
"reachable": true,
"response_time_ms": 245
}
],
"summary": {
"total_checked": 3,
"reachable": 2,
"unreachable": 1
}
}
mainwp/suspend-sites-v1
Batch suspend multiple sites.
Method: POST
curl -X POST -u 'admin:xxxx' \
-H 'Content-Type: application/json' \
-d '{"input":{"site_ids_or_domains":[1, 2, 3]}}' \
'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/suspend-sites-v1/run'
Input Parameters:
| Name | Type | Required | Default | Description |
|---|
site_ids_or_domains | array | Yes | — | Site IDs or domains |
Response:
{
"suspended": [
{"id": 1, "url": "https://site1.example.com"}
],
"errors": [],
"total_suspended": 1,
"total_errors": 0
}