v1.2.0

Sites API

Programmatically manage WordPress sites, deployments, configurations, and monitoring through our RESTful API. All endpoints require authentication and support standard HTTP methods with JSON request/response payloads.

Authentication

Include your secret API key in the Authorization header using Bearer token scheme. Keys can be generated in your dashboard under Settings → API Access.

Authorization: Bearer wp_live_your_api_key_here

Base URL

All API requests should be made to the production endpoint:

https://api.wpadmin.com/v1/

Endpoints

GET /sites

Retrieve a paginated list of all WordPress sites associated with your account.

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
limitintegerNoResults per page (max: 100, default: 20)
statusstringNoFilter by status: active, paused, error
cURL
JSON Response
curl https://api.wpadmin.com/v1/sites <\\\n>   -H "Authorization: Bearer wp_live_xk92..."
{
  "data": [
    {
      "id": "site_8f7291",
      "name": "client-portfolio-wp",
      "domain": "client.example.com",
      "status": "active",
      "wp_version": "6.4.2",
      "created_at": "2024-01-15T08:30:00Z"
    }
  ],
  "meta": {
    "total": 42,
    "page": 1,
    "limit": 20
  }
}
200 OK 401 Unauthorized 400 Bad Request
POST /sites

Create a new WordPress site. This provisions a fresh installation and connects it to your management dashboard.

Request Body

FieldTypeRequiredDescription
namestringYesInternal identifier for the site
domainstringYesPrimary domain URL (e.g., example.com)
plan_idstringNoManagement plan tier (default: starter)
auto_updatesbooleanNoEnable automatic core/plugin updates
cURL
JSON Response
curl https://api.wpadmin.com/v1/sites <\\\n>   -X POST <\\\n>   -H "Authorization: Bearer wp_live_xk92..." <\\\n>   -H "Content-Type: application/json" <\\\n>   -d '{"name": "new-site", "domain": "new.example.com", "auto_updates": true}'
{
  "id": "site_9a3b12",
  "name": "new-site",
  "domain": "new.example.com",
  "status": "provisioning",
  "provisioning_eta": "2-5 minutes"
}
201 Created 400 Validation Error 401 Unauthorized
GET /sites/{id}

Retrieve detailed information about a specific site, including current security score, backup status, and performance metrics.

curl https://api.wpadmin.com/v1/sites/site_8f7291 <\\\n>   -H "Authorization: Bearer wp_live_xk92..."
{
  "id": "site_8f7291",
  "status": "active",
  "metrics": {
    "security_score": 94,
    "page_speed": 89,
    "last_backup": "2024-08-15T02:00:00Z"
  },
  "settings": {
    "wp_debug": false,
    "xml_rpc": "disabled",
    "firewall": "enabled"
  }
}
PUT /sites/{id}

Update site configuration, management preferences, or site metadata. Only provide fields you wish to change.

curl https://api.wpadmin.com/v1/sites/site_8f7291 <\\\n>   -X PUT <\\\n>   -H "Authorization: Bearer wp_live_xk92..." <\\\n>   -d '{"auto_updates": false, "backup_schedule": "weekly"}'
DELETE /sites/{id}

Permanently remove a site from your account. This action revokes API access, stops monitoring, and schedules data deletion after 30 days. This cannot be undone.

curl https://api.wpadmin.com/v1/sites/site_8f7291 <\\\n>   -X DELETE <\\\n>   -H "Authorization: Bearer wp_live_xk92..."
204 No Content 404 Not Found

Error Handling

The API uses standard HTTP status codes and returns structured error objects when requests fail. Always handle errors gracefully in your integration.

{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Domain format is invalid. Must include protocol or be a valid hostname.",
    "details": {
      "field": "domain",
      "expected": "string (valid hostname)"
    }
  }
}

Rate Limiting

API requests are limited to 600 requests per 10 minutes per API key. When you exceed this limit, you will receive a 429 Too Many Requests response. Rate limit headers are included in every response:

X-RateLimit-Limit: 600
X-RateLimit-Remaining: 423
X-RateLimit-Reset: 1723456789

SDKs & Libraries

Official client libraries are available for popular languages. Community-maintained packages are also supported:

  • npm install @wpadmin/client (Node.js)
  • pip install wpadmin-sdk (Python)
  • composer require wpadmin/php-sdk (PHP)
  • gem install wpadmin (Ruby)