/v1/vms/{uid}/appsPublishes a port on the VM at its own HTTPS URL, https://<port>-<vm-host-label>.<domain>.
The app starts as pending and becomes ready once the route is live.
Each VM can expose a given port once, and app names (after slugging) must be unique per VM.
This is asynchronous. It returns 202 Accepted with an operation_id. See
Get an operation. Send an X-Idempotency key to make
retries safe: a retry with the same key returns the original operation and its app with
200, instead of 409 for the name or port that the first request already took.
The key is tied to the VM and the app name (or port-<port> when no name is given).
Reusing it on another VM or for another name returns 409 with
action: idempotency_key_reused.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe VM's uid.
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
portintegerRequiredPort on the VM that the app listens on.
min 1 · max 65535
namestringName for the exposure. It is converted to a slug (lowercase letters, digits and hyphens), which must be 40 characters or fewer. Defaults to port-<port>.
max length 40
protocolstringBackend protocol. Use grpc for gRPC (HTTP/2) services.
Default httpOne ofhttpgrpc
Response
The expose operation was queued.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringRequiredUID of the queued operation. Poll it with Get an operation.
vm_uidstringRequiredUID of the VM.
vm_namestringRequiredName of the VM.
appobjectRequiredThe app exposure. On a replay, its current state, or only uid, vm_uid and name if it has been removed.
Show attributesHide attributes
uidstringRequiredUnique identifier of the app exposure.
vm_uidstringRequiredUID of the VM.
namestringRequiredName of the exposure (stored in slug form).
slugstringRequiredIdentifier used in the unexpose path.
statusstringRequiredpending while the route is being created, ready when live, deleting while being removed, failed if provisioning failed.
One ofpendingreadydeletingfailed
portintegerRequiredPort on the VM that the URL forwards to.
protocolstringRequiredBackend protocol.
One ofhttpgrpc
hostnamestringRequiredPublic hostname of the exposure.
urlstringRequiredPublic HTTPS URL of the exposure.
last_failurestringReason for the last failure. Omitted when there is none.
created_atstring (date-time)RequiredWhen the exposure was created.
statusstringRequiredStatus of the operation.
One ofqueuedrunningsucceededfailed
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 or an in-flight removal.
is_completedbooleanRequiredtrue when a returned existing operation has already finished.
Response
Replay. The X-Idempotency key was already used to expose an app, so that operation is returned and nothing is queued. app is the app's current state. If the app has since been removed, app holds only its uid, vm_uid and name.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
operation_idstringRequiredUID of the queued operation. Poll it with Get an operation.
vm_uidstringRequiredUID of the VM.
vm_namestringRequiredName of the VM.
appobjectRequiredThe app exposure. On a replay, its current state, or only uid, vm_uid and name if it has been removed.
Show attributesHide attributes
uidstringRequiredUnique identifier of the app exposure.
vm_uidstringRequiredUID of the VM.
namestringRequiredName of the exposure (stored in slug form).
slugstringRequiredIdentifier used in the unexpose path.
statusstringRequiredpending while the route is being created, ready when live, deleting while being removed, failed if provisioning failed.
One ofpendingreadydeletingfailed
portintegerRequiredPort on the VM that the URL forwards to.
protocolstringRequiredBackend protocol.
One ofhttpgrpc
hostnamestringRequiredPublic hostname of the exposure.
urlstringRequiredPublic HTTPS URL of the exposure.
last_failurestringReason for the last failure. Omitted when there is none.
created_atstring (date-time)RequiredWhen the exposure was created.
statusstringRequiredStatus of the operation.
One ofqueuedrunningsucceededfailed
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 or an in-flight removal.
is_completedbooleanRequiredtrue when a returned existing operation has already finished.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed: invalid request (missing or zero port), port must be between 1 and 65535, protocol must be http or grpc, name is invalid, or name must be 40 characters or fewer. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
409 | Conflict: app exposure name already exists for this vm, app exposure port already exists for this vm, vm is not available for app exposure (VM deleting or deleted), http access is not configured, or the X-Idempotency key was used for a different operation (action: idempotency_key_reused). |
Errors use the standard error format.