API
VMs API
Create, list, start, stop, pause, resume and delete flockvm VMs over the API, read their console log, and handle each error it can answer.
The VMs of your organization, as on the dashboard's VM list. Every role can call these routes: members create and drive VMs like owners and admins. The rules are the dashboard's own, so a VM you create here is exactly the VM the New VM form would make.
The examples use $FLOCKVM_API_KEY for your API key. Each route below gives the action the key needs. A key restricted to some environments or VMs only lists and reaches those (and the VMs it created): any other VM answers 404, as if it did not exist.
The VM object
idstringThe VM's id, vm_…. Paths take it: /vms/vm_x9n9td.
namestringThe name it was created with.
statusstringstarting, running, pausing, paused, stopping, stopped or failed. See Lifecycle for what each one allows.
sizestringsmall, default, large or xlarge, with its vcpu, memory_mb and disk_gb. See Sizes.
imagestringubuntu-26.04-agent (Agent) or ubuntu-26.04 (Minimal). Runner VMs show ubuntu-26.04-runner. A VM created before 2026-11-01 keeps its Ubuntu 24.04 image id, ubuntu-24.04-agent or ubuntu-24.04, for its whole life: it is listed and works as any other, but new VMs can no longer use those ids. See Images.
regionstringgra for France, the one region today.
private_ipstring or nullThe VM's address on its own private network.
sshobjectHow to log in: the address of its region's host, the VM's own port, the login user (user on Agent, root on Minimal) and the whole command. See Connect over SSH.
created_atstringWhen it was created.
started_atstring or nullWhen its current run started. null while it is stopped.
paused_atstring or nullWhen it was paused, while it is paused.
price_hournumber or nullThe price per hour in USD, frozen when the VM was created.
seconds_billednumberThe seconds billed so far.
cost_usdnumberWhat they cost, in USD, unrounded.
errorstring or nullWhy the VM is failed, when it is.
environmentobject or nullThe environment and version the VM was created with. null for No environment.
runnerobject or null{"repo": "acme/web", "job_id": 31442100020} on a GitHub Actions runner VM. flockvm drives those: every action on them answers 409.
restrictionobject or null{"kind": "network", "reason": "…", "since": "…"} when flockvm has cut the VM's outbound network. See Acceptable use.
List VMs
GET /vms · Action: vm.read
Every VM of the organization the key reaches, newest first, whoever created it. GitHub Actions runner VMs are listed too, with runner set. Deleted VMs are not.
Create a VM
POST /vms · Action: vm.create, and ssh_key.write with "save_key": true
The VM answers starting and turns running once SSH answers. Billing starts with starting.
namestringrequired1 to 40 characters: lowercase letters, digits and dashes.
sizestringrequiredsmall, default, large or xlarge. GET /regions says which ones have room right now. See Catalog.
regionstringdefault: graLeft out, the region marked "default": true in GET /regions: France (gra), the one region today. par is refused: the Paris region was retired on 2026-11-10.
imagestringdefault: ubuntu-26.04-agentLeft out, the image marked "default": true in GET /images: the Agent image. ubuntu-26.04 for Minimal. The Ubuntu 24.04 ids are refused with a 400 that names their replacement. See Images.
ssh_key_idstringA key saved in your account, from GET /ssh-keys. Give this or ssh_public_key, not both.
ssh_public_keystringA public key, the line of your .pub file: ssh-ed25519 AAAA… you@laptop. Same formats as the dashboard: see SSH keys.
save_keybooleandefault: falseWith ssh_public_key: also save the key to your account, as the form's Save this key to my account does.
environmentstringdefault: the default environmentThe environment's id (env_…) or name, such as staging. "none" for no environment: nothing of your organization goes into the VM, only env. Left out, the organization's default environment. Every region. See Environments.
envobject of stringsVariables for this VM only, such as {"DEBUG": "1"}, merged over the environment's (the VM's value wins). Same rules and limits as the environment's variables. They still go in with "none" and with an environment that is Safe for third parties. Every region.
The same rules as the New VM form apply:
- A member can only use an environment whose Members can use it switch is on, or
"none". Otherwise:403withfieldenvironment. - The organization needs its free trial started or its plan in order: see Plan. Otherwise:
403. - During the trial, its limits apply:
smallanddefaultonly (403 trial_size_not_allowed), 2 VMs at once (429 trial_vm_limit), 5 starts a minute, 25 an hour, 75 a day (429 trial_rate_limited), 25 hours of VM time (429 trial_compute_limit_reached). - A suspended organization cannot create VMs:
403on every/vmsroute, reads included.
Wait until it is running, then SSH in
Stop waiting if status turns failed: error says why.
Several VMs at once
Send one POST /vms per VM. They start in parallel. When the host has no room left for the size, the next one answers 409 capacity: see Limits.
Get a VM
GET /vms/{id} · Action: vm.read
Answers the VM object, with its current status.
Start, stop, pause and resume
POST /vms/{id}/start, POST /vms/{id}/stop, POST /vms/{id}/pause, POST /vms/{id}/resume · Action: vm.power
| Action | Path | From | Answers | Then |
|---|---|---|---|---|
| Pause | POST /vms/{id}/pause |
running |
pausing |
paused once the memory snapshot is written (back to running if it could not be) |
| Resume | POST /vms/{id}/resume |
paused |
running |
Nothing to wait for: the answer comes once the snapshot is restored, with the same processes, IP and SSH port |
| Stop | POST /vms/{id}/stop |
starting, running, paused, failed |
stopping |
stopped, disk kept. Stopping a paused VM drops its snapshot |
| Start | POST /vms/{id}/start |
stopped, failed |
starting |
running once SSH answers: a cold boot on the same disk |
No body. The answer is the VM right after the action. Poll GET /vms/{id} to see pause, stop and start settle. An action the state does not allow answers 409 conflict:
Resume can also answer 409 conflict when the pause snapshot is missing: the VM is then stopped with its disk intact, and start boots it again (its memory state is lost).
Start, resume and pause can answer 409 capacity, without field, when the host has no room right now: not enough memory or vCPU to start or resume the VM, or not enough disk for the memory snapshot of a pause. Try again later, or pause or stop another VM first.
Start and resume need the free trial started or the plan in order, like creating a VM: otherwise 403. During the trial they count as starts, with the same limits as creating. Pause and stop don't. What each action keeps and costs: Lifecycle.
Delete a VM
DELETE /vms/{id} · Action: vm.delete-own for a VM this key created, vm.delete for any VM
A key with Create and use VMs (vm.delete-own) deletes only the VMs it created itself: any other VM answers 403 insufficient_scope with field vm.delete.
Deletes the VM in any state, with its disk and its pause snapshot (a runner VM answers 409: flockvm deletes it when its job ends). There is no undo and no backup: see Deleting a VM deletes its data.
Console log
GET /vms/{id}/logs · Action: vm.logs
The last lines of the VM's serial console, oldest first: what the Console section of the VM page shows. tail is how many, from 1 to 1000 (200 when left out). See Monitoring.
Errors
| Status | code |
Example message |
When |
|---|---|---|---|
| 400 | bad_request |
"Name: 1 to 40 characters, lowercase letters, digits and dashes." (field: name) |
A field is missing, of the wrong type, or breaks a rule. field names it. |
| 400 | bad_request |
"Unknown field "colour". Fields: name, size, region, image, ssh_key_id, ssh_public_key, save_key, environment, env." | A field the API does not know. |
| 400 | bad_request |
"Give ssh_key_id (a key saved in your account, GET /api/v1/ssh-keys) or ssh_public_key." | No SSH key, or both. |
| 400 | bad_request |
"Pick a size." (field: size), "Pick a region.", "Pick an image." |
A size, region or image that is not offered to your organization. |
| 400 | bad_request |
"ubuntu-24.04 (Ubuntu 24.04) is no longer offered for new VMs: use ubuntu-26.04. VMs created from it keep their image." (field: image) |
An Ubuntu 24.04 image id: ubuntu-24.04-agent becomes ubuntu-26.04-agent, ubuntu-24.04 becomes ubuntu-26.04. |
| 400 | bad_request |
"tail: a whole number from 1 to 1000." (field: tail) |
tail out of range. |
| 401 | unauthorized |
"This API key was revoked." | See Errors. |
| 403 | insufficient_scope |
"This API key cannot create VMs: it needs vm.create." (field: vm.create) |
The key's actions do not cover the route. field is the action it needs. See API keys and scopes. |
| 403 | forbidden |
Create with a key restricted to environments, without one of them in environment. |
|
| 403 | forbidden |
"Only owners and admins can create VMs with the environment staging. Pass another one open to members, or "none" for no environment." (field: environment) |
A member and an environment not open to members, named or the default one. |
| 403 | forbidden |
"Start the 7-day free trial or the plan in Settings › Billing to create or start VMs. Card required, nothing charged for 7 days, then $18/month, which comes back as $18 of VM time." | Create, start or resume without the free trial started or the plan in order, or with no money left. The exact message follows the billing state. |
| 403 | forbidden |
"This organization is suspended. Contact the flockvm team." | The organization is suspended. |
| 403 | trial_size_not_allowed |
Create during the free trial with large or xlarge. |
|
| 404 | not_found |
"No VM with this id." | No such VM, a malformed id, a VM of another organization, or one the key's restrictions do not reach, for a read as for an action. |
| 404 | not_found |
"This SSH key is not in your account." (field: ssh_key_id) |
A saved key that is not yours. |
| 404 | not_found |
"No environment with this id or name in this organization (GET /api/v1/environments)." (field: environment) |
An unknown environment. |
| 404 | not_found |
"No such action: POST /api/v1/vms/{id}/start|stop|pause|resume." | Any other action. |
| 409 | conflict |
"cannot pause a VM that is stopped" | The state does not allow the action. |
| 409 | conflict |
"This VM runs a CI job: flockvm deletes it when the job ends." | An action on a GitHub Actions runner VM. |
| 409 | capacity |
"Not enough room on this host for large: it needs 16384 MB RAM and 8 vCPU, 11544 MB and 0 vCPU are free." (field: size) |
Create: the region has no room for this size now. Try a smaller size, or later. |
| 409 | capacity |
"not enough memory on this host: 4096 MiB needed, 2048 MiB free for VMs" | Start, resume or pause: the host has no room for this VM (or for its memory snapshot) now. No field. Try later, or pause or stop another VM. |
| 429 | trial_vm_limit |
Create, start or resume during the free trial with 2 VMs already running or starting, CI runner VMs included. | |
| 429 | trial_rate_limited |
Create, start or resume during the free trial, past 5 starts in a minute, 25 in an hour or 75 in a day. | |
| 429 | trial_compute_limit_reached |
Create, start or resume during the free trial once its 25 hours of VM time are used. | |
| 503 | unavailable |
The host or the billing did not answer. Try again. |
Every create, action and delete is in the audit log (vm.created, vm.paused…), with the key that made it.
Next steps
The regions, sizes and images to create with.
What every new VM starts with.
What pause, stop and delete keep and cost.
~/.ssh/config, file copies, port forwarding.