Webdock API1.1.6
The Webdock API is an HTTP API served by the Webdock backend. It is a versatile API with the goal of enabling you to orchestrate and automate servers in your Webdock account. Over time our objective is to provide all of the functionality of the Webdock dashboard in our API. If you are missing some specific functionality, please let us know as this helps us prioritize future API work.
Help & Documentation
Besides the main API specification here, you can find additional examples and tutorials on the Webdock website. If you discover a problem with our API, please be in touch with Webdock support at support@webdock.io
SDK Libraries
On the Webdock Github page you can find our officially supported API wrappers and tools. To get quickly started, check out our "Infrastructure as code" Webdock-CLI tool which is useful for scripts and even has an interactive mode.
| Language | Download |
|---|---|
| Webdock-CLI | Github |
| Python | Github |
| PHP | Github |
| NodeJS/Typescript | Github |
Authentication
Start with obtaining an API token in your Webdock account with the permissions you need. Next you simply pass the API token using the standard Authorization Bearer HTTP header method. For example using wget in a terminal:
# wget --method GET --timeout=0 --header 'Authorization: Bearer c3770736449ad85de9df27b1432845792345b47dfe8e77c7fdfae0525308b1c7' 'https://api.webdock.io/v1/ping'Callbacks & Events
Almost everything in the Webdock API is asynchronous. Meaning, for most operations you need to subscribe to callbacks using the /hooks endpoint or poll for updates using the /events endpoint. All endpoints that return a callbackID will return a HTTP 202 Accepted code and a X-Callback-ID header which you can then subscribe to or poll for.
Endpoints which are asynchronous in nature are flagged with the
label in their description and show the X-Callback-ID header in the example responses.
Make sure to check the final result to any asynchronous operation and do not rely solely on the initial HTTP success return code.
If you subscribe to a callback by ID, we will delete the hook automatically once the callback has been made to your callbackUrl. You can only have 20 active hooks at any one time.
Some Events are Chained
Some events, such as Provisioning, may consist of a sequence - or chain - of events that depend on one another. In the case of provisioning a LAMP or LEMP server for example, an event is triggered once the server has been created in order to run Let's Encrypt Certbot on the server and generate an SSL certificate. For this reason, such operations, when triggered, will return the last callbackId in the event chain in the X-Callback-ID header. In this fashion, when polling for Events, by checking for the callbackID returned in the X-Callback-ID header you will know when the entire sequence is complete and it is safe to move on to subsequent operations.
If an operation triggers such a sequence, you will get a X-Callback-Sequence header returned which consists of an array listing all the callbackId's the entire operation is depending on in order to run to completion.
If you plan on relying on callbacks you should take this into account and it is generally advisable to poll for events if you trigger operations via. the API. This is due to the fact that if a sequence item anywhere in the event chain fails, all subsequent events will simply be marked with the error status and no callback will be made for these.
Rate Limiting
The Webdock API is rate limited to 5000 requests per hour per Webdock Account. Meaning, even if you have multiple API tokens in your account, all your API tokens will share this rate limit. All requests made to the Webdock API will receive headers in the response indicating your current rate limit status:
| Header Name | Description |
|---|---|
X-RateLimit-Limit | The maximum number of requests you're permitted to make per hour. |
X-RateLimit-Remaining | The number of requests remaining in the current rate limit window. |
X-RateLimit-Reset | The time at which the current rate limit window resets in UTC epoch seconds. |
When unauthenticated and hitting the public API methods you are limited to 500 requests/hour
Errors
The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:
{
"id": 0,
"message": "Invalid locationId",
"logId": "7DA9C91F-EC69-42B4-90B8-CD31B81D4A79"
}You can always view a complete history of all API calls including the request and response as seen on our end in your Webdock account. This can be very useful when debugging your API implementation.
If you want the API log to identify your application you can set the X-Application header, for example: X-Application: MyApp/v1.00 and this will show up in the API logs.
Versioning
Here we list the Webdock API versions and any relevant changes. The current API version is backwards compatible all the way to v1.0.
| API version | API spec | Changes |
|---|---|---|
| 1.1.6 (in-progress) | 1.1.6 | - Added the ability to manage Load Balancers and WAFs <br>- Virtual Private Cloud customers can now assign multiple IP addresses to a server, choose its primary IP and set reverse DNS per IP with GET/PATCH /servers/{serverSlug}/ips. <br>- Breaking: POST /servers/{serverSlug}/actions/changeIp (changeServerIp) has been removed; use PATCH /servers/{serverSlug}/ips to change the primary IP (add an IP with primary=true and remove the old one, or set primaryIpId) <br>- Get instance metrics with no more than a 20-second delay and much finer sampling resolution. Access a wider range of metrics and more detailed queries through our monitoring API, plus warning flags for OOM kills, network errors, and dropped packets. <br>- Added Cloudflare zone management to the API. <br>- Added full mail functionality to the API for qualifying servers. You can now set up transactional emailing or email forwarding. <br>- Added full Cronjob management ability and pause/unpause cronjob functionality <br>- Added a new Archived Servers section: GET /servers/archived and GET /servers/archived/{archivedServerId} list archived servers, and DELETE /servers/archived/{archivedServerId} permanently removes an archive <br>- createServer now accepts archivedServerId (from GET /servers/archived) to restore an archived server; the selected profile must provide at least the archive's requiredDiskMiB of disk when that value is not null <br>- Breaking: GET /servers/snapshots no longer lists archived servers (type=archived); use GET /servers/archived <br>- Added the Ability to enable/disable FTP and manage FTP users on LAMP/LEMP stacks <br>- Added the ability to manage MySQL databases on LAMP/LEMP stacks through the API <br>- Deprecated the server actions endpoints for snapshots. These now live under /servers/{serverSlug}/snapshots and /servers/{serverSlug}/snapshots/restore <br>- Deprecated the old "suspend" endpoint for archived servers and renamed it to /servers/{serverSlug}/actions/archive <br>- Expanded on API endpoint descriptions and DTOs for consumption by AI Agents (broad MCP server compatibility) <br>- Expanded the price fields for profiles as well as a new struct indicating if any free services are included with said profile. |
| 1.1.5 | 1.1.5 | - Added the ability to fully control Server Monitoring rules (PING and HTTP network monitoring checks) <br>- Added the ability to fully control Wordpress with the API, deploy WP-CLI, install, lock down, update etc. <br>- Added the ability to toggle whether the server should be stopped when nearing its bandwidth allowance.<br> - Added the ability to control VPS Server placement affinity on our infrastructure in the new PATCH /account/accountInformation endpoint.<br>- Introduced a new /servers/metrics/warnings endpoint which gives you an overview of which servers are nearing utilization limits or are nearing critical state with regards to resource consumption. This struct is also returned in the per-server metrics endpoints in resourceUsageStatus. Fully backwards compatible.<br>- You can now pass an event callbackid to /events (errors only) and ask for an AI explanation of the error. You should poll /events for the final result (AI generation is a long running operation) |
| 1.1.4 | 1.1.4 | - Added the ability to enable and query MariaDB database backups-on-disk.<br> - Added the ability to run Test Certbot Renewal direct on the SSL Certificates screen and in the API (LAMP/LEMP Stacks only)<br> - Added the ability to block and unblock search engines with a robots.txt (LAMP/LEMP Stacks only)<br> - You can now set and unset basic auth for any website URL/path (LAMP/LEMP Stacks only) |
| 1.1.3 | 1.1.3 | - Added the ability to reset passwords for known Shell Users. <br>- Added the ability to enable and disable IPV6 in a VPS |
| 1.1.2 | 1.1.2 | Added the ability to list valid IP prefixes/ranges for any VPS server, as well as ability to change Server IP addresses using the API. Gated behind special permisson key and only valid for Enterprise and Private Cloud customers. |
| 1.1.1 | 1.1.1 | Maintenance release: <br>- PATCH /servers/{serverSlug}/identity now returns the normalized standard Server model DTO (matching GET /servers/{serverSlug});<br>- The Server model DTO now contains the following new fields: metadata, services, secondary_ips, lastchecked, imageData and profileData while preserving existing legacy fields for backward compatibility. <br>- Server struct now returns a pendingDeletion flag to indicate if the server has been cancelled and is pending deletion on subscription expiry. <br>- Profile information now includes Network bandwidth allowance in Gbit/s<br>- Public endpoints are now cached better and are rate limited to 500 reqs/hour |
| 1.1.0 | 1.1.0 | - Fully implemented Custom Profiles in our API. You can now create custom profiles on the fly! <br>- You can now query possible platform variants and resource limits (useful for Custom Profiles)<br>- Profile details now include a platform field, indicating which hardware platform the profile belongs to.<br>- WebSSH Token endpoint now returns a fully qualified URL you can use to access WebSSH.<br>- Archived Server snapshots can now be listed in GET /servers/snapshots<br>- You can now deploy Library scripts by ID directly to a server<br>- You can now reference script by a slug handle, to make things easier on humans doing a manual deploy, e.g. through Terraform<br>- Added ability to cancel scheduled deletion for a server<br>- You can now set the Web Root for a server, with optional webserver and Let's Encrypt config update.<br>- Added the ability to set Server Identity via. the API including removing the default Webdock aliasdomain<br>- Added the ability to regenerate SSL Certificates with Certbot for any of your defined main/aliasdomains<br>- Get Locations, Images, Platforms and Profiles no longer require an auth token and can be queried without authentication (useful for listing possible resources e.g. for Terraform) |
| 1.0.4 | 1.0.4 | Added ability to include a specific profile slug in /profiles including custom profiles, in order to fetch all profile information. User account information now includes refer-a-friend code and URL. |
| 1.0.3 | 1.0.3 | Removed ability to create container VPS unless it's from a container VPS snapshot, in which case that virt type is auto selected. |
| 1.0.2 | 1.0.2 | Added ability to access WebSSH using a short-lived token. |
| 1.0.1 | 1.0.1 | Added KVM virtualization and virt type to snapshot endpoints. Fully backwards compatible. |
| 1.0.0 | 1.0.0 | Initial Release |
All requests use this base URL:
https://api.webdock.io/v1Webdock API parameters
curl --request GET \
--url https://api.webdock.io/v1/ping \
--header 'Authorization: Bearer <token>'Still need help? Share an idea