/v1/vmsQueues a new VM and returns 202 Accepted with the operation_id of the create operation.
The VM starts in provisioning. Poll Get an operation
or Get a VM to see when it is running.
X-Idempotency is optional but recommended. If you repeat a request with the same key and
the same name, you get the original operation back with 200 OK and
X-Idempotency-Replay: true, and nothing new is queued. The replay check runs after the
basic field checks (required fields, SSH keys, zone) but before the billing, plan, image,
quota and name checks, so a retry after the VM was created still returns the original
operation.
Reusing the key with a different name returns 409 with action: idempotency_key_reused.
Without a key, every request queues a new VM.
Things to know:
- You must accept the acceptable use policy before creating your first VM. Until then this
endpoint returns
428withaction: accept_acceptable_use_policy. - Provide
image_slug, orsnapshot_uidto create the VM from a snapshot. A VM created from a snapshot uses the snapshot's image and login user and is always persistent. - New VMs from an image log in as
root. - If the plan is ephemeral-eligible, the VM is ephemeral even when
ephemeralisfalse. Ephemeral VMs expire after the plan'sdefault_runtime_mins(72 hours if the plan sets none). Each account can have one active ephemeral VM. - Desktop images need a plan with at least 2 vCPU and 2048 MiB of memory.
- The VM gets an HTTPS app URL that forwards to port
8080by default. Change it with Set the VM app port. - VM names must be unique in the workspace. Uniqueness is checked on the slug of the name,
so
Web 1andweb-1clash.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
X-IdempotencystringOptional unique key for this request, such as a UUID. Leading and trailing spaces are
ignored. If you send a key you already used for the same action on the same resource, the
original operation is returned with 200 OK and X-Idempotency-Replay: true, and nothing
new is queued. The replay check runs before the resource is loaded or its state is
checked, so a retry gets the original result even after the action has finished. Reusing a
key for a different action, resource type or resource returns 409 with
action: idempotency_key_reused. Keys are shared across the workspace. Without a key,
every request is treated as new.
Request body
namestringRequiredDisplay name of the VM. Leading and trailing spaces are trimmed. Its slug must be unique among the workspace's VMs.
plan_slugstringRequiredSlug of a compute plan from List plans. Case-insensitive.
image_slugstringSlug of an image from List images. Required unless snapshot_uid is set, and ignored when it is.
vpc_slugstringRequiredSlug of the VPC to attach the VM to. Use default for the platform's default private network.
zone_slugstringZone to run the VM in. Defaults to olas-closet, currently the only zone.
Default olas-closet
ssh_key_uidsarray of stringsRequiredUIDs of SSH keys to install on the VM. At least one is required. Each key must be yours or belong to the workspace.
ephemeralbooleanRequest a short-lived ephemeral VM. Only allowed on ephemeral-eligible plans. On those plans the VM is ephemeral whatever you send. Ignored when snapshot_uid is set.
Default false
snapshot_uidstringUID of an available snapshot in this workspace to create the VM from. When set, image_slug is not needed.
startup_scriptstringOptional shell script to run on the VM's first boot.
Response
The create operation was queued.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringRequiredUID of the create operation. Poll it with Get an operation.
vm_uidstringRequiredUID of the new VM.
namestringRequiredName of the VM.
statusstringRequiredStatus of the create operation. queued for a newly queued VM.
One ofqueuedrunningsucceededfailed
vm_statusstringRequiredStatus of the VM (see VmStatus). provisioning for a newly queued VM. On a replay,
the VM's current status, or deleted once it is gone. Empty in the rare case the VM
could not be read during a replay.
events_urlstringRequiredPath of the server-sent events stream with the operation's progress.
is_replaybooleanRequiredtrue when an existing operation was returned for a reused X-Idempotency key.
is_completedbooleanRequiredtrue when a replayed operation has already finished.
Response
Replay. The X-Idempotency key was already used to create a VM with this name, so the existing operation is returned and nothing is queued. status is the operation's current status and vm_status the VM's current status (deleted once the VM is gone).
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringRequiredUID of the create operation. Poll it with Get an operation.
vm_uidstringRequiredUID of the new VM.
namestringRequiredName of the VM.
statusstringRequiredStatus of the create operation. queued for a newly queued VM.
One ofqueuedrunningsucceededfailed
vm_statusstringRequiredStatus of the VM (see VmStatus). provisioning for a newly queued VM. On a replay,
the VM's current status, or deleted once it is gone. Empty in the rare case the VM
could not be read during a replay.
events_urlstringRequiredPath of the server-sent events stream with the operation's progress.
is_replaybooleanRequiredtrue when an existing operation was returned for a reused X-Idempotency key.
is_completedbooleanRequiredtrue when a replayed operation has already finished.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed. Possible messages: invalid request (malformed JSON), name, plan_slug, and vpc_slug are required, image_slug is required, at least one ssh key is required, invalid zone, invalid compute plan, this compute plan is not available, invalid image, invalid snapshot, snapshot source image is unavailable, selected plan is not eligible for ephemeral compute, invalid ssh key, invalid vpc, or the desktop plan-size message. |
401 | The API key is missing, invalid, expired or revoked. |
402 | The account is past due and cannot create new paid resources. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
409 | Conflict: A VM with this name already exists., ephemeral compute limit reached, snapshot is not ready to restore, or the X-Idempotency key was already used for a different operation (action: idempotency_key_reused). |
428 | You have not accepted the acceptable use policy yet. |
Errors use the standard error format.