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.
Cancel a backup
POST /api/v1/sites/{id}/backups/{backupId}
Content-Type: application/json
{ "action": "cancel" }Stops a queued or running backup. Deleting backups isn't available over the API, so a leaked token can't remove a site's recovery path; delete them in the dashboard.
Backup schedule
POST /api/v1/sites/{id}/backup-schedule
Content-Type: application/json
{ "schedule": "daily", "hour": 3, "timezone": "America/New_York", "keep": 14 }Every field is optional; ones you leave out keep their current value
(GET /sites/{id} shows backup_schedule, backup_hour and timezone).
schedule is off, daily or weekly; keep is how many recent backups to
keep (0 keeps all). Each change is written to the site's activity log.
Actions
Run a command against a site.
POST /api/v1/sites/{id}/actions
Content-Type: application/json
{ "action": "update", "plugins": ["akismet/akismet.php"], "themes": ["twentytwentyfive"], "core": true }action | Effect | Scope |
|---|---|---|
ping | Signed liveness check of the connector | read |
update | Update plugins[] (each by its plugin file as the inventory lists it), themes[] (by folder) and/or WordPress core (core: true); at least one. Locked items are skipped. Returns result.jobId to poll | write |
login | Return a one-click admin login URL | write |
Plugins and themes
POST /api/v1/sites/{id}/plugins
{ "action": "activate", "slugs": ["akismet/akismet.php"] }action is activate, deactivate or install (WordPress.org slugs,
installed but not activated). Each plugin reports its own result.
POST /api/v1/sites/{id}/themes
{ "action": "install", "slugs": ["twentytwentyfive"] }
{ "action": "activate", "slugs": ["twentytwentyfive"] }activate switches the active theme and takes exactly one slug.
Roll back a plugin
GET /api/v1/sites/{id}/plugins/versions?slug=woocommerce
POST /api/v1/sites/{id}/rollback
{ "slug": "woocommerce", "version": "9.4.0", "backup_first": true }The versions call lists WordPress.org releases the plugin can go back to
(available: false for premium or custom plugins). Rollback installs that
release and returns a job_id.
Lock an item against updates
POST /api/v1/sites/{id}/locks
{ "kind": "plugin", "slug": "akismet/akismet.php", "reason": "Custom patch" }Every update path skips a locked item, and it can't be rolled back. The API can
add locks but not remove them: a lock is a person's guard rail on automation,
so unlocking stays in the dashboard. Current locks are in the inventory's
locked list.
All of these require the write scope and return a job_id to poll while the
site works.
Scans
POST /api/v1/sites/{id}/scan
{ "type": "security" }type | What it does | Returns |
|---|---|---|
security | Vulnerability scan plus the hardening checklist | job_id |
performance | One page-load and database timing sample | the sample |
links | Broken-link scan of recent content | job_id |
updates | Ask the site to re-check for updates | update counts |
domain | Domain, SSL and email health check | issue count |
server | Server health: disk, PHP, OPcache, scheduled tasks, caching (connector 0.10.0+) | the fresh summary |
database | Database health: size, largest tables, autoload, clutter (connector 0.10.0+) | the fresh summary |
Requires the write scope. Each type runs at most once per site in a window:
10 minutes for security, 5 for performance, updates, server and
database, 15 for links and domain. The server and database window
is shared with the dashboard's Scan buttons. A repeat inside it gets 429
with a Retry-After header and retry_after (seconds) in the body. A request that's refused or queued
doesn't use up the window.
Domain health
GET /api/v1/domain
GET /api/v1/sites/{id}/domainThe fleet call lists every site whose last check found a domain, SSL or email problem; the site call returns its full checklist.
Reports
List reports
GET /api/v1/sites/{id}/reports?kind=site&limit=50Saved reports, newest first, each with a url that opens it in the
dashboard, plus each kind's schedule. kind is site (the client maintenance
report), security or performance; leave it out for all three. Kinds turned
off for the site are left out.
Generate a report
POST /api/v1/sites/{id}/reports
{ "kind": "site", "period_days": 30 }Builds and saves one report now. period_days (7, 30 or 90) applies to site
reports only. The report is saved, not emailed or shared; send it to a client
from the dashboard. Each kind can be generated once per site every 10 minutes
over the API (429 with Retry-After otherwise).
Report schedule
POST /api/v1/sites/{id}/report-schedule
{ "kind": "security", "schedule": "weekly", "hour": 7, "day": 1 }Security and performance reports run off, daily, weekly or monthly;
site reports run off, weekly, monthly or quarterly. day is the
weekday for weekly (0 is Sunday) or the day of the month; month (1 to 3)
picks the month of the quarter. Fields you leave out keep their current value.
A timezone here is the site's, so it also moves the backup window.
Visual checks
GET /api/v1/sites/{id}/visual?limit=10
GET /api/v1/sites/{id}/visual/{checkId}Results of the site's visual checks: screenshots of key pages taken before and
after an update and compared. The list returns recent checks, newest first,
each with its trigger (manual, bulk or autopilot), status
(capturing_before, ready while the update runs, capturing_after, then
done, failed or canceled), and once done a verdict (pass, changed
or error) and a one-line summary. recheck is true for the screenshots
Autopilot takes after rolling an update back, compared with the original
"before" shots to confirm the site looks as it did. One check returns
every page and viewport, worst first, with diff_fraction (the share of the
page's content that changed) and before_url, after_url and diff_url.
Image links last 10 minutes, so fetch the check again for fresh ones; they're
null once the images pass their 30-day retention. Visual checks are started
from the dashboard or by Autopilot, not over the API.
Server and database health
GET /api/v1/sites/{id}/server
GET /api/v1/sites/{id}/databaseThe site's latest server and database scans, as on its Server and Database
pages. Server covers disk space (and what's using it), the PHP version and when
its security support ends, OPcache, scheduled tasks and caching, each with a
level of ok, warn, bad or unknown. Database covers total size, the
largest tables and the plugin that owns each, autoloaded options, and what could
be cleaned up per category. Both read the last scan (scannedAt) and never
contact the site; scanned is false when there isn't one yet (sites need
connector 0.10.0 or newer).
Store card-testing health
GET /api/v1/sites/{id}/store
GET /api/v1/storesA WooCommerce store's latest card-testing scan, as on its Store page: a level
of ok, warn, bad (a likely attack) or unknown, with the reasons, failed
orders in the last few hours against the store's own normal, failed and paid
orders in the last day, addresses with repeated failed orders, new accounts that
never ordered, declined-card notes, and how exposed the checkout is (account
sign-up, the saved-card page, express payment buttons, protection plugins).
/stores lists every store with its level, worst first. Both read the last scan
(stores are scanned every 30 minutes) and never contact the site; scanned is
false when there isn't one yet (sites need connector 0.13.0 or newer).
Clean up a database
POST /api/v1/sites/{id}/database/cleanup
{ "categories": ["revisions", "spam_comments", "expired_transients"], "keep_revisions": 5, "backup_first": true }Permanently deletes clutter in the background (connector 0.11.0 or newer).
Categories: revisions (keeping the newest keep_revisions per post, default
5), auto_drafts, trashed_posts, spam_comments, trashed_comments,
expired_transients, orphan_postmeta, orphan_commentmeta and
action_scheduler (finished background-task logs older than 30 days).
backup_first defaults to true: the database is backed up first and nothing
is deleted until that backup is stored. Returns 202 with a job_id to poll
with GET /api/v1/jobs/{id}; the finished job's result has the count removed
per category. Needs a write token, and runs once per site per 10 minutes.
Site settings
GET /api/v1/sites/{id}/settings
POST /api/v1/sites/{id}/settings
{ "name": "Acme Store", "features": { "links": false, "white_label": true } }Rename a site and turn features on or off, as on its Settings page. A feature that is off has no scans, alerts or data for the site. Needs a workspace token with the write scope; agent tokens are refused. Each change is in the activity log.
Ignored issues
GET /api/v1/sites/{id}/ignore?kind=security
POST /api/v1/sites/{id}/ignore
{ "action": "ignore", "kind": "security", "title": "Default \"wp_\" database table prefix" }Hide a known, accepted issue so scans, reports and alerts stop raising it, or
bring it back with "action": "unignore". Identify the issue by its kind:
kind | Field | Where to find it |
|---|---|---|
errors | key | GET /sites/{id}/errors |
links | url | target_url in GET /sites/{id}/links |
security | title | GET /sites/{id}/security |
domain | check | the check id in GET /sites/{id}/domain |
Ignoring checks that the issue is currently reported, so a typo isn't saved. Ignored items are left out of the error, link and security lists. Approval-only agents can't ignore issues.
Connector
POST /api/v1/sites/{id}/connector
{ "action": "update" }Installs the latest FleetWP connector on the site. Refused while a restore is running. Needs a workspace token with the write scope; agent tokens are refused.
Activity
GET /api/v1/activity?limit=50Returns recent workspace activity. limit defaults to 50 (capped). Add
site_id (or call GET /api/v1/sites/:id/activity) for one site.
Log activity
Record maintenance done outside FleetWP, by hand in wp-admin, over SSH, or by an agent working elsewhere, so it shows in the site's timeline and its maintenance reports. Requires the write scope.
POST /api/v1/sites/:id/activity{
"summary": "Cleared spam comments and optimized the database",
"notes": "Removed 4,200 spam comments; ran OPTIMIZE on wp_options.",
"category": "maintenance",
"performed_at": "2026-10-01T14:30:00Z",
"performed_by": "Mike",
"internal": false
}| Field | Notes |
|---|---|
summary | Required. One line, up to 200 characters. Shown in the timeline and reports. |
notes | Optional detail, up to 2,000 characters. Never shown in client reports. |
category | maintenance (default), update, fix, security, performance, content, backup, other |
performed_at | When the work happened. Defaults to now; up to 180 days back. |
performed_by | Who did it, useful when several people or agents share one token. |
internal | true keeps the entry out of client reports. |
Returns 201 with the created entry. Logging is a record, not a change to
the site, so an agent with approval-only access writes it directly, but its
entries are always saved as internal. An owner or admin reviews them on the
Activity page and chooses Show in reports to include one in client reports.
Errors
| Status | Meaning |
|---|---|
202 | Accepted. With "status": "queued", an approval-only agent's request is waiting for a person to approve it |
400 | Invalid payload |
401 | Missing or invalid token |
403 | Token lacks the required scope |
404 | Site not found in this workspace |
429 | The same scan or report ran on this site moments ago; wait Retry-After seconds |
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"