Long-running actions
Restarts, reinstalls, plan changes and new servers answer an action at once; how to follow one to its final state, and how to read a password once.
Some work takes longer than a request should wait: a restart, a reinstall, a plan change, a termination, a new server. These answer at once with an action, and the work carries on in the background. You follow the action until it reaches a final state.
Service actions answer 202 with the action. A new order answers 201, with
one provision action for each server it creates.
An action's states
| Status | Meaning | Final |
|---|---|---|
queued | Recorded, not sent yet. A new Dedicated server or proxy waits here for our team, which can take hours. A paid plan change waits here until it is applied. | no |
running | Sent; waiting for the server to show the result. | no |
succeeded | Confirmed by the server's state. | yes |
failed | Refused or failed. failure.code says why. | yes |
unknown | The result was not confirmed within the action's window. Check the service. | yes |
The windows, after which a running action becomes unknown:
| Action | Window |
|---|---|
| Boot, shut down, restart, power off | 2 minutes |
| Reset the root password | 2 minutes |
| Terminate | 10 minutes (the server is then deleted at the service's deletesAt) |
| Reinstall | 30 minutes |
| Provision a VPS | 2 hours |
| Provision a Dedicated server or a proxy | none: it waits for our team |
| Plan change | none while queued; it runs once it is applied |
A VPS gets the memory and disk of a new plan at its next power cycle.
failure.code is one of platform_refused, platform_unavailable,
provisioning_failed, order_rejected, order_cancelled or service_locked.
Follow an action
Read it back by its id, at most once every 2 seconds, until its status is final:
GET/actions/{actionId}Reference
curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a \
-H "Authorization: Bearer $CLOUDUXE_API_KEY"import { Clouduxe } from "@clouduxe/sdk";
const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });
const action = await cx.actions.get("f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a");import os
import requests
res = requests.get(
"https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a",
headers={
"Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
},
)
action = res.json()<?php
require 'vendor/autoload.php';
$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);
$action = $cx->actions->get('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a');const res = await fetch("https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", {
headers: {
Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
},
});
const action = await res.json();{
"object": "action",
"id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a",
"type": "restart",
"status": "succeeded",
"serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
"orderId": null,
"invoiceId": null,
"failure": null,
"secretAvailable": false,
"secretExpiresAt": null,
"createdAt": "2026-12-04T09:20:11Z",
"startedAt": "2026-12-04T09:20:11Z",
"completedAt": "2026-12-04T09:20:39Z",
"livemode": true
}Other responses
400Bad requestversion_invalid
{
"error": {
"type": "invalid_request_error",
"code": "version_invalid",
"message": "Clouduxe-Version does not name an API version.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#version_invalid"
}
}401Unauthorizedtoken_missing, token_invalid, token_expired, token_revoked
{
"error": {
"type": "authentication_error",
"code": "token_missing",
"message": "No API token was sent. Send it as Authorization: Bearer <token>.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#token_missing"
}
}Also answered with this status: token_invalid, token_expired, token_revoked.
403Forbiddenip_not_allowed, api_access_disabled, scope_missing
{
"error": {
"type": "permission_error",
"code": "ip_not_allowed",
"message": "This request came from an address outside the token's IP allowlist.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#ip_not_allowed"
}
}Also answered with this status: api_access_disabled, scope_missing.
404Not foundnot_found
{
"error": {
"type": "not_found_error",
"code": "not_found",
"message": "No such object, or it is not visible to this token.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#not_found"
}
}429Too many requestsrate_limited
{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#rate_limited"
}
}500Server errorinternal_error
{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred. It has been logged with this request id.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#internal_error"
}
}503Unavailableunavailable
{
"error": {
"type": "api_error",
"code": "unavailable",
"message": "The API is briefly unavailable.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#unavailable"
}
}Or list a service's actions:
GET/services/{serviceId}/actionsReference
curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/actions \
-H "Authorization: Bearer $CLOUDUXE_API_KEY"import { Clouduxe } from "@clouduxe/sdk";
const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });
for await (const action of cx.services.listActions("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) {
console.log(action.id);
}import os
import requests
res = requests.get(
"https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/actions",
headers={
"Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
},
)
page = res.json()<?php
require 'vendor/autoload.php';
$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);
foreach ($cx->services->listActions('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $action) {
echo $action->id, PHP_EOL;
}const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/actions", {
headers: {
Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
},
});
const page = await res.json();Instead of polling, you can listen for the action.completed webhook, which
carries the action in its final state; see Webhooks. The SDKs
also have waitForAction, which polls every 2 seconds and returns the final
state.
One-time secrets
Some actions set a server password:
- provisioning a VPS without SSH keys, or with a Windows image;
- reinstalling without SSH keys, or with Windows;
- resetting the root password with
delivery: "api".
No write ever answers that password. When the action succeeds, it carries
secretAvailable: true, and you read the password from the action:
GET/actions/{actionId}/secretReference
curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret \
-H "Authorization: Bearer $CLOUDUXE_API_KEY"import { Clouduxe } from "@clouduxe/sdk";
const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });
const actionSecret = await cx.actions.getSecret("f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a");import os
import requests
res = requests.get(
"https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret",
headers={
"Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
},
)
actionSecret = res.json()<?php
require 'vendor/autoload.php';
$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);
$actionSecret = $cx->actions->getSecret('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a');const res = await fetch("https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret", {
headers: {
Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
},
});
const actionSecret = await res.json();{
"object": "action_secret",
"actionId": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a",
"kind": "server_password",
"username": "root",
"password": "hV4qW9zL2mRt8KxP",
"readsLeft": 4,
"expiresAt": "2026-12-04T10:20:39Z"
}Other responses
400Bad requestversion_invalid
{
"error": {
"type": "invalid_request_error",
"code": "version_invalid",
"message": "Clouduxe-Version does not name an API version.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#version_invalid"
}
}401Unauthorizedtoken_missing, token_invalid, token_expired, token_revoked
{
"error": {
"type": "authentication_error",
"code": "token_missing",
"message": "No API token was sent. Send it as Authorization: Bearer <token>.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#token_missing"
}
}Also answered with this status: token_invalid, token_expired, token_revoked.
403Forbiddenforbidden, ip_not_allowed, api_access_disabled, scope_missing
{
"error": {
"type": "permission_error",
"code": "forbidden",
"message": "Your role on this service does not allow this action.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#forbidden"
}
}Also answered with this status: ip_not_allowed, api_access_disabled, scope_missing.
404Not foundnot_found
{
"error": {
"type": "not_found_error",
"code": "not_found",
"message": "No such object, or it is not visible to this token.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#not_found"
}
}410Gonesecret_unavailable
{
"error": {
"type": "conflict_error",
"code": "secret_unavailable",
"message": "This action's secret was deleted, has expired, was read 5 times, or never existed.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#secret_unavailable"
}
}429Too many requestsrate_limited
{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#rate_limited"
}
}500Server errorinternal_error
{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred. It has been logged with this request id.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#internal_error"
}
}503Unavailableunavailable
{
"error": {
"type": "api_error",
"code": "unavailable",
"message": "The API is briefly unavailable.",
"param": null,
"requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c",
"docUrl": "https://docs.clouduxe.com/api/errors#unavailable"
}
}- Only an owner's token can read it.
- You can read it up to 5 times, so a retry after a lost answer still works,
until it expires 60 minutes after the action succeeded. Every read is audited.
After that it answers
410secret_unavailable, which is final. - As soon as you have stored it, delete it, so it can never be read again:
DEL/actions/{actionId}/secretReference
curl -X DELETE https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret \
-H "Authorization: Bearer $CLOUDUXE_API_KEY" \
-H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f"import { Clouduxe } from "@clouduxe/sdk";
const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });
const action = await cx.actions.deleteSecret("f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a");import os
import requests
res = requests.delete(
"https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret",
headers={
"Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
"Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f",
},
)
action = res.json()<?php
require 'vendor/autoload.php';
$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);
$action = $cx->actions->deleteSecret('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a');const res = await fetch("https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
"Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f",
},
});
const action = await res.json();