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

# Connecting MainWP to Neo

> Create a MainWP REST API key, add a Cloudflare Access service token if your Dashboard uses one, and save both in Neo

You connect MainWP once at the MSP level. One API key covers every client and site on your MainWP Dashboard.

## Before you start

Neo calls your Dashboard from the internet, at `https://<your dashboard>/wp-json/mainwp/v2/`. The WordPress site that runs the Dashboard must answer there over HTTPS with a certificate from a public authority. If you only allow known addresses, allow [Neo's IP addresses](https://docs.neoagent.io/integrations/ip-whitelisting.md).

* Use MainWP Dashboard 5 or later, which has the REST API v2.
* In WordPress, open **Settings > Permalinks** and choose any option except **Plain**. The REST API needs it.
* On Apache, a server that drops the `Authorization` header makes MainWP refuse every key. Add `SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1` to the site's `.htaccess` if your key is refused.
* If your Dashboard sits behind **Cloudflare Access**, create a service token for Neo in Cloudflare Zero Trust (**Access > Service credentials > Service tokens**) and add a **Service Auth** policy for it to the Dashboard's Access application. Keep the token's Client ID and Client Secret for step 2.
* Assign each site to its client in MainWP, so an agent on a client's ticket can reach the client's sites.

## 1. Create the API key

**1. Open API Keys**

In WordPress, open **MainWP Dashboard > API Access > API Keys** and click **Add API Keys**.

**2. Create a key for Neo**

Name it Neo and give it the **Read** permission. Add **Write & Delete** only if your agents should change sites, plugins or updates.

**3. Copy the key**

Copy the API key (the Bearer token) and click **Save API Key**. MainWP shows the key only once.

> [!WARNING]
>
> When you disable or delete the key in MainWP, Neo loses access until you save a new key here.

## 2. Add the key in Neo

**1. Open Integrations**

In the Neo Dashboard, open **Integrations** and find the MainWP card, under Other.

**2. Save the settings**

Enter your Dashboard's URL (for example `https://dashboard.example.com`, or the folder WordPress lives in, such as `https://example.com/wp`) and the API key. If the Dashboard is behind Cloudflare Access, also enter the service token's Client ID and Client Secret. Click **Save settings**. Neo counts your sites with them before saving, so a wrong URL or key is rejected straight away.

## 3. Turn MainWP on per agent

Open the agent, go to its **Tools & Settings** tab, click **Other**, and expand the **MainWP** block. Pick one of its **Presets**, or set each area yourself. Every area can be Disabled, Read Only or Read / Write.

| Area | Covers |
| - | - |
| **Sites** | Sites with their versions, connection and sync status, health, security checks and changes made outside MainWP; syncing, checking, reconnecting, editing, suspending and adding sites. Removing a site always asks. |
| **Plugins and Themes** | A site's plugins and themes, abandoned ones, activating, deactivating and deleting them. |
| **Updates** | Pending core, plugin, theme and translation updates and ignored updates; running and ignoring them. Running every update on every site always asks. |
| **Clients and Tags** | Clients, their fields, sites and costs, and tags. Removing a client always asks. |
| **Posts, Pages and Comments** | Posts, pages and comments on your sites. |
| **WordPress Users** | Users on your sites. Creating or editing a user and setting the administrator password always ask. |
| **Monitoring and Reports** | Uptime monitors, heartbeats and incidents, SSL and domain checks, Lighthouse audits, Pro Reports data. |
| **Costs and Time Tracking** | Cost Tracker records and Time Tracker tasks. |
| **Dashboard Settings** | Dashboard settings, maintenance tools and API keys. Changes here reach every site. Disconnecting every site, signing every user out and changing or deleting an API key always ask. |

| Preset | What runs on its own | What asks a technician |
| - | - | - |
| **Read Only** | Every read | No write is allowed |
| **Helpdesk** | Every read | Every change to sites, plugins and themes, updates, content and monitors. Other writes are off |
| **IT Admin** | Every read and most changes | Plugin and theme changes, WordPress users and Dashboard settings |
| **Full Automation** | Every read and write | Only the writes that always ask |

For a WordPress ticket agent that only looks up and describes sites, pick **Read Only**.

See [MainWP API](https://docs.neoagent.io/agents/tools/management/mainwp-api.md) for what the agent can read and change.


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