Skip to main content
The MainWP REST API lets you manage your MainWP Dashboard programmatically over HTTP.
Use the MainWP Postman collection as the source of truth for request and response schemas.

What You’ll Learn

  • How to authenticate with REST API keys
  • Which endpoint category to use for each task
  • How v2 and legacy v1 access fit together

Base URL

All v2 endpoints use:
https://your-dashboard.com/wp-json/mainwp/v2/
Use Bearer token authentication for v2:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://your-dashboard.com/wp-json/mainwp/v2/sites/basic"

Set Up API Keys

1

Configure permalinks

Go to WP Admin > Settings > Permalinks and choose any option except Plain.Permalinks settings
2

Create a key in API Access

Go to MainWP Dashboard > API Access > API Keys > Add API Keys, set a name, assign permissions, and generate a key.
3

Store the key securely

Copy the generated token when shown and store it safely.
The API key token is shown only once.
4

Use the token in requests

Send it in the Authorization: Bearer ... header for all v2 calls.

Permission Scope

PermissionMethodsPurpose
ReadGETFetch data
WritePOST, PUT, PATCHCreate and update
DeleteDELETERemove resources

Endpoint Categories

For extension-specific endpoints, see Extensions Endpoints.

Legacy v1 Compatibility

MainWP still supports legacy v1 endpoints (/wp-json/mainwp/v1/) for backward compatibility.
curl -u "CONSUMER_KEY:CONSUMER_SECRET" \
  "https://your-dashboard.com/wp-json/mainwp/v1/sites"
Build new integrations on v2 first. Use v1 only where an existing integration still requires it.