Developers
REST API
HTTP endpoints under /api/v1 for sites, backups, actions, and activity.
All endpoints are relative to ${FLEETWP_URL}/api/v1 and require a Bearer token
(see Authentication). Responses are JSON.
Sites
List sites
GET /api/v1/sitesReturns every site in the workspace.
Get a site
GET /api/v1/sites/{id}Backups
List a site's backups
GET /api/v1/sites/{id}/backupsEach backup includes id, type, status, size_bytes, created_at,
completed_at, and error.
Create a backup
POST /api/v1/sites/{id}/backups
Content-Type: application/json
{ "type": "full" }type is one of full (default), db, or files. Requires the write scope.
Actions
Run a command against a site.
POST /api/v1/sites/{id}/actions
Content-Type: application/json
{ "action": "update", "plugins": ["akismet", "woocommerce"] }action | Effect | Scope |
|---|---|---|
ping | Signed liveness check of the connector | read |
update | Apply updates (optionally limited to plugins[]) | write |
login | Return a one-click admin login URL | write |
Activity
GET /api/v1/activity?limit=50Returns recent workspace activity. limit defaults to 50 (capped).
Errors
| Status | Meaning |
|---|---|
400 | Invalid payload |
401 | Missing or invalid token |
403 | Token lacks the required scope |
404 | Site not found in this workspace |
Example
# Trigger a database backup, then poll the backups list
curl -s -X POST "$FLEETWP_URL/api/v1/sites/$SITE/backups" \
-H "Authorization: Bearer $FLEETWP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type":"db"}'
curl -s "$FLEETWP_URL/api/v1/sites/$SITE/backups" \
-H "Authorization: Bearer $FLEETWP_TOKEN"