If you manage multiple servers or sites, or you want to automate repetitive tasks without clicking through the dashboard, the FlyWP API (Application Programming Interface, a way for software to communicate with FlyWP) is your solution. Use it to create servers and sites, deploy, take backups, and more, all from scripts, deployment pipelines, or your own tools.
The FlyWP API is a RESTful JSON API (a standard web-based interface that uses plain HTTP requests and returns data as JSON, a widely supported text format). It covers servers, sites, domains, certificates, backups, deployments, and bulk actions. A few areas of the dashboard, such as cron jobs, databases, firewall rules, daemons, and DNS, are not in the API yet.
Base URL
Section titled “Base URL”All API requests go to:
https://api.flywp.com/v1Authentication
Section titled “Authentication”Every API request must include a Bearer token (a secret credential that proves your identity) in the Authorization header. You create tokens in your team settings. See Generating API Tokens below.
Authorization: Bearer your-api-token-hereTreat tokens like passwords. Store them in environment variables or a secrets manager, and never commit them to version control.
Choosing a Team
Section titled “Choosing a Team”Every request must also include an X-Team-Id header with the ID of the team it should act on. There is no default team. A request without this header fails with a 422 error.
X-Team-Id: your-team-idRequest Format
Section titled “Request Format”FlyWP expects and returns JSON. Include these headers with every request:
- Content-Type:
application/json - Accept:
application/json - All request bodies should be JSON-encoded
Permissions
Section titled “Permissions”A token carries a list of permissions chosen when it was created, and every endpoint asks for one of them. Calling an endpoint the token has no permission for returns 403.
| Permission | What it allows |
|---|---|
server:list | List and view servers |
server:create | Create servers |
server:update | Update servers, install the monitoring agent, change alert thresholds |
server:delete | Delete servers |
server:scale | View scale options and scale a server |
server:status | Read server metrics and alert thresholds |
server:keys:list | List a server's SSH keys |
server:keys:create | Add SSH keys |
server:keys:delete | Delete SSH keys you added |
server:keys:delete-others | Delete SSH keys other people added |
site:list | List and view sites, and read static site details |
site:create | Create sites |
site:delete | Delete sites |
site:update | Everything else under a site: domains, backups, certificates, deployments, nginx, OpenLiteSpeed, wp-config, and cloning. This includes reads. |
team:manage | Team alert thresholds, and including team or creator details in responses |
The token page also offers permissions for cron, daemons, firewall rules, supervisor, and DNS. Ticking them has no effect on the API yet.
Available Endpoints
Section titled “Available Endpoints”All paths below are relative to https://api.flywp.com/v1.
| Resource | Endpoints | Description |
|---|---|---|
| Servers | GET /servers, POST /servers, GET /servers/{id}, PUT /servers/{id}, DELETE /servers/{id} | List, create, inspect, update, and delete servers |
| Server metrics and alerts | GET /servers/{id}/metrics, POST /servers/{id}/monitoring-agent, GET /servers/{id}/alert-thresholds, PUT /servers/{id}/alert-thresholds, DELETE /servers/{id}/alert-thresholds | Read metrics, install the monitoring agent, and manage alert thresholds |
| Scaling | GET /servers/{id}/scale-options, POST /servers/{id}/scales, GET /servers/{id}/scales/{scale} | Resize a server |
| SSH Keys | GET /servers/{id}/ssh-keys, POST /servers/{id}/ssh-keys, DELETE /servers/{id}/ssh-keys/{key} | Manage SSH keys (secure login credentials) on a server |
| Team alerts | GET /team/alert-thresholds, PUT /team/alert-thresholds | Team-wide alert thresholds |
| Sites | GET /sites, POST /sites, GET /sites/{id}, DELETE /sites/{id} | List, create, inspect, and delete sites. Sites are top level, not nested under a server. |
| Site actions | POST /sites/{id}/clone, POST /sites/{id}/sleep, POST /sites/{id}/wake, POST /sites/{id}/maintenance-mode | Clone a site, put it to sleep or wake it, and toggle maintenance mode |
| Domains | GET/POST /sites/{id}/domains, PUT/DELETE /sites/{id}/domains/{domain} | Manage a site's domains |
| Certificates | GET/POST /sites/{id}/certificates, DELETE /sites/{id}/certificates/{certificate}, POST /sites/{id}/certificates/{certificate}/activate | Manage SSL certificates |
| Backups | GET /sites/{id}/backups, POST /sites/{id}/backups, DELETE /sites/{id}/backups/{backup}, POST /sites/{id}/backups/{backup}/restore | List, create, delete, and restore site backups |
| Deployments | GET /sites/{id}/deployments, POST /sites/{id}/deployments, GET /sites/{id}/deployments/{deployment} | Trigger and review Git deployments |
| Deploy key and environment | GET /sites/{id}/deploy-key, GET/PUT /sites/{id}/environment | Read the deploy key and manage environment variables |
| Configuration | GET/PUT /sites/{id}/nginx-config, GET/PUT /sites/{id}/ols-config, GET/PUT /sites/{id}/wp-config | Read and update web server and wp-config settings |
| Static sites | GET/POST/DELETE /sites/{id}/static-site, GET/POST /sites/{id}/static-site/deployments | Manage a site's static copy |
| Bulk actions | POST /bulk-actions/preview, POST /bulk-actions, GET /bulk-actions/{id}, POST /bulk-actions/{id}/cancel, POST /bulk-actions/{id}/retry | Run one action across many sites |
| Utility | GET /ping, GET /verify-api-key | Check connectivity and confirm your token works |
Asynchronous Work
Section titled “Asynchronous Work”Anything that has to reach a server, such as creating a site, adding an SSH key, or restoring a backup, returns 202 Accepted right away with the record as it stands. The work itself runs in the background. Fetch the resource again to see when it finishes.
Rate Limiting
Section titled “Rate Limiting”To keep the service stable for everyone, FlyWP limits how many API requests each token can send:
- 60 requests per minute per token
- Every response includes
X-RateLimit-LimitandX-RateLimit-Remainingheaders so your code can track usage - Going over the limit returns
429 Too Many Requestswith aRetry-Afterheader that says how long to wait
Plan Limits
Section titled “Plan Limits”Creating a server or a site is capped by your plan. If your team has reached its limit, the create request fails. See Billing.
Browsers
Section titled “Browsers”The API doesn't support CORS (cross-origin requests from a web page). Call it from a server or script, never from browser code. A bearer token shouldn't be visible in a web page.
Error Handling
Section titled “Error Handling”Every error comes back as JSON with a message. A validation error also includes an errors object keyed by field.
| Status Code | Meaning |
|---|---|
200 | Success |
201 | Resource created |
202 | Accepted. The work was queued and runs in the background |
401 | Unauthorized: invalid or missing token |
403 | Forbidden: the token lacks the required permission |
404 | Not found (including a team the token can't access) |
422 | Validation error, or a missing X-Team-Id header |
429 | Rate limit exceeded |
500 | Server error: contact support if this persists |
Generating API Tokens
Section titled “Generating API Tokens”Before you can make API calls, you need a token:
- Open Team Settings > API Tokens.
- Click Create New Token.

- Enter a name, choose the permissions, and optionally set an expiry date.
- Copy the token immediately. FlyWP only shows it once.
Creating a token requires two-factor authentication on your account. For details, see API Tokens.
Related Pages
Section titled “Related Pages”Still stuck? How can we help?
View as Markdown