> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sites Abilities

> 30 abilities for managing MainWP child sites including listing, syncing, adding, updating, and managing plugins and themes.

MainWP registers 30 site management abilities into the WordPress Abilities API framework. These enable programmatic control over your WordPress network through standardized schemas.

> [!NOTE]
>
> Site abilities can access only sites owned by the calling WordPress user when per-user mode is enabled (`mainwp_is_single_user` is `false`). This also applies to administrators, site deletion, and plugin lists. Lists omit other users' sites; direct requests return the same missing-site error as an unknown site, with the ability's usual response format. Team Control permissions can limit access further, but cannot grant access to another user's sites. Default single-user installations are unchanged.

## 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)

```bash theme={null}
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:**

```json theme={null}
{
  "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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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

```bash theme={null}
# 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):**

```json theme={null}
{
  "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):**

```json theme={null}
{
  "queued": true,
  "job_id": "sync_abc123def456",
  "status_url": "https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-batch-job-status-v1/run?input%5Bjob_id%5D=sync_abc123def456",
  "sites_queued": 350
}
```

When `queued` is `true`, send an authenticated GET to `status_url` using your WordPress Application Password. The URL includes `input[job_id]`. See [Batch Operations](https://docs.mainwp.com/api-reference/abilities-api/batch-operations.md#mainwpget-batch-job-status-v1) for a polling example and response.

***

## mainwp/add-site-v1

Add a new MainWP child site.

**Method:** POST

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"url":"https://newsite.example.com","admin_username":"admin","name":"New Site","uniqueid":"xxxxx"}}' \
  '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_username` | string | Yes | - | Admin username on child site |
| `name` | string | Yes | - | Display name for the site |
| `client_id` | integer | No | — | Associate with a client |
| `tag_ids` | array | No | - | Array of tag IDs to assign |
| `http_user` | string | No | — | HTTP Auth username |
| `http_pass` | string | No | — | HTTP Auth password |
| `adminpassword` | string | No | - | WordPress administrator password. Required when Password Authentication is enabled on the child site |
| `uniqueid` | string | No | - | Unique Security ID from MainWP Child. Required when Unique Security ID is enabled or Password Authentication is disabled |
| `verify_certificate` | integer | No | 2 | `0` disables verification, `1` verifies, `2` uses the global setting |
| `ssl_version` | integer | No | 0 | cURL SSL version selection; `0` uses automatic detection |

MainWP Child requires at least one connection authentication method. Provide `adminpassword`, `uniqueid`, or both according to the child site's MainWP Child settings.

Keep certificate verification enabled and use HTTPS when connecting with an administrator password. Leave `ssl_version` at `0` unless your host requires a specific cURL SSL version.

> [!NOTE]
>
> Omitting `verify_certificate` uses the Dashboard's global certificate setting during registration and later connections. Explicit choices are saved for that site. Existing sites keep their saved settings. Use `verify_certificate` for this ability; `ssl_verify` is not an accepted input name.

**Response:**

Returns the created site object (same format as `get-site-v1`).

***

## mainwp/update-site-v1

Update an existing site's properties.

**Method:** POST

```bash theme={null}
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

```bash theme={null}
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:**

```json theme={null}
{
  "deleted": true,
  "site_id": 1,
  "site_url": "https://site1.example.com"
}
```

***

## mainwp/reconnect-site-v1

Reconnect a single disconnected site.

**Method:** POST

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "suspended": true,
  "site_id": 1,
  "site_url": "https://site1.example.com",
  "status": "suspended"
}
```

***

## mainwp/unsuspend-site-v1

Unsuspend a previously suspended site.

**Method:** POST

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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
}
```

***

## Preview Plugin and Theme Changes

Starting with MainWP Dashboard 6.4.1, `mainwp/activate-site-plugins-v1`, `mainwp/deactivate-site-plugins-v1`, and `mainwp/activate-site-theme-v1` accept `dry_run: true` to preview changes. With MainWP MCP, review and confirm the preview before the change runs. With direct Abilities API calls, omitting `dry_run` applies the change immediately and `confirm` remains optional for these three abilities.

## mainwp/activate-site-plugins-v1

Activate plugins on a site.

**Method:** POST

Supports a preview. Set `dry_run: true` to see which plugins would change without contacting the Child Site, review the result, then send the same request with `confirm: true`. Requests without `dry_run` apply the change right away, so existing integrations keep working. Do not set both flags to `true`; the ability returns `400` with `mainwp_invalid_input`.

Preview the change:

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"site_id_or_domain":1,"plugins":["akismet/akismet.php"],"dry_run":true}}' \
  '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 |
| `plugins` | array | Yes | - | Plugin slugs to activate, for example `akismet/akismet.php` |
| `dry_run` | boolean | No | false | Preview the change using the last synced site data |
| `confirm` | boolean | No | false | Confirm the change after a preview |

After reviewing the preview, apply the change:

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"site_id_or_domain":1,"plugins":["akismet/akismet.php"],"confirm":true}}' \
  'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/activate-site-plugins-v1/run'
```

**Preview response:**

```json theme={null}
{
  "dry_run": true,
  "would_affect": [
    {
      "slug": "akismet/akismet.php",
      "name": "Akismet Anti-spam",
      "active": false,
      "will_change": true
    }
  ],
  "count": 1,
  "warnings": ["Preview uses the last synced site data. Current state may have changed; unknown activation state is returned as null."]
}
```

`active` is the last synced state. `active` and `will_change` are `null` when MainWP has no synced state for the plugin. `count` includes plugins already in the requested state.

**Response:**

```json theme={null}
{
  "site_id": 1,
  "activated": ["akismet/akismet.php"],
  "errors": []
}
```

***

## mainwp/deactivate-site-plugins-v1

Deactivate plugins on a site.

**Method:** POST

Supports a preview. Set `dry_run: true` to see which plugins would change without contacting the Child Site, review the result, then send the same request with `confirm: true`. Requests without `dry_run` apply the change right away, so existing integrations keep working. Do not set both flags to `true`; the ability returns `400` with `mainwp_invalid_input`.

Preview the change:

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"site_id_or_domain":1,"plugins":["akismet/akismet.php"],"dry_run":true}}' \
  '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 |
| `plugins` | array | Yes | - | Plugin slugs to deactivate, for example `akismet/akismet.php` |
| `dry_run` | boolean | No | false | Preview the change using the last synced site data |
| `confirm` | boolean | No | false | Confirm the change after a preview |

After reviewing the preview, apply the change:

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"site_id_or_domain":1,"plugins":["akismet/akismet.php"],"confirm":true}}' \
  'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/deactivate-site-plugins-v1/run'
```

**Preview response:**

```json theme={null}
{
  "dry_run": true,
  "would_affect": [
    {
      "slug": "akismet/akismet.php",
      "name": "Akismet Anti-spam",
      "active": true,
      "will_change": true
    }
  ],
  "count": 1,
  "warnings": ["Preview uses the last synced site data. Current state may have changed; unknown activation state is returned as null."]
}
```

`active` is the last synced state. `active` and `will_change` are `null` when MainWP has no synced state for the plugin. `count` includes plugins already in the requested state.

**Response:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "site_id": 1,
  "deleted": ["hello-dolly/hello.php"],
  "errors": []
}
```

***

## mainwp/get-site-themes-v1

Get list of themes installed on a child site.

**Method:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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

Supports a preview. Set `dry_run: true` to see which themes would change without contacting the Child Site, review the result, then send the same request with `confirm: true`. Requests without `dry_run` apply the change right away, so existing integrations keep working. Do not set both flags to `true`; the ability returns `400` with `mainwp_invalid_input`.

Preview the change:

```bash theme={null}
curl -X POST -u 'admin:xxxx' \
  -H 'Content-Type: application/json' \
  -d '{"input":{"site_id_or_domain":1,"theme":"twentytwentyfour","dry_run":true}}' \
  '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 |
| `theme` | string | Yes | - | Theme slug to activate |
| `dry_run` | boolean | No | false | Preview the change using the last synced site data |
| `confirm` | boolean | No | false | Confirm the change after a preview |

After reviewing the preview, send the same request with `"confirm":true` instead of `"dry_run":true`.

The preview response includes `would_affect`, `count`, and `warnings`, plus `current_theme` with the last synced active theme, or `null` when unknown.

**Response:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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)

```bash theme={null}
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:**

```json theme={null}
{
  "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)

```bash theme={null}
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:**

```json theme={null}
{
  "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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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
}
```

> [!NOTE]
>
> 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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "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:** GET (readonly)

```bash theme={null}
curl -G -u 'admin:xxxx' \
  --data-urlencode 'input_json={"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:**

```json theme={null}
{
  "site_id": 1,
  "costs": [
    {
      "id": 12,
      "name": "Shared Hosting",
      "type": "subscription",
      "price": 89,
      "renewal_type": "monthly",
      "payment_method": "credit_debit",
      "product_type": "hosting",
      "last_renewal": "2026-06-29T00:00:00+00:00",
      "next_renewal": "2026-11-29T00:00:00+00:00",
      "purchase_date": "2026-06-29T00:00:00+00:00",
      "license_type": "multi_site",
      "sites_count": 10,
      "site_share": 8.9
    }
  ],
  "total": 1
}
```

**Response fields for each cost:**

| Field | Description |
| - | - |
| `id`, `name` | Cost ID and name |
| `type` | `subscription` (recurring) or `lifetime` (one-time) |
| `price` | Price for one renewal period. For `single_site`, this price applies to each covered site. For `multi_site`, this is the total price split across covered sites |
| `renewal_type` | How often it renews: `weekly`, `monthly`, `quarterly`, `yearly` or `disabled` |
| `purchase_date` | Date the cost was bought |
| `last_renewal` | Same value as `purchase_date`. Still returned for existing integrations; it does not move forward as renewals pass |
| `next_renewal` | Next renewal date, the same date the Cost Tracker shows. `null` for lifetime costs and costs that aren't active |
| `license_type` | `single_site` (full price for each site) or `multi_site` (price split across the cost's sites) |
| `sites_count` | Number of sites the cost covers, including sites added through groups or clients |
| `site_share` | This site's part of the price for each renewal period: the full price for a single-site license, or the price divided by `sites_count` for a multiple-site license. `0` when the cost isn't active |

> [!NOTE]
>
> 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)

```bash theme={null}
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:**

```json theme={null}
{
  "total": 150
}
```

***

## mainwp/get-sites-basic-v1

Get minimal site information (ID, URL, name only) for all sites.

**Method:** GET (readonly)

```bash theme={null}
curl -u 'admin:xxxx' \
  'https://your-dashboard.com/wp-json/wp-abilities/v1/abilities/mainwp/get-sites-basic-v1/run'
```

**Response:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "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

```bash theme={null}
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:**

```json theme={null}
{
  "suspended": [
    {"id": 1, "url": "https://site1.example.com"}
  ],
  "errors": [],
  "total_suspended": 1,
  "total_errors": 0
}
```

***

## Related Resources

* [Abilities API Overview](https://docs.mainwp.com/api-reference/abilities-api/overview.md) - API basics and authentication
* [Updates Abilities](https://docs.mainwp.com/api-reference/abilities-api/updates.md) - Update management abilities
* [Clients Abilities](https://docs.mainwp.com/api-reference/abilities-api/clients.md) - Client management abilities
* [REST API Sites](https://docs.mainwp.com/api-reference/rest-api/sites.md) - REST API alternative for site management


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.