Skip to main content

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.

Use these endpoints to manage REST API keys programmatically.
Use the MainWP Postman collection as the source of truth for request and response schemas.
{key_identifier} accepts either a numeric key ID (v2) or a ck_... key identifier (legacy key format).

Route Matrix

MethodPathPurposeKey Params
GET/rest-api/keysList API keyspage, per_page
POST/rest-api/add-keyCreate a new API keyactive (bool), permissions (read, write, or read,write), optional description
PUT, PATCH/rest-api/edit-key/{key_identifier}Edit key propertieskey_identifier, optional active, permissions (read, write, or read,write), optional description
DELETE/rest-api/delete-key/{key_identifier}Delete an API keykey_identifier
write maps to the Write & Delete permission shown in the MainWP Dashboard UI.

Representative Requests

Create API key

curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "active": true,
    "permissions": "read,write",
    "description": "Automation key"
  }' \
  "https://your-dashboard.com/wp-json/mainwp/v2/rest-api/add-key"
{
  "success": 1,
  "message": "API Key created successfully.",
  "token": "GENERATED_TOKEN"
}

Edit API key

curl -X PATCH \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": false, "description": "Temporarily disabled"}' \
  "https://your-dashboard.com/wp-json/mainwp/v2/rest-api/edit-key/15"
{
  "success": 1,
  "message": "API Key updated successfully."
}