Skip to content

POST /api/vms/{id}/shutdown

Updated

Stop a VM and tear down its running host resources.

PropertyValue
Scopereadwrite
Request bodynone
Success204 No Content

Endpoint

POST ${baseUrl}/api/vms/${id}/shutdown
readwrite

Stop a VM and tear down its running host resources.

Use your host URL and API key as shell variables:

baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"

cURL template

curl --request POST "${baseUrl}/api/vms/${id}/shutdown" \
  --header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
LocationNameTypeRequiredDescription
HeaderAuthorizationbearer tokenyesBearer ${VIRT_AGENT_API_KEY} from a readwrite key.
PathidstringyesVM id.
StatusBodyDescription
204 No ContentnoneShutdown completed at the host API layer.
Terminal window
baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"
id="demo-api-vm"
curl --request POST "${baseUrl}/api/vms/${id}/shutdown" \
--header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
HTTP/1.1 204 No Content
StatusCodeDescription
401UNAUTHORIZEDAPI key is missing or invalid.
403FORBIDDENKey is read-only or endpoint is outside the key allowlist.
404NOT_FOUNDVM id does not exist.
409INVALID_STATEVM state does not allow shutdown.
500CH_ERROR, STORAGE_ERROR, or INTERNALHost failed to stop or clean up VM resources.