# Overview and quickstart > What the Clouduxe API does and the rules every request follows, then your first call and a VPS restart in three steps. Source: https://docs.clouduxe.com/api/ The Clouduxe API lets your own code run your Clouduxe services: order, manage and automate VPS, Dedicated servers and the DDoS-protected proxy without the panel. It speaks JSON over HTTPS, and every request goes to one base URL, which holds the major version: `https://api.clouduxe.com/v1` ## The rules every request follows | What | How it works | | --- | --- | | **Tokens** | A bearer token in the `Authorization` header. Live tokens start with `cxk_live_`. Each token belongs to one account and carries only the scopes you gave it. | | **Names and ids** | Fields and parameters are camelCase. Ids are opaque UUIDs, and every object says what it is in `object`. | | **Lists** | Cursor pagination: a page says whether another follows in `hasMore`, and hands you `nextCursor` to fetch it. | | **Errors** | One error shape, with a stable `code`, a `type` to group it and a `requestId` to quote to support. | | **Writes** | Writes need an `Idempotency-Key`, so a retry never runs the same write twice. The reference shows the header on every operation that takes it. | | **Rate limits** | Every response carries `RateLimit-*` headers for the limit nearest to running out. | | **Long-running work** | A restart, a reinstall or a new server does not hold your request open: you get an action back at once and read it until it finishes. | | **Versions** | The path holds the major version, `/v1`, and nothing in `/v1` is ever removed or renamed: new fields, endpoints and event types only. You do not need a version header. To pin a dated version anyway, send `Clouduxe-Version: 2026-12-01`; without it, the token's own version is used. | ## Quickstart: restart a VPS in three steps The three steps below are a complete program: find a VPS, restart it, and see the restart finish. Every request on this page switches between curl, the Node and PHP SDKs, Python and plain `fetch`, and remembers the one you pick. ### Step 1: Create a token and keep it out of your code Tokens are made only in the panel, at [API tokens](https://dash.clouduxe.com/account/api-tokens), never through the API. Making one asks you to confirm it is you (a passkey, or an email code from the last 10 minutes), and the token is shown once, so copy it then. For this quickstart, give it `services:read` and `services:write`. Put the token in an environment variable. Every example in these docs reads it from `CLOUDUXE_API_KEY`, so you can paste them as they are. ```bash export CLOUDUXE_API_KEY="cxk_live_..." ``` ### Step 2: Make your first call List your services. The answer is one page of them; note the `id` of the VPS you want to restart. `GET /services` (reference: https://docs.clouduxe.com/api/reference/services/list-services/) ```bash curl https://api.clouduxe.com/v1/services \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```json { "object": "list", "data": [ { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true }, { "object": "service", "id": "4e9b2d7a-1c6f-4b3e-a8d2-7f5c0e9a1b4d", "type": "dedicated", "status": "provisioning", "suspensionReason": null, "deletesAt": null, "planId": "dedicated-e5-64-limburg", "planName": "Dedicated E5 64 GB", "region": "limburg", "label": "db-primary", "reference": "client-4471", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 1149900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "unknown", "hostname": "db1.acme.example", "ipv4": [], "ipv6": [], "image": null, "resources": null, "statusUpdatedAt": null, "stale": false }, "proxy": null, "createdAt": "2026-12-03T14:40:05Z", "livemode": true }, { "object": "service", "id": "a7d4c1e9-3f2b-4d8a-9c6e-0b5a2f7d3e1c", "type": "proxy", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "proxy-game-standard", "planName": "Protected Proxy Standard", "region": null, "label": "game-proxy", "reference": "client-5102", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 249900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": null, "proxy": { "profile": "fivem", "ports": [ { "protocol": "tcp", "portStart": 30120, "portEnd": 30120 }, { "protocol": "udp", "portStart": 30120, "portEnd": 30120 } ] }, "createdAt": "2026-11-28T11:02:19Z", "livemode": true } ], "hasMore": true, "nextCursor": "eyJsIjoic2VydmljZXMiLCJjIjoiMjAyNi0xMi0wNFQwOToxNToyMloifQ.x7Hq2N" } ``` ### Step 3: Restart the VPS, then read the action Send the restart. The API answers straight away with an action, and the restart carries on in the background. `POST /services/{serviceId}/power` (reference: https://docs.clouduxe.com/api/reference/server-actions/power-service/) ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/power \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"action":"restart"}' ``` ##### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "restart", "status": "running", "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": null, "livemode": true } ``` Read the action back by its `id` until its `status` is terminal: `succeeded`, `failed` or `unknown`. Poll at most once every 2 seconds. `GET /actions/{actionId}` (reference: https://docs.clouduxe.com/api/reference/server-actions/get-action/) ```bash curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```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 } ``` ## What happened on the wire Two kinds of request did the work: one that started the restart and one that asked how it was going. The request that starts the work never waits for it, so a slow restart cannot time out your code. *Figure: The power request answers at once with an action, and the restart runs on our side while your code is free. Reading the action back shows where it is; the same action id ties the two calls together.* > **If the network drops mid-request:** Send the same request again with the same `Idempotency-Key`. If the first one > went through, you get its stored answer back, marked > `Idempotent-Replayed: true`, and the restart happened once. The SDKs make the key and reuse it on > their retries for you. ## Where to go next - [Services reference](https://docs.clouduxe.com/api/reference/services/): Every field of a service and every endpoint that acts on one. - [Build with AI](https://docs.clouduxe.com/api/build-with-ai/): Ready-made prompts for provisioning, syncing and webhooks, and how to give an AI these docs. --- # Authentication and scopes > How a request proves who sent it, how to make an API token in the panel, and which scope each operation needs. Source: https://docs.clouduxe.com/api/authentication/ Every request carries an API token. The token belongs to one account and carries a set of scopes, and each operation needs one scope. Tokens are made only in the panel, never through the API, so a stolen token can never mint a wider or longer-lived one. ## Send the token Put the token in the `Authorization` header with the `Bearer` scheme: ```bash curl https://api.clouduxe.com/v1/api-tokens/current \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Any other scheme, a token in the query string or a token in a cookie is refused with `401` [`token_missing`](https://docs.clouduxe.com/api/errors/#token_missing). The API speaks HTTPS only. A request over plain HTTP is refused at the edge with no redirect, so a token sent that way never reaches the API, but it did cross the network in clear: treat it as leaked and revoke it. A token is `cxk_live_` followed by 46 letters and digits. ## Make a token ### Step 1: Open API tokens in the panel Go to [API tokens](https://dash.clouduxe.com/account/api-tokens) in the panel. The same page lists your webhook endpoints beside your tokens. ### Step 2: Confirm it is you Making a token needs a fresh confirmation: a passkey, or an email code entered in the last 10 minutes. ### Step 3: Choose its scopes, expiry and addresses Give it only the scopes your code needs (the table below lists what each one opens). Choose an expiry of 7, 30, 90 or 365 days, or none; the panel suggests 90 days. A token that holds an elevated scope always expires, at most 365 days after it was made. Optionally, limit it to up to 20 IPv4 or IPv6 addresses or ranges. A request from anywhere else is refused with `403` [`ip_not_allowed`](https://docs.clouduxe.com/api/errors/#ip_not_allowed), and the token's creator gets one email a day for each new address. ### Step 4: Copy it once The token is shown once, when it is made. Store it in your secret manager or an environment variable right away. The account owner gets an email naming the token, who made it, its scopes and its expiry, but never the token itself. A token's scopes cannot be changed after it is made: make a new token instead. Each person can hold up to 25 tokens per account. A token also keeps the API version that was current when it was made; see [Versioning and changelog](https://docs.clouduxe.com/api/changelog/). ## Scopes Each operation in the reference names the scope it needs. A token without that scope gets `403` [`scope_missing`](https://docs.clouduxe.com/api/errors/#scope_missing). This is every scope in the contract, with the operations it opens: - `account:read`: Get your account - `api_tokens:read`: List API tokens; Get an API token - `api_tokens:write`: Revoke an API token - `billing:read`: List invoices; Get an invoice; Get an invoice PDF link; Get your wallet; List wallet transactions - `firewall:read`: Get a firewall; List firewall presets - `firewall:write`: Turn protection on or off; Set the default policy; Add a firewall rule; Update a firewall rule; Delete a firewall rule; Block an address; Unblock an address; Trust an address; Untrust an address; Apply a firewall preset - `orders:read`: Preview an order; List orders; Get an order - `orders:write`: Create an order; Update an order; Retrieve an action's secret; Delete an action's secret - `protection:read`: Get protection status; List attacks; Get an attack - `services:destructive`: Reinstall a server; Reset a server's password; Terminate a service; Retrieve an action's secret; Delete an action's secret - `services:lifecycle`: Change a service's plan; Set cancellation at period end - `services:read`: List services; Get a service; List a server's OS images; Get a service's traffic; List plan change options; List a service's actions; Get an action - `services:write`: Update a service; Run a power action - `ssh_keys:read`: List SSH keys; Get an SSH key - `ssh_keys:write`: Add an SSH key; Update an SSH key; Delete an SSH key - `tickets:read`: List support departments; List tickets; Get a ticket; Get an attachment - `tickets:write`: Open a ticket; Reply to a ticket; Close a ticket; Start an attachment upload; Finish an attachment upload - `webhooks:read`: List webhook endpoints; Get a webhook endpoint; Get a webhook delivery; List events; Get an event - `webhooks:write`: Create a webhook endpoint; Update a webhook endpoint; Delete a webhook endpoint; Rotate a webhook secret; Send a test event; Redeliver an event - No scope: List plans; Get a plan; List regions; Get the current token Some scopes are elevated: `services:lifecycle`, `services:destructive`, `ssh_keys:write`, `orders:write`, `webhooks:write` and `api_tokens:write`. They move money, destroy data, send account data to a URL or revoke access, so the panel flags them and the creation email names them. > **Prices need orders:read:** Listing plans and regions needs a valid token and no scope, but plan prices are > answered only to a token with `orders:read`. Any other token sees each price as > `null`, with `unpricedReason` set to `no-access`. ## Tokens made by delegates If you work on an account as a delegate, the panel offers only the scopes your role can use there: | Role | Scopes offered | | --- | --- | | **Owner** | Every scope. | | **Admin** and **Operator** | `services:read`, `services:write`, `firewall:read`, `firewall:write` and `services:destructive`. | | **Viewer** | `services:read` and `firewall:read`. | For a delegate, `services:destructive` covers reinstalling only, and a delegate's reinstall takes no SSH keys; a root password reset or a termination answers `403` [`forbidden`](https://docs.clouduxe.com/api/errors/#forbidden). On every request, a token can do only what both its scopes and its person's current role allow. A role change takes effect on the next request, and removing a member revokes that person's tokens on the account. ## Check and revoke a token Any token can read itself, with no scope: `GET /api-tokens/current` (reference: https://docs.clouduxe.com/api/reference/api-tokens/get-current-api-token/) ```bash curl https://api.clouduxe.com/v1/api-tokens/current \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": null, "revokedReason": null, "livemode": true } ``` Revoking takes effect at once, from the panel or with the API. Revoking the token that makes the request needs no scope; revoking any other token needs `api_tokens:write`. A revoked token answers `401` [`token_revoked`](https://docs.clouduxe.com/api/errors/#token_revoked), and an expired one `401` [`token_expired`](https://docs.clouduxe.com/api/errors/#token_expired). `DELETE /api-tokens/{tokenId}` (reference: https://docs.clouduxe.com/api/reference/api-tokens/revoke-api-token/) ```bash curl -X DELETE https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` ##### Response (`200`) ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": "2026-12-04T10:05:00Z", "revokedReason": "user", "livemode": true } ``` --- # Errors > The one shape every error takes, how to branch on it, and every error code the API can answer with what to do about each. Source: https://docs.clouduxe.com/api/errors/ Every failed request answers with the same shape, whatever went wrong. Your code branches on `code`, which never changes for a condition; `message` is for a person to read and can be reworded. ## The error object ```json { "error": { "type": "invalid_request_error", "code": "parameter_invalid", "message": "A field has the wrong type or is out of range.", "param": "items[0].hostname", "requestId": "8f14e45f-ceea-467a-9f2b-1c3d5e7a9b0c", "docUrl": "https://docs.clouduxe.com/api/errors#parameter_invalid" } } ``` | Field | What it is | | --- | --- | | `type` | The group the code belongs to. The SDKs raise one error class per type. | | `code` | The stable, machine-readable reason. Branch on this. | | `message` | A fixed sentence for a person. It never repeats your request back. | | `param` | The field the error is about, as a path into your request, or `null`. | | `requestId` | The same value as the `X-Request-Id` header, which every response carries. Quote it to support. | | `docUrl` | A link to this code's entry below. | ## Types and statuses | Type | Status | | --- | --- | | `authentication_error` | 401 | | `permission_error` | 403 | | `invalid_request_error` | 400, 405, 413, 415 and 422 | | `not_found_error` | 404 | | `conflict_error` | 409, 410 and 423 | | `payment_error` | 402 | | `idempotency_error` | the status its code lists below | | `rate_limit_error` | 429 | | `api_error` | 500 and 503 | An object outside your token's account answers exactly as an unknown id does, `404` [`not_found`](#not_found), so ids from other accounts cannot be probed. A response you should retry carries `Retry-After`, in seconds. A `429` also carries the `RateLimit-*` headers; see [Rate limits](https://docs.clouduxe.com/api/rate-limits/). ## Every error code The full catalogue, generated from the API contract. Each code links here from the `docUrl` of its error. | Code | Status | Type | Meaning | What to do | | --- | --- | --- | --- | --- | | `account_closed` | 409 | conflict_error | This account is closed. | No action is possible on a closed account. | | `action_limit_reached` | 429 | rate_limit_error | This service has reached its limit for this action. | Retry after Retry-After seconds. | | `actions_unavailable` | 503 | api_error | Server actions are paused for a moment. | Retry after Retry-After seconds. | | `api_access_disabled` | 403 | permission_error | API access is paused for this account. | Contact support. | | `api_ordering_disabled` | 403 | permission_error | Ordering through the API is switched off for this account. | The account owner can switch it on in the panel, under API settings. | | `attachment_unavailable` | 422 | invalid_request_error | An attachment is not uploaded, not yours, or already used. | Upload the file again and pass the new attachmentId. | | `billing_currency_unknown` | 422 | invalid_request_error | The account has no billing currency yet. | Add a billing address in the panel. | | `cancellation_final` | 409 | conflict_error | The paid period has ended, so the cancellation can no longer be undone. | Order a new service if you need one. | | `confirmation_mismatch` | 422 | invalid_request_error | confirm must equal the service's id. | Send the service's own id in confirm. | | `coupon_exhausted` | 409 | conflict_error | This coupon has no uses left. | Order again without couponCode. | | `coupon_invalid` | 422 | invalid_request_error | This coupon does not exist or does not apply to this order. | Remove or change couponCode. | | `credit_currency_mismatch` | 402 | payment_error | The wallet holds no credit in this order's currency. Credit is never converted. | Add credit in the order's currency in the panel. | | `currency_not_offered` | 409 | conflict_error | The target plan is not offered in this service's currency. | Open a support ticket. | | `cursor_invalid` | 400 | invalid_request_error | The cursor is malformed, has expired, or belongs to a list with other filters. | Start the list again without a cursor. | | `cycle_unavailable` | 422 | invalid_request_error | This plan has no orderable price for that billing cycle. | Pick one of the plan's cycles. | | `department_unavailable` | 422 | invalid_request_error | This support department is not available. | Use a department from GET /v1/support/departments. | | `files_unavailable` | 503 | api_error | File storage could not be reached. | Retry shortly. | | `firewall_not_available` | 409 | conflict_error | Protection is not set up for this server yet. | Retry later, or contact support. | | `firewall_preset_covered` | 409 | conflict_error | Every rule of this preset is already covered. | No action is needed. | | `firewall_preset_unavailable` | 422 | invalid_request_error | No such firewall preset is available. | Use a preset from GET /v1/firewall-presets. | | `firewall_resetting` | 423 | conflict_error | This address recently changed hands, and its firewall is being reset. | Retry in a few minutes. | | `firewall_rule_exists` | 409 | conflict_error | A rule with this protocol and first port already exists. | Edit it instead. | | `firewall_rule_limit` | 422 | invalid_request_error | This server already has 15 firewall rules. | Remove or merge rules first. | | `firewall_rule_overlap` | 409 | conflict_error | The rule's ports overlap another rule of the same protocol. | Edit the existing rule instead. | | `firewall_value_refused` | 422 | invalid_request_error | The protection service refused one of the rule's values. | Check the rule's limits in the reference. | | `firewall_would_block_all` | 409 | conflict_error | This change would leave no enabled rule while the default policy denies, which blocks every port. | Enable another rule first, or set the default policy to allow. | | `forbidden` | 403 | permission_error | Your role on this service does not allow this action. | Ask the account owner for access, or use the owner's token. | | `hostname_invalid` | 422 | invalid_request_error | The hostname must be a valid DNS name of at most 253 characters. | Send DNS labels of letters, digits and hyphens joined by dots. | | `idempotency_in_progress` | 409 | idempotency_error | A request with this Idempotency-Key is still running. | Retry after Retry-After seconds with the same key. | | `idempotency_key_invalid` | 400 | idempotency_error | Idempotency-Key must be 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen. | Use a UUID. | | `idempotency_key_required` | 400 | idempotency_error | This request needs an Idempotency-Key header. | Send a new unique key, such as a UUID, for each logical request. | | `idempotency_mismatch` | 422 | idempotency_error | This Idempotency-Key was already used with a different request. | Use a new key for a new request. | | `image_unavailable` | 422 | invalid_request_error | This OS image is not offered here. | Use an image from the plan's orderForm, or from GET /v1/services/{serviceId}/images. | | `insufficient_credit` | 402 | payment_error | Wallet credit in the order's currency does not cover the total. Nothing was ordered. | Add credit in the panel, then try again. | | `internal_error` | 500 | api_error | An unexpected error occurred. It has been logged with this request id. | Retry once. If it repeats, contact support with the requestId. | | `invalid_json` | 400 | invalid_request_error | The request body is not valid JSON. | Send a JSON body. | | `ip_address_invalid` | 422 | invalid_request_error | Send one IPv4 address. | Send a single dotted IPv4 address. | | `ip_already_listed` | 409 | conflict_error | That address is already on this list. | No action is needed, or remove it first to change it. | | `ip_is_infrastructure` | 422 | invalid_request_error | That address serves this server's protection and cannot be blocked or removed. | No action is possible for this address. | | `ip_is_own_address` | 422 | invalid_request_error | That is this server's own address. | Do not block your own server. | | `ip_not_allowed` | 403 | permission_error | This request came from an address outside the token's IP allowlist. | Call from an allowed address, or change the allowlist in the panel. | | `ip_range_unsupported` | 422 | invalid_request_error | Address ranges are not supported here. Send one IPv4 address. | Send single addresses. | | `limits_unavailable` | 503 | api_error | Rate limits could not be checked, so the change was refused. | Retry shortly. | | `maintenance` | 503 | api_error | This kind of change is paused for maintenance. Reads still work. | Retry after Retry-After seconds. | | `metadata_invalid` | 400 | invalid_request_error | metadata takes at most 20 keys of up to 40 characters, each with a string value of up to 500 characters. | Fix the keys or values. | | `method_not_allowed` | 405 | invalid_request_error | This path does not take this HTTP method. | Check the method in the reference. | | `not_found` | 404 | not_found_error | No such object, or it is not visible to this token. | Check the id, and that the token belongs to the right account. | | `option_invalid` | 422 | invalid_request_error | An option is missing, unknown, or not offered on this plan. | Use the option groups in the plan's orderForm. | | `order_limit_reached` | 429 | rate_limit_error | This account has ordered its hourly maximum of services. | Retry after Retry-After seconds, or ask support to raise the limit. | | `orders_unavailable` | 503 | api_error | Ordering is paused for a moment. Nothing was ordered. | Retry after Retry-After seconds. | | `origin_invalid` | 422 | invalid_request_error | The proxy origin must be one of this account's own servers. | Send a service id, or an IPv4 address of one of your servers. | | `out_of_stock` | 409 | conflict_error | This plan is sold out. | Pick another plan or region, or try again later. | | `outcome_unknown` | 503 | api_error | The request may or may not have taken effect. | Retry with the same Idempotency-Key: the retry answers what happened, or does it once. | | `parameter_invalid` | 400 | invalid_request_error | A field has the wrong type or is out of range. | Fix the field named in param. The reference gives each field's rules. | | `parameter_missing` | 400 | invalid_request_error | A required field is missing. | Send the field named in param. | | `parameter_unknown` | 400 | invalid_request_error | The request has a field this operation does not take. | Remove the field named in param. | | `plan_change_not_allowed` | 422 | invalid_request_error | This plan is not an allowed change for this service. | Pick a plan from GET /v1/services/{serviceId}/plan-options. | | `plan_change_open` | 409 | conflict_error | A plan change for this service is already paid and waiting to be applied. | Wait for its plan_change action to finish. | | `plan_change_too_soon` | 409 | conflict_error | This service had a plan change request in the last 10 minutes. | Retry after Retry-After seconds. | | `plan_change_unavailable` | 503 | api_error | Plan changes for this service are paused for a moment. Nothing was changed. | Retry after Retry-After seconds. | | `plan_unavailable` | 422 | invalid_request_error | This plan cannot be ordered. | Pick a plan from GET /v1/plans. | | `platform_unavailable` | 503 | api_error | The server platform could not be reached. Nothing was changed. | Retry shortly. | | `previous_change_pending` | 409 | conflict_error | An earlier plan change is waiting for the server's next power cycle. | Restart the server, wait for the change to apply, then try again. | | `protection_not_available` | 409 | conflict_error | This service has no protection data to show: it is not a protected server, or protection is not set up yet. | For a protected proxy, ask support. Otherwise retry once the service is active. | | `quote_incomplete` | 422 | invalid_request_error | The price cannot be fixed until the account's billing details are complete. | Complete the billing address (for an Indian account, its GST state) in the panel. | | `rate_limited` | 429 | rate_limit_error | Too many requests. | Retry after Retry-After seconds. The RateLimit headers show the window. | | `reinstall_in_doubt` | 409 | conflict_error | A recent reinstall's outcome is unknown, so another is refused for up to 15 minutes. | Check the server, then retry after Retry-After seconds. | | `renewal_in_progress` | 409 | conflict_error | A renewal for the next period is already paid, so the plan cannot change through the API. | Open a support ticket. | | `request_too_large` | 413 | invalid_request_error | The request body is larger than 1 MiB. | Send a smaller body. Upload files through createAttachment. | | `scope_missing` | 403 | permission_error | This API token does not have the scope this operation needs. | Make a token with the scope named in the reference for this operation. | | `secret_unavailable` | 410 | conflict_error | This action's secret was deleted, has expired, was read 5 times, or never existed. | This is final: do not retry. Reset the password again with delivery api and retrieve it within 60 minutes. | | `service_building` | 409 | conflict_error | A build or reinstall is running on this server. | Wait for its action to finish. | | `service_ended` | 409 | conflict_error | This service has ended, so its cancellation cannot change. | No action is possible on an ended service. | | `service_locked` | 423 | conflict_error | This service is suspended, cancelled or terminated. | Pay any overdue invoice, or contact support. | | `service_not_ready` | 409 | conflict_error | This service is still being set up. | Wait for the service.provisioned event, then retry. | | `service_unconfirmed` | 423 | conflict_error | Actions on this server are paused while its ownership is re-checked. | Retry later, or contact support. | | `ssh_key_invalid` | 422 | invalid_request_error | The public key is not one accepted OpenSSH public key line. | Send ssh-ed25519, ecdsa-sha2-nistp256, -nistp384 or -nistp521, or ssh-rsa of at least 2048 bits. | | `ssh_key_unknown` | 422 | invalid_request_error | An SSH key id is not in this account's key library. | Use ids from GET /v1/ssh-keys. | | `ssh_keys_not_allowed` | 403 | permission_error | Only the account owner can pass SSH keys to a reinstall. | Reinstall without sshKeyIds, or use the owner's token. | | `termination_pending` | 409 | conflict_error | This service is already being terminated. | No action is needed. | | `terms_outdated` | 409 | conflict_error | Updated terms of service must be accepted before ordering. | The account owner accepts them in the panel. | | `ticket_closed` | 409 | conflict_error | This ticket is closed. | Open a new ticket. | | `token_expired` | 401 | authentication_error | The API token has expired. | Make a new token in the panel. | | `token_invalid` | 401 | authentication_error | The API token is not valid. | Check the token, or make a new one in the panel. | | `token_missing` | 401 | authentication_error | No API token was sent. Send it as Authorization: Bearer . | Send your token in the Authorization header. | | `token_revoked` | 401 | authentication_error | The API token was revoked. | Make a new token. If you did not revoke it, review your account's security log. | | `too_many_ssh_keys` | 422 | invalid_request_error | Too many SSH keys for one request. | Send at most 10 key ids. | | `unavailable` | 503 | api_error | The API is briefly unavailable. | Retry after Retry-After seconds. | | `unsupported_media_type` | 415 | invalid_request_error | The request body must be application/json. | Send Content-Type: application/json. | | `version_invalid` | 400 | invalid_request_error | Clouduxe-Version does not name an API version. | Send a version listed in the changelog, or omit the header to use your token's version. | | `webhook_endpoint_limit` | 409 | conflict_error | This account already has 10 webhook endpoints. | Delete an endpoint you no longer use. | | `webhook_url_refused` | 422 | invalid_request_error | The webhook URL must be https on port 443 or 8443, with a public DNS name that is not a Clouduxe host. | Use a public https URL on your own domain. | --- # Pagination > How lists come back one page at a time, how to follow the cursor to the end, and what makes a cursor stop working. Source: https://docs.clouduxe.com/api/pagination/ Every list in the API answers one page at a time and hands you a cursor for the next page. Lists page by keyset, not by offset, so a page never skips or repeats an object, even while objects are added. ## Ask for a page Two query parameters control a page: | Parameter | What it does | | --- | --- | | `limit` | How many objects one page holds: 1 to 100, 20 when you leave it out. | | `cursor` | The `nextCursor` of the page before. Leave it out for the first page. | `GET /services` (reference: https://docs.clouduxe.com/api/reference/services/list-services/) ```bash curl https://api.clouduxe.com/v1/services \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```json { "object": "list", "data": [ { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true }, { "object": "service", "id": "4e9b2d7a-1c6f-4b3e-a8d2-7f5c0e9a1b4d", "type": "dedicated", "status": "provisioning", "suspensionReason": null, "deletesAt": null, "planId": "dedicated-e5-64-limburg", "planName": "Dedicated E5 64 GB", "region": "limburg", "label": "db-primary", "reference": "client-4471", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 1149900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "unknown", "hostname": "db1.acme.example", "ipv4": [], "ipv6": [], "image": null, "resources": null, "statusUpdatedAt": null, "stale": false }, "proxy": null, "createdAt": "2026-12-03T14:40:05Z", "livemode": true }, { "object": "service", "id": "a7d4c1e9-3f2b-4d8a-9c6e-0b5a2f7d3e1c", "type": "proxy", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "proxy-game-standard", "planName": "Protected Proxy Standard", "region": null, "label": "game-proxy", "reference": "client-5102", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 249900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": null, "proxy": { "profile": "fivem", "ports": [ { "protocol": "tcp", "portStart": 30120, "portEnd": 30120 }, { "protocol": "udp", "portStart": 30120, "portEnd": 30120 } ] }, "createdAt": "2026-11-28T11:02:19Z", "livemode": true } ], "hasMore": true, "nextCursor": "eyJsIjoic2VydmljZXMiLCJjIjoiMjAyNi0xMi0wNFQwOToxNToyMloifQ.x7Hq2N" } ``` ## Read the page A page is a list object: | Field | What it holds | | --- | --- | | `object` | Always `list`. | | `data` | The objects on this page. | | `hasMore` | Whether another page follows. | | `nextCursor` | The cursor for the next page, or `null` when `hasMore` is `false`. | ## Walk every page Keep asking with the last `nextCursor` until `hasMore` is `false`. At 100 objects a page, the read limit lets one token list about 2,000 objects a second. ```js let cursor; do { const url = new URL("https://api.clouduxe.com/v1/services"); url.searchParams.set("limit", "100"); if (cursor) url.searchParams.set("cursor", cursor); const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}` }, }); const page = await res.json(); for (const service of page.data) console.log(service.id); cursor = page.hasMore ? page.nextCursor : undefined; } while (cursor); ``` The Node and PHP SDKs do this for you: their list methods return an iterator that fetches each page as you reach it. ## When a cursor stops working A cursor is opaque: do not build or change one. It is tied to the list's filters and your token's account, and it lasts 24 hours. Using it with other filters, from another account or after it expires answers `400` [`cursor_invalid`](https://docs.clouduxe.com/api/errors/#cursor_invalid). Start the list again without a cursor. --- # Idempotency > Why every write carries an Idempotency-Key, what happens when you send one again, and how secrets are kept out of a replay. Source: https://docs.clouduxe.com/api/idempotency/ A network can drop the answer to a request that did go through. If you simply send it again, a server restarts twice or an order is placed twice. An `Idempotency-Key` makes the retry safe: the API recognises the key, and the write happens once. ## Send a key with every write Every `POST`, `PUT`, `PATCH` and `DELETE` needs an `Idempotency-Key` header. The one exception is previewing an order, which writes nothing. The reference shows the header on each operation that takes it; a write without one answers `400` [`idempotency_key_required`](https://docs.clouduxe.com/api/errors/#idempotency_key_required). The key is 1 to 128 characters of letters, digits, `_`, `.`, `:` and `-`. Make a new UUID for each logical request, and send the same one when you retry that request. `POST /services/{serviceId}/power` (reference: https://docs.clouduxe.com/api/reference/server-actions/power-service/) ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/power \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"action":"restart"}' ``` ##### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "restart", "status": "running", "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": null, "livemode": true } ``` The Node and PHP SDKs make a key for every write and reuse it on their own retries, so you never handle one there. ## What a retry gets | What you send | What you get | | --- | --- | | The same key and the same request, after the first one finished | The first answer again, with `Idempotent-Replayed: true`. The write happened once. | | The same key while the first request is still running | After up to 4 seconds, `409` [`idempotency_in_progress`](https://docs.clouduxe.com/api/errors/#idempotency_in_progress) with `Retry-After: 1`. Retry with the same key. | | The same key with a different request | `422` [`idempotency_mismatch`](https://docs.clouduxe.com/api/errors/#idempotency_mismatch). Use a new key for a new request. | | The same key after the first request failed (any `4xx` or `5xx`) | The request runs again: a failure stores nothing. | | The same key after `503` [`outcome_unknown`](https://docs.clouduxe.com/api/errors/#outcome_unknown) | The retry settles it: it answers what happened, or does the write once. | A write commits its whole effect and its stored answer together, so you never get a `4xx` for a write that took effect. Keys belong to the token that sent them, so two tokens never collide, and they are kept for 48 hours. ## Secrets are never replayed A replay never repeats a secret: - Creating a webhook endpoint and rotating its secret answer the signing secret in the first response only. A replay answers `secret: null`. If you lost the secret, rotate it. - No write ever answers a server password. Provisioning, reinstalling and resetting a password answer an action, and the password, when there is one, is read from the action itself; see [Long-running actions](https://docs.clouduxe.com/api/actions/#one-time-secrets). --- # Rate limits > How many requests a token and an account can make, the headers that say how much is left, and what to do with a 429. Source: https://docs.clouduxe.com/api/rate-limits/ The limits are sized for automation: bulk listing, polling and managing many services at once. Each response tells you how much of the tightest limit is left, so your code can slow down before it is refused. ## The limits | Limit | How much | | --- | --- | | Reads per token | 1,200 a minute | | Writes per token | 240 a minute | | Reads per account, all tokens together | 3,000 a minute | | Writes per account, all tokens together | 600 a minute | | Failed authentications from one address | 30 a minute, then that address is refused for 10 minutes | | Services ordered per account | 120 an hour | | Power actions per service | 30 in 10 minutes | | Reinstalls per service | 5 an hour | | Root password resets per service | 5 an hour | | Plan change requests per service | 1 in 10 minutes | | Tickets per account | 20 opened, 120 replies and 60 uploads an hour | If you need more services an hour, ask support to raise your account's order limit. ## Read the headers Every response carries four headers for the limit nearest to running out: | Header | What it says | | --- | --- | | `RateLimit-Limit` | How many requests the limit allows. | | `RateLimit-Remaining` | How many are left. | | `RateLimit-Reset` | Seconds until a request frees up. | | `RateLimit-Policy` | The limit and its window, such as `1200;w=60`. | ## When you are refused A request over a limit answers `429` with a `Retry-After` header, in seconds, and one of three codes: - [`rate_limited`](https://docs.clouduxe.com/api/errors/#rate_limited): a request limit is spent. - [`action_limit_reached`](https://docs.clouduxe.com/api/errors/#action_limit_reached): a per-service limit on power actions, reinstalls or password resets is spent. - [`order_limit_reached`](https://docs.clouduxe.com/api/errors/#order_limit_reached): the account has ordered its hourly maximum of services. Wait for `Retry-After`, then send the same request again. For a write, keep the same `Idempotency-Key` (see [Idempotency](https://docs.clouduxe.com/api/idempotency/)). The SDKs do this for you, honouring `Retry-After`. If the limits cannot be checked for a moment, a write is refused with `503` [`limits_unavailable`](https://docs.clouduxe.com/api/errors/#limits_unavailable) and a read goes through. Retry the write. ## Polling Read an action at most once every 2 seconds while you wait for it, or skip polling and listen for the `action.completed` webhook. See [Long-running actions](https://docs.clouduxe.com/api/actions/). --- # 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. Source: https://docs.clouduxe.com/api/actions/ 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 *Figure: An action starts queued, runs, and ends in one of three final states. It can also fail while still queued, when it is refused before it is sent. Unknown means the result was not confirmed in time: check the service itself. Final states never change.* | 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: https://docs.clouduxe.com/api/reference/server-actions/get-action/) ```bash curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```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 } ``` Or list a service's actions: `GET /services/{serviceId}/actions` (reference: https://docs.clouduxe.com/api/reference/server-actions/list-service-actions/) ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/actions \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` # Instead of polling, you can listen for the `action.completed` webhook, which carries the action in its final state; see [Webhooks](https://docs.clouduxe.com/api/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}/secret` (reference: https://docs.clouduxe.com/api/reference/server-actions/get-action-secret/) ```bash curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` ##### Response (`200`) ```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" } ``` - 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 `410` [`secret_unavailable`](https://docs.clouduxe.com/api/errors/#secret_unavailable), which is final. - As soon as you have stored it, delete it, so it can never be read again: `DELETE /actions/{actionId}/secret` (reference: https://docs.clouduxe.com/api/reference/server-actions/delete-action-secret/) ```bash 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" ``` # --- # Webhooks > Have Clouduxe call your endpoint when something happens, check every delivery's signature before you trust it, and handle retries and repeats. Source: https://docs.clouduxe.com/api/webhooks/ A webhook is a signed `POST` from Clouduxe to an HTTPS endpoint you run, sent when something happens on your account: an order is paid, a server is ready, an action finishes, an invoice is overdue. It saves your billing system from polling. ## Add an endpoint `POST /webhook-endpoints` (reference: https://docs.clouduxe.com/api/reference/webhooks/create-webhook-endpoint/) ```bash curl -X POST https://api.clouduxe.com/v1/webhook-endpoints \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"url":"https://billing.acme.example/clouduxe/webhooks","description":"WHMCS production","enabledEvents":["service.provisioned","service.suspended","service.terminated","action.completed","invoice.created","invoice.overdue"]}' ``` ##### Response (`201`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": "cxwhsec_4fT9qLm2Xv7Rk3Np8Wd1Zs6Hc0Yb5Ue2Ja9Gt4Qx7Lp", "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` The answer holds the endpoint's signing secret, `cxwhsec_` followed by 43 letters and digits. It is shown in this answer only: a replay of the same request answers `secret: null`. Store it like a token. If you lose it, rotate it. An endpoint's URL must: - use `https`, on port 443 or 8443; - use a public DNS name, not an IP address; - not be on a Clouduxe domain. Otherwise the request answers [`webhook_url_refused`](https://docs.clouduxe.com/api/errors/#webhook_url_refused). An account can have up to 10 endpoints ([`webhook_endpoint_limit`](https://docs.clouduxe.com/api/errors/#webhook_endpoint_limit)). Creating an endpoint, or changing its URL, emails the account owner. Endpoints are listed beside your tokens on [API tokens](https://dash.clouduxe.com/account/api-tokens) in the panel. ## The events Give an endpoint the event types it should receive in `enabledEvents`, or `["*"]` for all of them. Every type the API sends: - `order.paid`: Order paid - `order.held`: Order held - `order.completed`: Order completed - `order.cancelled`: Order cancelled - `service.created`: Service created - `service.provisioned`: Service provisioned - `service.provisioning_failed`: Service provisioning failed - `service.suspended`: Service suspended - `service.unsuspended`: Service unsuspended - `service.plan_changed`: Service plan changed - `service.cancellation_scheduled`: Service cancellation scheduled - `service.cancellation_removed`: Service cancellation removed - `service.renewed`: Service renewed - `service.terminating`: Service terminating - `service.terminated`: Service terminated - `action.completed`: Action completed - `invoice.created`: Invoice created - `invoice.paid`: Invoice paid - `invoice.overdue`: Invoice overdue - `invoice.cancelled`: Invoice cancelled - `wallet.credited`: Wallet credited - `ticket.replied`: Ticket replied - `ticket.closed`: Ticket closed - `api_token.revoked`: API token revoked - `protection.attack_started`: Attack started - `protection.attack_ended`: Attack ended - `webhook_endpoint.test`: Webhook endpoint test Each delivery's body is an event: | Field | What it holds | | --- | --- | | `object` | Always `event`. | | `id` | The event's id. Retries and redeliveries carry the same one. | | `type` | The event type, such as `action.completed`. | | `apiVersion` | The API version the payload is written in. | | `createdAt` | When the change happened. | | `livemode` | Whether it is a live event. | | `data.object` | The object as it was when the event happened. | | `data.previousAttributes` | The fields that changed, with their earlier values. | ## Verify every delivery Every delivery carries these headers: | Header | What it holds | | --- | --- | | `Clouduxe-Signature` | `t=,v1=`. While a secret is being rotated there are two `v1` values. | | `Clouduxe-Event-Id` | The event's id. | | `Clouduxe-Event-Type` | The event's type. | | `User-Agent` | `Clouduxe-Webhooks/1`. | The signature is the hex HMAC-SHA256 of `.`, keyed with the endpoint's secret. Before you act on a delivery: ### Step 1: Keep the raw body Compute the signature over the body exactly as it arrived, before any JSON parsing. A body parsed and serialised again will not match. ### Step 2: Check the signature and the time Compute the HMAC, compare it with each `v1` value in constant time, and refuse the delivery if none matches or if `t` is more than 300 seconds from your clock. ### Step 3: Ignore repeats Delivery is at least once. Record each event `id` you have handled and ignore one you have seen. ### Node ```js import crypto from "node:crypto"; const TOLERANCE_SECONDS = 300; // rawBody: the request body exactly as received (a Buffer or string), before any JSON parsing. export function verifyClouduxeSignature(rawBody, header, secret, now = Math.floor(Date.now() / 1000)) { const parts = String(header ?? "").split(",").map((p) => p.trim()); const t = Number(parts.find((p) => p.startsWith("t="))?.slice(2)); const signatures = parts.filter((p) => p.startsWith("v1=")).map((p) => p.slice(3)); if (!Number.isInteger(t) || signatures.length === 0) return false; if (Math.abs(now - t) > TOLERANCE_SECONDS) return false; const expected = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest(); return signatures.some((sig) => { const given = Buffer.from(sig, "hex"); return given.length === expected.length && crypto.timingSafeEqual(given, expected); }); } ``` With Express, take the body as raw bytes on the webhook route: `app.post("/hooks/clouduxe", express.raw({ type: "application/json" }), handler)`, then pass `req.body` and `req.get("Clouduxe-Signature")`. ### Python ```python import hashlib import hmac import time TOLERANCE_SECONDS = 300 def verify_clouduxe_signature(raw_body: bytes, header: str, secret: str, now: int | None = None) -> bool: """raw_body: the request body exactly as received, before any JSON parsing.""" parts = [p.strip() for p in (header or "").split(",")] t_values = [p[2:] for p in parts if p.startswith("t=")] signatures = [p[3:] for p in parts if p.startswith("v1=")] if len(t_values) != 1 or not t_values[0].isdigit() or not signatures: return False t = int(t_values[0]) if abs((now if now is not None else int(time.time())) - t) > TOLERANCE_SECONDS: return False expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest() return any(hmac.compare_digest(expected, sig) for sig in signatures) ``` With Flask, pass `request.get_data()` and `request.headers.get("Clouduxe-Signature")`. ### PHP ```php TOLERANCE_SECONDS) { return false; } $expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret); foreach ($signatures as $signature) { if (hash_equals($expected, $signature)) { return true; } } return false; } $valid = verifyClouduxeSignature( file_get_contents('php://input'), $_SERVER['HTTP_CLOUDUXE_SIGNATURE'] ?? '', getenv('CLOUDUXE_WEBHOOK_SECRET') ); ``` The Node and PHP SDKs do the same check with `webhooks.verify(rawBody, signatureHeader, secret)`. ## Answer quickly A delivery counts when your endpoint answers any `2xx` within 10 seconds. Anything else counts as failed: another status, a timeout, or a redirect, which is never followed. Answer first, then do slow work. A failed delivery is retried, with longer waits each time: *Figure: After a failed delivery, Clouduxe waits longer before each retry, from one minute to a day, and keeps trying for up to 3 days. After 3 days of failures the endpoint is disabled and the account owner is emailed.* Events are kept for 30 days, and the order of deliveries is not guaranteed: use `createdAt` and the object's own state rather than the order they arrive in. ## Rotate, test and redeliver - **Rotate the secret** with `rotateWebhookEndpointSecret`. The old secret keeps working for `oldSecretExpiresInSeconds`, 0 to 86,400 (a day, the default), and during that time each delivery carries both signatures. After a leak, send `0`. - **Test an endpoint** with `testWebhookEndpoint`: it queues one signed `webhook_endpoint.test` event and answers `202` with the pending delivery. - **Redeliver an event** of the last 30 days to one enabled endpoint with `redeliverEvent`, for example after your endpoint was down for more than 3 days. It keeps its event id, so your repeat check still works, and also answers `202` with the pending delivery. - **See how a delivery went** with `getWebhookDelivery` a few seconds later: pending, delivered or failed, with your endpoint's status and timing. - **List past events** with `listEvents`, filtered by `type`, `createdAfter` and `createdBefore`. All of these are in the [Webhooks reference](https://docs.clouduxe.com/api/reference/webhooks/). --- # Versioning and changelog > How the API keeps your code working as it grows, what counts as a breaking change, and every change to the API so far. Source: https://docs.clouduxe.com/api/changelog/ The API grows without breaking the code you have already written. New things arrive in every version; anything that could break a client waits for a new dated version that you move to when you choose. ## Two kinds of version - **The path holds the major version,** `/v1`. A `/v2` would only come with a redesign of the whole API, and none is planned. - **The `Clouduxe-Version` header holds the dated version,** such as `2026-12-01`. Each token keeps the version that was current when it was made. A request without the header uses the token's version; a request with it uses the version it names. An unknown version answers `400` [`version_invalid`](https://docs.clouduxe.com/api/errors/#version_invalid). Every response says which version served it, in its own `Clouduxe-Version` header. A token's version only changes when you raise it in the panel. It is never raised for you. ## What changes without a new version These reach every version, because a well-behaved client keeps working: - a new endpoint; - a new optional request field or query parameter; - a new response field; - a new value in a response's enum; - a new event type; - a new error code under an existing type and status; - a limit made more generous; - a different order of fields, or a reworded `message`. So your code should ignore fields it does not know, and treat an enum value it does not know as "other". ## What needs a new version These ship only in a new dated version, and each is listed in the changelog below: - removing or renaming a field, an endpoint or an enum value; - changing a field's type or format; - making an optional input required; - tightening validation; - changing the status or error code for the same condition; - changing the order of a list; - changing what a field means. ## Deprecation A deprecated endpoint or version is announced at least 90 days before it changes, here and by email to the owner of every account whose tokens used it in the 30 days before. Deprecated responses carry `Deprecation` and `Sunset` headers, and a `Link` header pointing to this page. A dated version stays supported for at least 12 months after the next one ships. A security fix can change behaviour that is itself unsafe, with as much notice as the risk allows. Each one is explained here. ## Changelog ### 2026-11-05 (API version 2026-12-01) - The first version of the Clouduxe API contract. --- # Keeping tokens safe > How to store, scope and limit API tokens and webhook secrets, and what to do the moment one leaks. Source: https://docs.clouduxe.com/api/token-security/ An API token acts as you on your account, within its scopes. Treat it like a password to your servers, and give each one as little reach as the job needs. ## Store it outside your code - Keep tokens in a secret manager or an environment variable. Every example in these docs reads `CLOUDUXE_API_KEY` for that reason. - Never commit a token, paste it into a ticket or a chat, or send it to an AI. An assistant never needs your token to write code for you. - The token is shown once, when it is made. If you lose it, make a new one and revoke the old one. - Keep webhook signing secrets (`cxwhsec_`) the same way: anyone with one can sign fake deliveries to your endpoint. ## Give it as little as it needs - **Scopes.** Choose only the scopes the integration uses. A reporting job needs `services:read`, not `services:destructive`. See [Authentication and scopes](https://docs.clouduxe.com/api/authentication/#scopes). - **Elevated scopes** move money, destroy data, send account data to a URL or revoke access. Give them only to the tokens that must have them. A token with one always expires, at most a year after it was made. - **Expiry.** Pick the shortest expiry that fits; 90 days is the suggestion. - **Addresses.** If your integration calls from fixed addresses, add them to the token's allowlist. A request from anywhere else is refused, and you are emailed once a day for each new address. - **One token per integration.** Then revoking one never breaks the others, and the panel's last-used time and address tell you which system used it. ## Watch for surprises - Every new token emails the account owner, naming the token, who made it, its scopes and its expiry. - Creating a webhook endpoint, or changing its URL, emails the owner too. - The panel shows when and from which address each token was last used. If any of these surprise you, revoke the token first and ask questions after. ## If a token leaks ### Step 1: Revoke it Revoke it in the panel at [API tokens](https://dash.clouduxe.com/account/api-tokens), or with `revokeApiToken`. It stops working at once: the next request answers `401` [`token_revoked`](https://docs.clouduxe.com/api/errors/#token_revoked). ### Step 2: Make a new one Make a replacement with the same or fewer scopes, and update the integration. ### Step 3: Check what it touched Check your services, orders and SSH keys for changes you did not expect, and check the webhook endpoints listed beside your tokens. If a webhook secret may have leaked too, rotate it with no overlap: send `oldSecretExpiresInSeconds: 0`. A token sent over plain HTTP counts as leaked. The API refuses plain HTTP, but the token still crossed the network unencrypted. --- # Build with AI > Give an AI assistant the Clouduxe API docs in one link, and start from ready-made prompts for ordering, syncing and webhooks. Source: https://docs.clouduxe.com/api/build-with-ai/ Every page of these API docs is written to be read by an AI as easily as by you. Point your assistant at the docs, paste one of the prompts below, and it works from what the API actually does rather than from a guess. ## Give your AI the docs | What | Where | Use it for | | --- | --- | --- | | **One file with everything** | [`/llms-full.txt`](https://docs.clouduxe.com/llms-full.txt) | Paste the link into any AI that reads URLs, or the file into one that does not. | | **The index** | [`/llms.txt`](https://docs.clouduxe.com/llms.txt) | A short summary with a link to every page, in the llms.txt format. | | **Any one page** | The **Copy page as Markdown** and **View as Markdown** buttons at the top of each page | Hand over just the page you are on. | | **The contract** | [`/api/openapi.yaml`](https://docs.clouduxe.com/api/openapi.yaml) | The OpenAPI 3.1 file every reference page is generated from, for code generators and tools. | The **Copy prompt for your AI** button at the top of each page copies a short prompt that names the page, the base URL and how tokens are sent, and points at `/llms-full.txt`. **Open in Claude** starts a chat with that prompt. > **Keep tokens out of the chat:** An AI never needs your token to write code for you. Every prompt here tells it > to read the token from `CLOUDUXE_API_KEY`. Never paste a `cxk_live_` token into > a chat, an issue or a repository. > **Coming: the Clouduxe MCP server:** An MCP server is planned, so AI agents can manage your services through the API > with your own API token and the same scopes. It is not available yet, and this > page will say so when it is. ## Prompts for common jobs Each prompt tells the AI to use only the docs and the contract, to ask which language you use, and to prefer the official SDK. Copy one, or run it in Claude directly. ### Provision a VPS and wait for it Preview the price, order from wallet credit, and wait for the server to be ready. ```text Write a script that orders one VPS through the Clouduxe API and waits until it is ready. 1. Preview the order with POST /v1/orders/preview for a planId, billingCycleMonths, hostname and imageId I pass in, and print the total. 2. Place it with POST /v1/orders, paid from wallet credit, with a new Idempotency-Key, and with my own reference so I can find it later. 3. Wait for the order's provision action to reach a terminal status, reading GET /v1/actions/{actionId} no more than once every 2 seconds. 4. Print the new service's id and IPv4 address, or the action's failure code. Handle insufficient_credit, api_ordering_disabled and plan_unavailable with a clear message each. Use the Clouduxe API docs at https://docs.clouduxe.com/llms-full.txt and the OpenAPI contract at https://docs.clouduxe.com/api/openapi.yaml, and nothing else: if they do not say something, tell me instead of guessing. Read the API token from the CLOUDUXE_API_KEY environment variable. Ask me which language I use before you write code, and use the official Clouduxe SDK for it if there is one. ``` ### Keep WHMCS in step with your services A sync job that matches services to your clients by reference, then stays current from webhooks. ```text I bill my customers in WHMCS. Build a sync between the Clouduxe API and WHMCS in PHP. 1. List every service with GET /v1/services, following nextCursor until hasMore is false. 2. Match each service to my WHMCS client by its reference field, and store the Clouduxe service id on the WHMCS service. 3. Update each WHMCS service's status from the Clouduxe status, and flag any Clouduxe service with no matching client. 4. Then keep it current without polling: subscribe a webhook endpoint to the service events and apply each one, ignoring an event id I have already processed. Use the Clouduxe API docs at https://docs.clouduxe.com/llms-full.txt and the OpenAPI contract at https://docs.clouduxe.com/api/openapi.yaml, and nothing else: if they do not say something, tell me instead of guessing. Read the API token from the CLOUDUXE_API_KEY environment variable. Ask me which language I use before you write code, and use the official Clouduxe SDK for it if there is one. ``` ### Verify webhook signatures A receiver that checks Clouduxe-Signature, refuses replays and answers in time. ```text Write a webhook receiver for Clouduxe events. 1. Read the raw request body before any JSON parsing. 2. Parse the Clouduxe-Signature header (t=,v1=; during a secret rotation there are two v1 values). 3. Compute HMAC-SHA256 over "." with the endpoint secret from CLOUDUXE_WEBHOOK_SECRET, and compare it with each v1 value in constant time. 4. Refuse the request when t is more than 300 seconds from my clock. 5. Record each event id and ignore one I have already processed. 6. Answer 2xx within 10 seconds, and do any slow work after answering. Use the SDK's webhook helper if there is one, and show me how to test it with a sample event. Use the Clouduxe API docs at https://docs.clouduxe.com/llms-full.txt and the OpenAPI contract at https://docs.clouduxe.com/api/openapi.yaml, and nothing else: if they do not say something, tell me instead of guessing. Read the API token from the CLOUDUXE_API_KEY environment variable. Ask me which language I use before you write code, and use the official Clouduxe SDK for it if there is one. ``` ### Explain an error Paste an error body and get what it means and what to do, from the error catalogue. ```text I got this error from the Clouduxe API: Using the error catalogue in the docs, tell me what the code means, whether I should retry (and after how long), and what to change. Quote the requestId back to me so I can give it to support. Use the Clouduxe API docs at https://docs.clouduxe.com/llms-full.txt and the OpenAPI contract at https://docs.clouduxe.com/api/openapi.yaml, and nothing else: if they do not say something, tell me instead of guessing. Read the API token from the CLOUDUXE_API_KEY environment variable. Ask me which language I use before you write code, and use the official Clouduxe SDK for it if there is one. ``` --- # API reference > Every resource and endpoint, generated from the API contract. Source: https://docs.clouduxe.com/api/reference/ Base URL: `https://api.clouduxe.com/v1`. ## [Account](https://docs.clouduxe.com/api/md/reference/account.md) Your account. - `GET /account`: Get your account ## [Catalogue](https://docs.clouduxe.com/api/md/reference/catalogue.md) Plans at your price, and regions. - `GET /plans`: List plans - `GET /plans/{planId}`: Get a plan - `GET /regions`: List regions ## [Orders](https://docs.clouduxe.com/api/md/reference/orders.md) Ordering services, paid from wallet credit. - `POST /orders/preview`: Preview an order - `GET /orders`: List orders - `POST /orders`: Create an order - `GET /orders/{orderId}`: Get an order - `PATCH /orders/{orderId}`: Update an order ## [Services](https://docs.clouduxe.com/api/md/reference/services.md) Your VPS, Dedicated and proxy services. - `GET /services`: List services - `GET /services/{serviceId}`: Get a service - `PATCH /services/{serviceId}`: Update a service - `GET /services/{serviceId}/images`: List a server's OS images - `GET /services/{serviceId}/usage`: Get a service's traffic - `GET /services/{serviceId}/plan-options`: List plan change options ## [Server actions](https://docs.clouduxe.com/api/md/reference/server-actions.md) Power, console, reinstall and password reset, and the actions they start. - `POST /services/{serviceId}/power`: Run a power action - `POST /services/{serviceId}/reinstall`: Reinstall a server - `POST /services/{serviceId}/reset-password`: Reset a server's password - `GET /services/{serviceId}/actions`: List a service's actions - `GET /actions/{actionId}`: Get an action - `GET /actions/{actionId}/secret`: Retrieve an action's secret - `DELETE /actions/{actionId}/secret`: Delete an action's secret ## [Lifecycle](https://docs.clouduxe.com/api/md/reference/lifecycle.md) Plan changes, cancellation and termination. - `POST /services/{serviceId}/plan-change`: Change a service's plan - `PUT /services/{serviceId}/cancellation`: Set cancellation at period end - `POST /services/{serviceId}/terminate`: Terminate a service ## [Firewall](https://docs.clouduxe.com/api/md/reference/firewall.md) A server's Shield firewall. - `GET /services/{serviceId}/firewall`: Get a firewall - `PUT /services/{serviceId}/firewall/protection`: Turn protection on or off - `PUT /services/{serviceId}/firewall/default-policy`: Set the default policy - `POST /services/{serviceId}/firewall/rules`: Add a firewall rule - `PATCH /services/{serviceId}/firewall/rules/{ruleId}`: Update a firewall rule - `DELETE /services/{serviceId}/firewall/rules/{ruleId}`: Delete a firewall rule - `POST /services/{serviceId}/firewall/blocked-ips`: Block an address - `DELETE /services/{serviceId}/firewall/blocked-ips/{ip}`: Unblock an address - `POST /services/{serviceId}/firewall/trusted-ips`: Trust an address - `DELETE /services/{serviceId}/firewall/trusted-ips/{ip}`: Untrust an address - `POST /services/{serviceId}/firewall/presets`: Apply a firewall preset - `GET /firewall-presets`: List firewall presets ## [SSH keys](https://docs.clouduxe.com/api/md/reference/ssh-keys.md) Your SSH key library. - `GET /ssh-keys`: List SSH keys - `POST /ssh-keys`: Add an SSH key - `GET /ssh-keys/{sshKeyId}`: Get an SSH key - `PATCH /ssh-keys/{sshKeyId}`: Update an SSH key - `DELETE /ssh-keys/{sshKeyId}`: Delete an SSH key ## [Billing](https://docs.clouduxe.com/api/md/reference/billing.md) Invoices and wallet credit. - `GET /invoices`: List invoices - `GET /invoices/{invoiceId}`: Get an invoice - `GET /invoices/{invoiceId}/pdf`: Get an invoice PDF link - `GET /wallet`: Get your wallet - `GET /wallet/transactions`: List wallet transactions ## [Support](https://docs.clouduxe.com/api/md/reference/support.md) Tickets and attachments. - `GET /support/departments`: List support departments - `GET /tickets`: List tickets - `POST /tickets`: Open a ticket - `GET /tickets/{ticketId}`: Get a ticket - `POST /tickets/{ticketId}/replies`: Reply to a ticket - `POST /tickets/{ticketId}/close`: Close a ticket - `POST /attachments`: Start an attachment upload - `POST /attachments/{attachmentId}/complete`: Finish an attachment upload - `GET /attachments/{attachmentId}`: Get an attachment ## [Webhooks](https://docs.clouduxe.com/api/md/reference/webhooks.md) Webhook endpoints and events. - `GET /webhook-endpoints`: List webhook endpoints - `POST /webhook-endpoints`: Create a webhook endpoint - `GET /webhook-endpoints/{endpointId}`: Get a webhook endpoint - `PATCH /webhook-endpoints/{endpointId}`: Update a webhook endpoint - `DELETE /webhook-endpoints/{endpointId}`: Delete a webhook endpoint - `POST /webhook-endpoints/{endpointId}/rotate-secret`: Rotate a webhook secret - `POST /webhook-endpoints/{endpointId}/test`: Send a test event - `POST /events/{eventId}/redeliver`: Redeliver an event - `GET /webhook-deliveries/{deliveryId}`: Get a webhook delivery - `GET /events`: List events - `GET /events/{eventId}`: Get an event ## [API tokens](https://docs.clouduxe.com/api/md/reference/api-tokens.md) Tokens: list and revoke. Tokens are made in the panel, at /account/api-tokens. - `GET /api-tokens`: List API tokens - `GET /api-tokens/current`: Get the current token - `GET /api-tokens/{tokenId}`: Get an API token - `DELETE /api-tokens/{tokenId}`: Revoke an API token ## [Protection](https://docs.clouduxe.com/api/md/reference/protection.md) A protected server's DDoS protection, read-only: status, traffic now, and its attack history. - `GET /services/{serviceId}/protection`: Get protection status - `GET /services/{serviceId}/protection/incidents`: List attacks - `GET /services/{serviceId}/protection/incidents/{incidentId}`: Get an attack --- # Account > Your account. Source: https://docs.clouduxe.com/api/reference/account/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Account object Your Clouduxe account. ### Attributes - `object` (string, required): The object's type. Always "account". - `id` (string (uuid), required): The account's id. - `displayName` (string or null, required): The account's display name. - `status` (string, required): active, or closed. One of `active`, `closed`. - `company` (object or null, required): The company on the account's invoices, or null. - `name` (string, required): The company's legal name. - `gstin` (string or null, required): The company's Indian GSTIN, printed on its invoices, or null. - `billingCountry` (string or null, required): The billing address's country, ISO 3166-1 alpha-2, or null when no billing address is set. pattern ^[A-Z]{2}$. - `billingCurrency` (string or null, required): The currency new orders are billed in, from the billing country. Null when it is not known yet; then see billingCurrencyUnknownReason. There is never a default currency. pattern ^[A-Z]{3}$. - `billingCurrencyUnknownReason` (string or null, required): Why billingCurrency is null: no-country (no billing address), bad-country (the address's country is not recognised), usd-unavailable (no payment method takes the local currency or USD). Null when billingCurrency is known. One of `no-country`, `bad-country`, `usd-unavailable`. - `apiOrdering` (boolean, required): Whether services can be ordered through the API. The account owner changes it in the panel. - `serviceEmailsForApiOrders` (boolean, required): Whether Clouduxe sends service emails (server ready and server rebuilt notices) for services ordered through the API. Switch it off in the panel to send your own emails, using webhooks. Billing, suspension, termination and security emails are always sent to the account. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "account", "id": "5f2c9a4e-7b1d-4c3a-9e8f-2a6b1c0d4e7f", "displayName": "Acme Hosting", "status": "active", "company": { "name": "Acme Hosting Private Limited", "gstin": null }, "billingCountry": "IN", "billingCurrency": "INR", "billingCurrencyUnknownReason": null, "apiOrdering": true, "serviceEmailsForApiOrders": false, "livemode": true } ``` ## Get your account `GET /account` Use this to read the account this token belongs to: its name, billing country and currency, and whether API ordering and service emails are on. Owner tokens only. Token scope: `account:read`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The account. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/account \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const account = await cx.account.get(); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/account", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) account = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $account = $cx->account->get(); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/account", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const account = await res.json(); ``` ### Response (`200`) ```json { "object": "account", "id": "5f2c9a4e-7b1d-4c3a-9e8f-2a6b1c0d4e7f", "displayName": "Acme Hosting", "status": "active", "company": { "name": "Acme Hosting Private Limited", "gstin": null }, "billingCountry": "IN", "billingCurrency": "INR", "billingCurrencyUnknownReason": null, "apiOrdering": true, "serviceEmailsForApiOrders": false, "livemode": true } ``` --- # Catalogue > Plans at your price, and regions. Source: https://docs.clouduxe.com/api/reference/catalogue/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Plan object A plan you can order. Prices are the price this account pays, in its billing currency, excluding GST, and are shown only to tokens with orders:read. ### Attributes - `object` (string, required): The object's type. Always "plan". - `id` (string, required): The plan's id: a stable string, not a UUID. Pass it as planId. - `type` (string, required): The product type. One of `vps`, `dedicated`, `proxy`. - `name` (string, required): The plan's name. You can show your own name instead, keyed by id. - `description` (string or null, required): The plan's description, or null. - `region` (string or null, required): The region the plan runs in, or null for a plan with no region (the proxy). One of `mumbai`, `singapore`, `limburg`. - `available` (boolean, required): False when the plan is sold out. Orders for it answer out_of_stock until it is back. - `cycles` (array of PlanCycle, required): The billing cycles offered. - `months` (integer, required): The cycle's length in months. One of `1`, `3`, `6`, `12`, `24`, `36`. - `price` (object or null, required): The price per cycle in the account's billing currency, excluding GST. Null when the price is not known yet; see unpricedReason. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `unpricedReason` (string or null, required): Why price is null: no-rate (no exchange rate for the currency this month), no-rounding-rule, or no-access (this token cannot see prices: prices need orders:read, which only the account owner's tokens hold). Null when price is set. One of `no-rate`, `no-rounding-rule`, `no-access`. - `currency` (string or null, required): The account's billing currency, the currency of every price here, or null when it is not known yet. pattern ^[A-Z]{3}$. - `orderForm` (object or null, required): What an order item for this plan carries. Returned by getPlan; null in listPlans. - `requiredFields` (array of string, required): The order item fields this plan requires. - `images` (array of Image, required): The images an order may use. Empty for a proxy. - `object` (string, required): The object's type. Always "image". - `id` (string, required): The image's id. Pass it as imageId. - `name` (string, required): The image's name, for showing to people. - `family` (string, required): linux or windows. A root password reset sets the password of Administrator on windows and of root otherwise. One of `linux`, `windows`. - `profiles` (array of string, required): The protection profiles an order may use. Only for a proxy; empty otherwise. - `optionGroups` (array of OptionGroup, required): The plan's option groups. - `code` (string, required): The group's code. Use it as a key of an order item's options. - `name` (string, required): The group's name. - `required` (boolean, required): Whether an order must pick a value of this group. - `values` (array of object, required): The values offered. - `code` (string, required): The value's code. Use it as the value in options. - `name` (string, required): The value's name. - `sshKeys` (boolean, required): Whether order items may carry sshKeyIds. ### Example ```json { "object": "plan", "id": "vps-nvme-4-mumbai", "type": "vps", "name": "NVMe VPS 4 GB", "description": "2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB traffic.", "region": "mumbai", "available": true, "currency": "INR", "cycles": [ { "months": 1, "price": { "amount": 129900, "currency": "INR" }, "unpricedReason": null }, { "months": 12, "price": { "amount": 1402900, "currency": "INR" }, "unpricedReason": null } ], "orderForm": { "requiredFields": [ "hostname", "imageId" ], "images": [ { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, { "object": "image", "id": "debian-12", "name": "Debian 12", "family": "linux" }, { "object": "image", "id": "windows-server-2022", "name": "Windows Server 2022", "family": "windows" } ], "profiles": [], "optionGroups": [ { "code": "backups", "name": "Daily backups", "required": false, "values": [ { "code": "daily-7", "name": "7 daily backups" } ] } ], "sshKeys": true } } ``` ## List plans `GET /plans` Use this to show your catalogue or pick a plan to order. Prices are what this account pays, in its billing currency, excluding GST, and are shown only to tokens with orders:read (the account owner's); other tokens see each price as null with unpricedReason no-access. Filter by type or region. Plans that are sold out are listed with available false. ### Query parameters - `type` (string): Only plans of this product type. One of `vps`, `dedicated`, `proxy`. - `region` (string): Only plans in this region. One of `mumbai`, `singapore`, `limburg`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The plans. - `400`: The request is not valid. Codes: version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/plans \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const plan of cx.plans.list()) { console.log(plan.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/plans", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->plans->list() as $plan) { echo $plan->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/plans", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "plan", "id": "vps-nvme-4-mumbai", "type": "vps", "name": "NVMe VPS 4 GB", "description": "2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB traffic.", "region": "mumbai", "available": true, "currency": "INR", "cycles": [ { "months": 1, "price": { "amount": 129900, "currency": "INR" }, "unpricedReason": null }, { "months": 12, "price": { "amount": 1402900, "currency": "INR" }, "unpricedReason": null } ], "orderForm": null }, { "object": "plan", "id": "dedicated-e5-64-limburg", "type": "dedicated", "name": "Dedicated E5 64 GB", "description": "Intel Xeon E5, 64 GB RAM, 2 x 1 TB NVMe.", "region": "limburg", "available": false, "currency": "INR", "cycles": [ { "months": 1, "price": { "amount": 1149900, "currency": "INR" }, "unpricedReason": null } ], "orderForm": null }, { "object": "plan", "id": "proxy-game-standard", "type": "proxy", "name": "Protected Proxy Standard", "description": "DDoS-protected proxy for one origin, up to 15 port ranges.", "region": null, "available": true, "currency": "INR", "cycles": [ { "months": 1, "price": { "amount": 249900, "currency": "INR" }, "unpricedReason": null } ], "orderForm": null } ], "hasMore": false, "nextCursor": null } ``` ## Get a plan `GET /plans/{planId}` Use this before ordering: orderForm lists the required fields, the OS images, the option groups and, for a proxy, the protection profiles. Prices follow the rule of listPlans. An unknown, hidden or retired plan answers not_found alike. ### Path parameters - `planId` (string, required): The plan's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The plan. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/plans/vps-nvme-4-mumbai \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const plan = await cx.plans.get("vps-nvme-4-mumbai"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/plans/vps-nvme-4-mumbai", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) plan = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $plan = $cx->plans->get('vps-nvme-4-mumbai'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/plans/vps-nvme-4-mumbai", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const plan = await res.json(); ``` ### Response (`200`) ```json { "object": "plan", "id": "vps-nvme-4-mumbai", "type": "vps", "name": "NVMe VPS 4 GB", "description": "2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB traffic.", "region": "mumbai", "available": true, "currency": "INR", "cycles": [ { "months": 1, "price": { "amount": 129900, "currency": "INR" }, "unpricedReason": null }, { "months": 12, "price": { "amount": 1402900, "currency": "INR" }, "unpricedReason": null } ], "orderForm": { "requiredFields": [ "hostname", "imageId" ], "images": [ { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, { "object": "image", "id": "debian-12", "name": "Debian 12", "family": "linux" }, { "object": "image", "id": "windows-server-2022", "name": "Windows Server 2022", "family": "windows" } ], "profiles": [], "optionGroups": [ { "code": "backups", "name": "Daily backups", "required": false, "values": [ { "code": "daily-7", "name": "7 daily backups" } ] } ], "sshKeys": true } } ``` ## List regions `GET /regions` Use this to show where plans run. Needs no scope. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The regions. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/regions \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const region of cx.regions.list()) { console.log(region.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/regions", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->regions->list() as $region) { echo $region->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/regions", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "region", "id": "mumbai", "name": "Mumbai", "country": "IN", "productTypes": [ "vps" ] }, { "object": "region", "id": "singapore", "name": "Singapore", "country": "SG", "productTypes": [ "vps" ] }, { "object": "region", "id": "limburg", "name": "Limburg", "country": "DE", "productTypes": [ "dedicated" ] } ], "hasMore": false, "nextCursor": null } ``` --- # Orders > Ordering services, paid from wallet credit. Source: https://docs.clouduxe.com/api/reference/orders/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Order object An order for one or more services. ### Attributes - `object` (string, required): The object's type. Always "order". - `id` (string (uuid), required): The order's id. - `status` (string, required): placed (invoiced, not paid), paid (provisioning has started), held (paid, waiting for a review before set-up), completed (every service is ready) or cancelled. One of `placed`, `paid`, `held`, `completed`, `cancelled`. - `items` (array of OrderItem, required): The order's services. - `id` (string (uuid), required): The item's id. - `planId` (string, required): The plan's id. - `billingCycleMonths` (integer, required): The billing cycle in months. - `hostname` (string or null, required): The hostname ordered, or null. - `label` (string or null, required): The label ordered, or null. - `price` (object, required): The item's price per cycle, excluding GST. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `serviceId` (string (uuid) or null, required): The service made for this item, or null until it exists. - `actionId` (string (uuid) or null, required): The provision action for this item, or null before payment. - `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object, required): Your own key-value data on this object. max 20 keys. - `subtotal` (object, required): The items' total before discount and tax. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `discount` (object, required): The coupon's discount. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `tax` (object, required): GST, where it applies. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `total` (object, required): subtotal minus discount plus tax: what was paid. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `couponCode` (string or null, required): The coupon applied, or null. - `invoiceId` (string (uuid) or null, required): The order's invoice. - `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object, required): Your own key-value data on this object. max 20 keys. - `createdAt` (string (date-time), required): When the order was placed. - `paidAt` (string (date-time) or null, required): When it was paid, or null. - `completedAt` (string (date-time) or null, required): When its last service became ready, or null. - `cancelledAt` (string (date-time) or null, required): When it was cancelled, or null. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "order", "id": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "status": "paid", "items": [ { "id": "2b8e4f1a-7c3d-4a6e-9b2f-5d1c8a0e3f7b", "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "label": "node1", "price": { "amount": 129900, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "actionId": "7d2a9f4c-1b8e-4c5a-a3f6-9e0b2d7c4a1f", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "couponCode": null, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "reference": "order-99120", "metadata": { "source": "whmcs" }, "createdAt": "2026-12-04T09:15:22Z", "paidAt": "2026-12-04T09:15:24Z", "completedAt": null, "cancelledAt": null, "livemode": true } ``` ## Preview an order `POST /orders/preview` Use this to show a customer what an order costs before placing it, at this account's price, and whether wallet credit covers it. Writes nothing, so it needs no Idempotency-Key. Token scope: `orders:read`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Body (required) - `items` (array of OrderItemCreate, required): The services to price, 1 to 10. min items 1, max items 10. - `planId` (string, required): The plan's id. - `billingCycleMonths` (integer, required): The billing cycle, one the plan lists. One of `1`, `3`, `6`, `12`, `24`, `36`. - `hostname` (string): The server's hostname. Required for vps and dedicated; there is no default. RFC 1123 labels of 1 to 63 letters, digits and hyphens, no label starting or ending with a hyphen, 253 characters in all, no trailing dot. Single-label names (such as node1) and names that look like an IP address (such as 1.2.3.4: the last label must hold a letter) are refused. Stored in lower case. max length 253, pattern ^(?=.{1,253}$)(?=.*[A-Za-z][A-Za-z0-9-]*$)[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$. - `imageId` (string): The OS image, from the plan's orderForm. Required for vps and dedicated. - `sshKeyIds` (array of string (uuid)): SSH keys from your library to install for root. VPS only; at most 10. max items 10. - `options` (object): Option values by group code, from the plan's orderForm. - `origin` (Option 1 or Option 2): Proxy only: the server to protect. Send serviceId, or ip and port. - One shape: Option 1 - `serviceId` (string (uuid), required): One of your active VPS or Dedicated services. - One shape: Option 2 - `ip` (string (ipv4), required): One of your servers' IPv4 addresses. - `port` (integer, required): The origin port. min 1, max 65535. - `profile` (string): Proxy only: the protection profile, from the plan's orderForm. - `ports` (array of ProxyPort): Proxy only: the ports to protect, 1 to 15 ranges. min items 1, max items 15. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port, equal to portStart for one port. min 1, max 65535. - `label` (string): Your label for the service. min length 1, max length 253. - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Your own key-value data on this object. max 20 keys. - `couponCode` (string): A coupon code to apply. max length 64. ### Responses - `200`: The figures. - `400`: The request is not valid. Codes: version_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: out_of_stock, account_closed. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: plan_unavailable, cycle_unavailable, option_invalid, hostname_invalid, image_unavailable, ssh_key_unknown, too_many_ssh_keys, origin_invalid, quote_incomplete, billing_currency_unknown, coupon_invalid. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/orders/preview \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"items":[{"planId":"vps-nvme-4-mumbai","billingCycleMonths":1,"hostname":"node1.acme.example","imageId":"ubuntu-24.04","sshKeyIds":["2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f"],"label":"node1","reference":"client-4471","metadata":{"whmcsServiceId":"18342","plan":"starter"}}]}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const orderPreview = await cx.orders.preview({ items: [ { planId: "vps-nvme-4-mumbai", billingCycleMonths: 1, hostname: "node1.acme.example", imageId: "ubuntu-24.04", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ], label: "node1", reference: "client-4471", metadata: { whmcsServiceId: "18342", plan: "starter" } } ] }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/orders/preview", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, json={ "items": [ { "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "imageId": "ubuntu-24.04", "sshKeyIds": [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", ], "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter", }, }, ], }, ) orderPreview = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $orderPreview = $cx->orders->preview(['items' => [['planId' => 'vps-nvme-4-mumbai', 'billingCycleMonths' => 1, 'hostname' => 'node1.acme.example', 'imageId' => 'ubuntu-24.04', 'sshKeyIds' => ['2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f'], 'label' => 'node1', 'reference' => 'client-4471', 'metadata' => ['whmcsServiceId' => '18342', 'plan' => 'starter']]]]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/orders/preview", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ items: [ { planId: "vps-nvme-4-mumbai", billingCycleMonths: 1, hostname: "node1.acme.example", imageId: "ubuntu-24.04", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ], label: "node1", reference: "client-4471", metadata: { whmcsServiceId: "18342", plan: "starter" } } ] }), }); const orderPreview = await res.json(); ``` ### Response (`200`) ```json { "object": "order_preview", "items": [ { "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "walletBalance": { "amount": 653282, "currency": "INR" }, "sufficientCredit": true } ``` ## List orders `GET /orders` Use this to find orders, newest first. Filter by status, reference or metadata. Token scope: `orders:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `status` (string): Only orders with this status. One of `placed`, `paid`, `held`, `completed`, `cancelled`. - `reference` (string): Only objects with exactly this reference. max length 100. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of orders. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/orders \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const order of cx.orders.list()) { console.log(order.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/orders", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->orders->list() as $order) { echo $order->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/orders", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "order", "id": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "status": "paid", "items": [ { "id": "2b8e4f1a-7c3d-4a6e-9b2f-5d1c8a0e3f7b", "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "label": "node1", "price": { "amount": 129900, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "actionId": "7d2a9f4c-1b8e-4c5a-a3f6-9e0b2d7c4a1f", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "couponCode": null, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "reference": "order-99120", "metadata": { "source": "whmcs" }, "createdAt": "2026-12-04T09:15:22Z", "paidAt": "2026-12-04T09:15:24Z", "completedAt": null, "cancelledAt": null, "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Create an order `POST /orders` Use this to buy one to ten services in one order. Placing, invoicing and paying from wallet credit happen in one step: either the whole order is placed and paid, or nothing is written (insufficient_credit when credit in the order's currency does not cover the total). The answer is the order, paid (or held for review), with one provision action per item: wait for each action, or for service.provisioned. When a build sets a password (always for Windows, and when no SSH key is given), its provision action's secret holds it. API ordering must be switched on for the account in the panel. Token scope: `orders:write`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `items` (array of OrderItemCreate, required): The services to order, 1 to 10. Each item is one service. min items 1, max items 10. - `planId` (string, required): The plan's id. - `billingCycleMonths` (integer, required): The billing cycle, one the plan lists. One of `1`, `3`, `6`, `12`, `24`, `36`. - `hostname` (string): The server's hostname. Required for vps and dedicated; there is no default. RFC 1123 labels of 1 to 63 letters, digits and hyphens, no label starting or ending with a hyphen, 253 characters in all, no trailing dot. Single-label names (such as node1) and names that look like an IP address (such as 1.2.3.4: the last label must hold a letter) are refused. Stored in lower case. max length 253, pattern ^(?=.{1,253}$)(?=.*[A-Za-z][A-Za-z0-9-]*$)[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$. - `imageId` (string): The OS image, from the plan's orderForm. Required for vps and dedicated. - `sshKeyIds` (array of string (uuid)): SSH keys from your library to install for root. VPS only; at most 10. max items 10. - `options` (object): Option values by group code, from the plan's orderForm. - `origin` (Option 1 or Option 2): Proxy only: the server to protect. Send serviceId, or ip and port. - One shape: Option 1 - `serviceId` (string (uuid), required): One of your active VPS or Dedicated services. - One shape: Option 2 - `ip` (string (ipv4), required): One of your servers' IPv4 addresses. - `port` (integer, required): The origin port. min 1, max 65535. - `profile` (string): Proxy only: the protection profile, from the plan's orderForm. - `ports` (array of ProxyPort): Proxy only: the ports to protect, 1 to 15 ranges. min items 1, max items 15. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port, equal to portStart for one port. min 1, max 65535. - `label` (string): Your label for the service. min length 1, max length 253. - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Your own key-value data on this object. max 20 keys. - `couponCode` (string): A coupon code to apply. max length 64. - `payment` (object, required): How to pay. - `method` (string, required): wallet: pay the whole order from wallet credit in the order's currency. The only method in the API. One of `wallet`. - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Your own key-value data on this object. max 20 keys. ### Responses - `201`: The order, paid or held. - `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `402`: Payment from wallet credit is not possible. Codes: insufficient_credit, credit_currency_mismatch. - `403`: The token is not allowed to do this. Codes: api_ordering_disabled, forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: out_of_stock, coupon_exhausted, terms_outdated, account_closed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: plan_unavailable, cycle_unavailable, option_invalid, hostname_invalid, image_unavailable, ssh_key_invalid, ssh_key_unknown, too_many_ssh_keys, origin_invalid, quote_incomplete, billing_currency_unknown, coupon_invalid, idempotency_mismatch. - `429`: A rate limit was reached. Codes: order_limit_reached, rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: orders_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/orders \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"items":[{"planId":"vps-nvme-4-mumbai","billingCycleMonths":1,"hostname":"node1.acme.example","imageId":"ubuntu-24.04","sshKeyIds":["2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f"],"label":"node1","reference":"client-4471","metadata":{"whmcsServiceId":"18342","plan":"starter"}}],"payment":{"method":"wallet"},"reference":"order-99120","metadata":{"source":"whmcs"}}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const order = await cx.orders.create({ items: [ { planId: "vps-nvme-4-mumbai", billingCycleMonths: 1, hostname: "node1.acme.example", imageId: "ubuntu-24.04", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ], label: "node1", reference: "client-4471", metadata: { whmcsServiceId: "18342", plan: "starter" } } ], payment: { method: "wallet" }, reference: "order-99120", metadata: { source: "whmcs" } }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/orders", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "items": [ { "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "imageId": "ubuntu-24.04", "sshKeyIds": [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", ], "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter", }, }, ], "payment": { "method": "wallet", }, "reference": "order-99120", "metadata": { "source": "whmcs", }, }, ) order = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $order = $cx->orders->create(['items' => [['planId' => 'vps-nvme-4-mumbai', 'billingCycleMonths' => 1, 'hostname' => 'node1.acme.example', 'imageId' => 'ubuntu-24.04', 'sshKeyIds' => ['2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f'], 'label' => 'node1', 'reference' => 'client-4471', 'metadata' => ['whmcsServiceId' => '18342', 'plan' => 'starter']]], 'payment' => ['method' => 'wallet'], 'reference' => 'order-99120', 'metadata' => ['source' => 'whmcs']]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/orders", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ items: [ { planId: "vps-nvme-4-mumbai", billingCycleMonths: 1, hostname: "node1.acme.example", imageId: "ubuntu-24.04", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ], label: "node1", reference: "client-4471", metadata: { whmcsServiceId: "18342", plan: "starter" } } ], payment: { method: "wallet" }, reference: "order-99120", metadata: { source: "whmcs" } }), }); const order = await res.json(); ``` ### Response (`201`) ```json { "object": "order", "id": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "status": "paid", "items": [ { "id": "2b8e4f1a-7c3d-4a6e-9b2f-5d1c8a0e3f7b", "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "label": "node1", "price": { "amount": 129900, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "actionId": "7d2a9f4c-1b8e-4c5a-a3f6-9e0b2d7c4a1f", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "couponCode": null, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "reference": "order-99120", "metadata": { "source": "whmcs" }, "createdAt": "2026-12-04T09:15:22Z", "paidAt": "2026-12-04T09:15:24Z", "completedAt": null, "cancelledAt": null, "livemode": true } ``` ## Get an order `GET /orders/{orderId}` Use this to check an order's status and the services it made. Token scope: `orders:read`. ### Path parameters - `orderId` (string (uuid), required): The order's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The order. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const order = await cx.orders.get("e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) order = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $order = $cx->orders->get('e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const order = await res.json(); ``` ### Response (`200`) ```json { "object": "order", "id": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "status": "paid", "items": [ { "id": "2b8e4f1a-7c3d-4a6e-9b2f-5d1c8a0e3f7b", "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "label": "node1", "price": { "amount": 129900, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "actionId": "7d2a9f4c-1b8e-4c5a-a3f6-9e0b2d7c4a1f", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "couponCode": null, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "reference": "order-99120", "metadata": { "source": "whmcs" }, "createdAt": "2026-12-04T09:15:22Z", "paidAt": "2026-12-04T09:15:24Z", "completedAt": null, "cancelledAt": null, "livemode": true } ``` ## Update an order `PATCH /orders/{orderId}` Use this to keep your own bookkeeping on an order. It changes nothing else. Token scope: `orders:write`. ### Path parameters - `orderId` (string (uuid), required): The order's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Metadata keys to set (a string) or remove (null). Keys you leave out are kept. max 20 keys. ### Responses - `200`: The order. - `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PATCH https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"reference":"order-99120-b"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const order = await cx.orders.update("e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", { reference: "order-99120-b" }); ``` Python: ```python import os import requests res = requests.patch( "https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "reference": "order-99120-b", }, ) order = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $order = $cx->orders->update('e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f', ['reference' => 'order-99120-b']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/orders/e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ reference: "order-99120-b" }), }); const order = await res.json(); ``` ### Response (`200`) ```json { "object": "order", "id": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "status": "paid", "items": [ { "id": "2b8e4f1a-7c3d-4a6e-9b2f-5d1c8a0e3f7b", "planId": "vps-nvme-4-mumbai", "billingCycleMonths": 1, "hostname": "node1.acme.example", "label": "node1", "price": { "amount": 129900, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "actionId": "7d2a9f4c-1b8e-4c5a-a3f6-9e0b2d7c4a1f", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" } } ], "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "total": { "amount": 153282, "currency": "INR" }, "couponCode": null, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "reference": "order-99120-b", "metadata": { "source": "whmcs" }, "createdAt": "2026-12-04T09:15:22Z", "paidAt": "2026-12-04T09:15:24Z", "completedAt": null, "cancelledAt": null, "livemode": true } ``` --- # Services > Your VPS, Dedicated and proxy services. Source: https://docs.clouduxe.com/api/reference/services/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Service object A VPS, a Dedicated server or a protected proxy on your account. ### Attributes - `object` (string, required): The object's type. Always "service". - `id` (string (uuid), required): The service's id. - `type` (string, required): vps, dedicated or proxy. One of `vps`, `dedicated`, `proxy`. - `status` (string, required): pending (paid and waiting for set-up to start), provisioning, active, suspended, failed (set-up failed; staff are on it), terminating (deletion scheduled at deletesAt) or terminated. One of `pending`, `provisioning`, `active`, `suspended`, `failed`, `terminating`, `terminated`. - `suspensionReason` (string or null, required): Why the service is suspended: overdue (an unpaid invoice) or other (contact support). Null unless suspended. One of `overdue`, `other`. - `deletesAt` (string (date-time) or null, required): When a terminating service's server will be deleted, or null. - `planId` (string, required): The plan's id. - `planName` (string or null, required): The plan's name. - `region` (string or null, required): The region, or null for a proxy. One of `mumbai`, `singapore`, `limburg`. - `label` (string or null, required): Your label for the service. max length 253. - `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object, required): Your own key-value data on this object. max 20 keys. - `firewallAvailable` (boolean, required): True when the service has a Shield firewall you can manage through the firewall operations. - `billing` (object or null, required): Billing details, for the account owner's tokens. Null for a delegate's token. - `cycleMonths` (integer, required): The billing cycle in months. - `price` (object or null, required): The renewal price per cycle, excluding GST, locked when the service was bought. Null when it cannot be read. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `currentPeriodStart` (string (date), required): The first day of the current period, a UTC calendar day. - `paidThrough` (string (date), required): The last day paid for, a UTC calendar day. The renewal invoice for the next period is issued before it. - `cancelAtPeriodEnd` (boolean, required): True when the service will end on paidThrough instead of renewing. - `endsOn` (string (date) or null, required): The day the service ends, when cancelAtPeriodEnd is true; otherwise null. - `server` (object or null, required): For vps and dedicated; null for proxy. - `powerState` (string, required): running, stopped, building (being built or reinstalled), suspended, missing (the server cannot be found; staff are notified) or unknown. One of `running`, `stopped`, `building`, `suspended`, `missing`, `unknown`. - `hostname` (string or null, required): The hostname you set at order or reinstall. - `ipv4` (array of string, required): The server's IPv4 addresses, primary first. - `ipv6` (array of string, required): The server's IPv6 addresses. - `image` (object or null, required): The installed image, or null when not known. - `object` (string, required): The object's type. Always "image". - `id` (string, required): The image's id. Pass it as imageId. - `name` (string, required): The image's name, for showing to people. - `family` (string, required): linux or windows. A root password reset sets the password of Administrator on windows and of root otherwise. One of `linux`, `windows`. - `resources` (object or null, required): The server's resources, or null when not known. - `cpuCores` (integer or null, required): Virtual CPU cores, or null when not known. - `memoryMb` (integer or null, required): Memory in MiB, or null. - `diskGb` (integer or null, required): Disk in GB, or null. - `trafficGb` (integer or null, required): Monthly traffic allowance in GB, or null for unmetered or unknown. - `statusUpdatedAt` (string (date-time) or null, required): When this state was read. - `stale` (boolean, required): True when the state is more than 5 minutes old. - `proxy` (object or null, required): For proxy; null otherwise. - `profile` (string, required): The protection profile. - `ports` (array of ProxyPort, required): The protected ports. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port, equal to portStart for one port. min 1, max 65535. - `createdAt` (string (date-time), required): When the service was created. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true } ``` ## List services `GET /services` Use this to find services, newest first: filter by type, status, region, reference or metadata. A delegate's token lists only the services shared with that person. Token scope: `services:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `type` (string): Only this product type. One of `vps`, `dedicated`, `proxy`. - `status` (string): Only this status. One of `pending`, `provisioning`, `active`, `suspended`, `failed`, `terminating`, `terminated`. - `region` (string): Only this region. One of `mumbai`, `singapore`, `limburg`. - `reference` (string): Only objects with exactly this reference. max length 100. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of services. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const service of cx.services.list()) { console.log(service.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->services->list() as $service) { echo $service->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true }, { "object": "service", "id": "4e9b2d7a-1c6f-4b3e-a8d2-7f5c0e9a1b4d", "type": "dedicated", "status": "provisioning", "suspensionReason": null, "deletesAt": null, "planId": "dedicated-e5-64-limburg", "planName": "Dedicated E5 64 GB", "region": "limburg", "label": "db-primary", "reference": "client-4471", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 1149900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "unknown", "hostname": "db1.acme.example", "ipv4": [], "ipv6": [], "image": null, "resources": null, "statusUpdatedAt": null, "stale": false }, "proxy": null, "createdAt": "2026-12-03T14:40:05Z", "livemode": true }, { "object": "service", "id": "a7d4c1e9-3f2b-4d8a-9c6e-0b5a2f7d3e1c", "type": "proxy", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "proxy-game-standard", "planName": "Protected Proxy Standard", "region": null, "label": "game-proxy", "reference": "client-5102", "metadata": {}, "firewallAvailable": false, "billing": { "cycleMonths": 1, "price": { "amount": 249900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": null, "proxy": { "profile": "fivem", "ports": [ { "protocol": "tcp", "portStart": 30120, "portEnd": 30120 }, { "protocol": "udp", "portStart": 30120, "portEnd": 30120 } ] }, "createdAt": "2026-11-28T11:02:19Z", "livemode": true } ], "hasMore": true, "nextCursor": "eyJsIjoic2VydmljZXMiLCJjIjoiMjAyNi0xMi0wNFQwOToxNToyMloifQ.x7Hq2N" } ``` ## Get a service `GET /services/{serviceId}` Use this to read a service's status, billing, addresses, power state and resources. The server state comes from a cache refreshed about every minute; stale is true when it is older than 5 minutes. Token scope: `services:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The service. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const service = await cx.services.get("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) service = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $service = $cx->services->get('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const service = await res.json(); ``` ### Response (`200`) ```json { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true } ``` ## Update a service `PATCH /services/{serviceId}` Use this for your own bookkeeping on a service. It does not change the server. Token scope: `services:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `label` (string or null): Your label for the service, 1 to 253 characters, or null to clear it. min length 1, max length 253. - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Metadata keys to set (a string) or remove (null). Keys you leave out are kept. max 20 keys. ### Responses - `200`: The service. - `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PATCH https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"label":"node1-eu","metadata":{"plan":"pro"}}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const service = await cx.services.update("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { label: "node1-eu", metadata: { plan: "pro" } }); ``` Python: ```python import os import requests res = requests.patch( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "label": "node1-eu", "metadata": { "plan": "pro", }, }, ) service = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $service = $cx->services->update('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['label' => 'node1-eu', 'metadata' => ['plan' => 'pro']]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ label: "node1-eu", metadata: { plan: "pro" } }), }); const service = await res.json(); ``` ### Response (`200`) ```json { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1-eu", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true } ``` ## List a server's OS images `GET /services/{serviceId}/images` Use this before reinstallService to pick an imageId. Token scope: `services:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The images. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const image of cx.services.listImages("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) { console.log(image.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->services->listImages('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $image) { echo $image->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, { "object": "image", "id": "debian-12", "name": "Debian 12", "family": "linux" }, { "object": "image", "id": "windows-server-2022", "name": "Windows Server 2022", "family": "windows" } ], "hasMore": false, "nextCursor": null } ``` ## Get a service's traffic `GET /services/{serviceId}/usage` Use this to read traffic used in the current traffic period against the allowance. The traffic period is the server's own monthly traffic cycle, which can differ from its billing period. Token scope: `services:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The usage. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const usage = await cx.services.getUsage("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) usage = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $usage = $cx->services->getUsage('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const usage = await res.json(); ``` ### Response (`200`) ```json { "object": "usage", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "periodStart": "2026-12-04", "periodEnd": "2027-01-03", "inboundBytes": 48213904512, "outboundBytes": 311420019712, "allowanceBytes": 4000000000000, "updatedAt": "2026-12-04T10:02:41Z" } ``` ## List plan change options `GET /services/{serviceId}/plan-options` Use this before changeServicePlan: each option has its price per cycle and what changing now costs. Token scope: `services:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The options. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `423`: The service is locked. Codes: service_locked. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const planOption of cx.services.listPlanOptions("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) { console.log(planOption.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->services->listPlanOptions('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $planOption) { echo $planOption->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "plan_option", "planId": "vps-nvme-8-mumbai", "name": "NVMe VPS 8 GB", "kind": "upgrade", "price": { "amount": 239900, "currency": "INR" }, "charge": { "amount": 106400, "currency": "INR" } } ], "hasMore": false, "nextCursor": null } ``` --- # Server actions > Power, console, reinstall and password reset, and the actions they start. Source: https://docs.clouduxe.com/api/reference/server-actions/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Action object A long-running change to a service: a power action, a reinstall, a password reset, a plan change, a termination or provisioning. Poll it with getAction, or listen for action.completed. ### Attributes - `object` (string, required): The object's type. Always "action". - `id` (string (uuid), required): The action's id. - `type` (string, required): What the action does. One of `boot`, `shutdown`, `restart`, `poweroff`, `reinstall`, `reset_password`, `plan_change`, `terminate`, `provision`. - `status` (string, required): queued (recorded, not started; provisioning of a dedicated server or a proxy can stay here for hours while staff set it up), running (sent; waiting for the server to show the result), succeeded, failed, or unknown (the platform's answer was lost and the result was not confirmed in time; check the service). succeeded, failed and unknown are final and never change. One of `queued`, `running`, `succeeded`, `failed`, `unknown`. - `serviceId` (string (uuid) or null, required): The service the action acts on. Null for a provision action until its service exists. - `orderId` (string (uuid) or null, required): The order a provision action belongs to, or null. - `invoiceId` (string (uuid) or null, required): The invoice a plan change created, or null. - `failure` (object or null, required): Set when status is failed; otherwise null. - `code` (string, required): platform_refused, platform_unavailable, provisioning_failed (staff are notified and will contact you), order_rejected (the order failed review; its payment returns to wallet credit), order_cancelled or service_locked. One of `platform_refused`, `platform_unavailable`, `provisioning_failed`, `order_rejected`, `order_cancelled`, `service_locked`. - `message` (string, required): A sentence for a person. - `secretAvailable` (boolean, required): True while a secret this action set (a root or Administrator password) can be read with getActionSecret. Only the account owner's tokens can read it. It turns false when you delete it, after 5 reads, or when it expires. - `secretExpiresAt` (string (date-time) or null, required): When the secret is deleted unread or not (60 minutes after the action succeeded), or null when there is none. - `createdAt` (string (date-time), required): When the action was requested. - `startedAt` (string (date-time) or null, required): When it was sent to the platform, or null while queued. - `completedAt` (string (date-time) or null, required): When it reached a final status, or null. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "restart", "status": "running", "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": null, "livemode": true } ``` ## Run a power action `POST /services/{serviceId}/power` Use this to change a VPS's power state. shutdown asks the OS to stop cleanly; poweroff cuts power at once. Answers an action: wait for it with getAction or the action.completed event. Limited to 30 power actions per service in 10 minutes. Token scope: `services:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `action` (string, required): boot, shutdown (a clean shutdown through the OS), restart, or poweroff (cut power at once, like pulling the plug). One of `boot`, `shutdown`, `restart`, `poweroff`. ### Responses - `202`: The action, started. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready, service_building, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed. - `429`: A rate limit was reached. Codes: action_limit_reached, rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: actions_unavailable, platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/power \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"action":"restart"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const action = await cx.services.power("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { action: "restart" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/power", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "action": "restart", }, ) action = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->services->power('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['action' => 'restart']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/power", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ action: "restart" }), }); const action = await res.json(); ``` ### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "restart", "status": "running", "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": null, "livemode": true } ``` ## Reinstall a server `POST /services/{serviceId}/reinstall` Use this to rebuild a VPS with a new OS, hostname and, for owner tokens, your SSH keys. Everything on the disk is lost. Answers an action that runs for several minutes. When the build sets a password (always for Windows, and when no SSH key is given), the action's secret holds it once it succeeds: retrieve it with getActionSecret within 60 minutes, up to 5 times. If the outcome is unknown, another reinstall is refused for up to 15 minutes. Limited to 5 per service per hour. Token scope: `services:destructive`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `imageId` (string, required): The image to install, from listServiceImages. - `hostname` (string, required): The server's new hostname. RFC 1123 labels of 1 to 63 letters, digits and hyphens, no label starting or ending with a hyphen, 253 characters in all, no trailing dot. Single-label names (such as node1) and names that look like an IP address (such as 1.2.3.4: the last label must hold a letter) are refused. Stored in lower case. max length 253, pattern ^(?=.{1,253}$)(?=.*[A-Za-z][A-Za-z0-9-]*$)[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$. - `sshKeyIds` (array of string (uuid)): SSH keys from your library to install for root. At most 10. Owner tokens only: a delegate's token must leave this empty. max items 10. ### Responses - `202`: The action, started. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ssh_keys_not_allowed, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready, service_building, reinstall_in_doubt, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: image_unavailable, hostname_invalid, ssh_key_unknown, too_many_ssh_keys, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed. - `429`: A rate limit was reached. Codes: action_limit_reached, rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: actions_unavailable, platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reinstall \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"imageId":"ubuntu-24.04","hostname":"node1.acme.example","sshKeyIds":["2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f"]}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const action = await cx.services.reinstall("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { imageId: "ubuntu-24.04", hostname: "node1.acme.example", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ] }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reinstall", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "imageId": "ubuntu-24.04", "hostname": "node1.acme.example", "sshKeyIds": [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", ], }, ) action = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->services->reinstall('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['imageId' => 'ubuntu-24.04', 'hostname' => 'node1.acme.example', 'sshKeyIds' => ['2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f']]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reinstall", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ imageId: "ubuntu-24.04", hostname: "node1.acme.example", sshKeyIds: [ "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f" ] }), }); const action = await res.json(); ``` ### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "reinstall", "status": "running", "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": null, "livemode": true } ``` ## Reset a server's password `POST /services/{serviceId}/reset-password` Use this when root (or Administrator on Windows) access is lost. Answers the reset_password action. With delivery api, when the action succeeds its secret holds the new password: retrieve it with getActionSecret within 60 minutes, up to 5 times. With delivery email, it is emailed to the account owner instead. Owner tokens only. Limited to 5 per service per hour. Token scope: `services:destructive`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `delivery` (string, required): email (the password is emailed to the account owner) or api (the action's secret holds it: retrieve it with getActionSecret within 60 minutes, up to 5 times; nothing is emailed). One of `email`, `api`. ### Responses - `202`: The reset, started. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready, service_building, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed. - `429`: A rate limit was reached. Codes: action_limit_reached, rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: actions_unavailable, platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reset-password \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"delivery":"api"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const action = await cx.services.resetPassword("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { delivery: "api" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reset-password", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "delivery": "api", }, ) action = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->services->resetPassword('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['delivery' => 'api']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/reset-password", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ delivery: "api" }), }); const action = await res.json(); ``` ### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "reset_password", "status": "running", "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": null, "livemode": true } ``` ## List a service's actions `GET /services/{serviceId}/actions` Use this to see what ran on a service, newest first. Token scope: `services:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of actions. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/actions \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript 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); } ``` Python: ```python 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 SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->services->listActions('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $action) { echo $action->id, PHP_EOL; } ``` fetch: ```javascript 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(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "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 } ], "hasMore": false, "nextCursor": null } ``` ## Get an action `GET /actions/{actionId}` Use this to poll a long-running change until its status is succeeded, failed or unknown. Poll at most every 2 seconds, or use the action.completed event instead. Token scope: `services:read`. ### Path parameters - `actionId` (string (uuid), required): The action's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The action. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript 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"); ``` Python: ```python 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 SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->actions->get('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a'); ``` fetch: ```javascript 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(); ``` ### Response (`200`) ```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 } ``` ## Retrieve an action's secret `GET /actions/{actionId}/secret` Use this after an action with secretAvailable true succeeds: a provision or reinstall that set a password, or a password reset with delivery api. Owner tokens only, and only the token that started the action (for a provision, the token that placed the order). You may read it up to 5 times until it expires (60 minutes after the action succeeded), so a retry after a lost answer works; every read is audited. Store it, then delete it with deleteActionSecret. A 410 is final. Needs services:destructive, or orders:write for a provision action. Token scope: `services:destructive`, `orders:write`. ### Path parameters - `actionId` (string (uuid), required): The action's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The secret. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `410`: Gone. Codes: secret_unavailable. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/actions/f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a/secret \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript 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"); ``` Python: ```python 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 SDK: ```php getenv('CLOUDUXE_API_KEY')]); $actionSecret = $cx->actions->getSecret('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a'); ``` fetch: ```javascript 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(); ``` ### Response (`200`) ```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" } ``` ## Delete an action's secret `DELETE /actions/{actionId}/secret` Use this as soon as you have stored the secret from getActionSecret, so it can never be read again. Deleting a secret that is already gone answers the same. Token scope: `services:destructive`, `orders:write`. ### Path parameters - `actionId` (string (uuid), required): The action's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The action, with secretAvailable false. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash 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" ``` Node SDK: ```javascript 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"); ``` Python: ```python 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 SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->actions->deleteSecret('f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a'); ``` fetch: ```javascript 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(); ``` ### Response (`200`) ```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 } ``` --- # Lifecycle > Plan changes, cancellation and termination. Source: https://docs.clouduxe.com/api/reference/lifecycle/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Service object A VPS, a Dedicated server or a protected proxy on your account. ### Attributes - `object` (string, required): The object's type. Always "service". - `id` (string (uuid), required): The service's id. - `type` (string, required): vps, dedicated or proxy. One of `vps`, `dedicated`, `proxy`. - `status` (string, required): pending (paid and waiting for set-up to start), provisioning, active, suspended, failed (set-up failed; staff are on it), terminating (deletion scheduled at deletesAt) or terminated. One of `pending`, `provisioning`, `active`, `suspended`, `failed`, `terminating`, `terminated`. - `suspensionReason` (string or null, required): Why the service is suspended: overdue (an unpaid invoice) or other (contact support). Null unless suspended. One of `overdue`, `other`. - `deletesAt` (string (date-time) or null, required): When a terminating service's server will be deleted, or null. - `planId` (string, required): The plan's id. - `planName` (string or null, required): The plan's name. - `region` (string or null, required): The region, or null for a proxy. One of `mumbai`, `singapore`, `limburg`. - `label` (string or null, required): Your label for the service. max length 253. - `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object, required): Your own key-value data on this object. max 20 keys. - `firewallAvailable` (boolean, required): True when the service has a Shield firewall you can manage through the firewall operations. - `billing` (object or null, required): Billing details, for the account owner's tokens. Null for a delegate's token. - `cycleMonths` (integer, required): The billing cycle in months. - `price` (object or null, required): The renewal price per cycle, excluding GST, locked when the service was bought. Null when it cannot be read. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `currentPeriodStart` (string (date), required): The first day of the current period, a UTC calendar day. - `paidThrough` (string (date), required): The last day paid for, a UTC calendar day. The renewal invoice for the next period is issued before it. - `cancelAtPeriodEnd` (boolean, required): True when the service will end on paidThrough instead of renewing. - `endsOn` (string (date) or null, required): The day the service ends, when cancelAtPeriodEnd is true; otherwise null. - `server` (object or null, required): For vps and dedicated; null for proxy. - `powerState` (string, required): running, stopped, building (being built or reinstalled), suspended, missing (the server cannot be found; staff are notified) or unknown. One of `running`, `stopped`, `building`, `suspended`, `missing`, `unknown`. - `hostname` (string or null, required): The hostname you set at order or reinstall. - `ipv4` (array of string, required): The server's IPv4 addresses, primary first. - `ipv6` (array of string, required): The server's IPv6 addresses. - `image` (object or null, required): The installed image, or null when not known. - `object` (string, required): The object's type. Always "image". - `id` (string, required): The image's id. Pass it as imageId. - `name` (string, required): The image's name, for showing to people. - `family` (string, required): linux or windows. A root password reset sets the password of Administrator on windows and of root otherwise. One of `linux`, `windows`. - `resources` (object or null, required): The server's resources, or null when not known. - `cpuCores` (integer or null, required): Virtual CPU cores, or null when not known. - `memoryMb` (integer or null, required): Memory in MiB, or null. - `diskGb` (integer or null, required): Disk in GB, or null. - `trafficGb` (integer or null, required): Monthly traffic allowance in GB, or null for unmetered or unknown. - `statusUpdatedAt` (string (date-time) or null, required): When this state was read. - `stale` (boolean, required): True when the state is more than 5 minutes old. - `proxy` (object or null, required): For proxy; null otherwise. - `profile` (string, required): The protection profile. - `ports` (array of ProxyPort, required): The protected ports. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port, equal to portStart for one port. min 1, max 65535. - `createdAt` (string (date-time), required): When the service was created. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true } ``` ## Change a service's plan `POST /services/{serviceId}/plan-change` Use this to upgrade a service. The charge for the rest of the period is invoiced and paid from wallet credit in one step; if credit does not cover it, nothing is written (insufficient_credit). Answers a plan_change action: it stays queued while the change waits to be applied (by Clouduxe's team when automatic apply is off), and succeeds once the platform has the new plan. A VPS gets its new memory and disk at its next power cycle. Token scope: `services:lifecycle`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `planId` (string, required): The target plan's id, from listServicePlanOptions. ### Responses - `202`: The plan change, started. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `402`: Payment from wallet credit is not possible. Codes: insufficient_credit, credit_currency_mismatch. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: service_not_ready, plan_change_open, previous_change_pending, plan_change_too_soon, renewal_in_progress, currency_not_offered, account_closed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: plan_change_not_allowed, quote_incomplete, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: plan_change_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-change \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"planId":"vps-nvme-8-mumbai"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const action = await cx.services.changePlan("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { planId: "vps-nvme-8-mumbai" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-change", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "planId": "vps-nvme-8-mumbai", }, ) action = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->services->changePlan('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['planId' => 'vps-nvme-8-mumbai']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-change", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ planId: "vps-nvme-8-mumbai" }), }); const action = await res.json(); ``` ### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "plan_change", "status": "running", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "orderId": null, "invoiceId": "b2c7e4a9-5f1d-4e8b-9a3c-6d0f2e7b1c5a", "failure": null, "secretAvailable": false, "secretExpiresAt": null, "createdAt": "2026-12-04T09:20:11Z", "startedAt": "2026-12-04T09:20:11Z", "completedAt": null, "livemode": true } ``` ## Set cancellation at period end `PUT /services/{serviceId}/cancellation` Use this to stop a service renewing: it keeps running until its paidThrough day, then ends. Send false to keep it renewing. No refund is made. Token scope: `services:lifecycle`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `cancelAtPeriodEnd` (boolean, required): true to end the service on its paidThrough day; false to keep it renewing. - `reason` (string or null): Why, for our records. Optional. max length 2000. ### Responses - `200`: The service. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: termination_pending, service_ended, cancellation_final, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PUT https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/cancellation \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"cancelAtPeriodEnd":true,"reason":"Customer moved to another plan."}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const service = await cx.services.setCancellation("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { cancelAtPeriodEnd: true, reason: "Customer moved to another plan." }); ``` Python: ```python import os import requests res = requests.put( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/cancellation", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "cancelAtPeriodEnd": True, "reason": "Customer moved to another plan.", }, ) service = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $service = $cx->services->setCancellation('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['cancelAtPeriodEnd' => true, 'reason' => 'Customer moved to another plan.']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/cancellation", { method: "PUT", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ cancelAtPeriodEnd: true, reason: "Customer moved to another plan." }), }); const service = await res.json(); ``` ### Response (`200`) ```json { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": true, "endsOn": "2027-01-03" }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true } ``` ## Terminate a service `POST /services/{serviceId}/terminate` Use this to end a service immediately, for example when your customer leaves. The current period is not refunded. A renewal already issued for a later period is credited, and any wallet credit it took is returned to the wallet. The service becomes terminating with deletesAt, and its server and data are deleted at that time. Answers a terminate action. Token scope: `services:destructive`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `confirm` (string (uuid), required): The service's own id, to confirm you mean this service. ### Responses - `202`: The termination, started. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: termination_pending, account_closed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: confirmation_mismatch, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/terminate \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"confirm":"c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const action = await cx.services.terminate("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { confirm: "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/terminate", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "confirm": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", }, ) action = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $action = $cx->services->terminate('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['confirm' => 'c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/terminate", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ confirm: "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d" }), }); const action = await res.json(); ``` ### Response (`202`) ```json { "object": "action", "id": "f5c8b2a1-6e3d-4c9f-b1a7-3d2e9c0f4b6a", "type": "terminate", "status": "running", "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": null, "livemode": true } ``` --- # Firewall > A server's Shield firewall. Source: https://docs.clouduxe.com/api/reference/firewall/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Firewall object A server's Shield firewall. ### Attributes - `object` (string, required): The object's type. Always "firewall". - `serviceId` (string (uuid), required): The service's id. - `enabled` (boolean, required): Whether protection is on. - `defaultPolicy` (string, required): What happens to ports no enabled rule covers: allow or deny. One of `allow`, `deny`. - `rules` (array of FirewallRule, required): The inbound rules, at most 15. max items 15. - `id` (string, required): The rule's id: its protocol and first port, such as tcp-30120. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port. min 1, max 65535. - `profile` (string, required): The protection profile that inspects this traffic, such as fivem or generic. pattern ^[A-Za-z0-9_-]{1,40}$. - `enabled` (boolean, required): Whether the rule is on. - `ppsLimit` (integer, required): Packets per second allowed to the whole port range; 0 means no extra limit. min 0. - `connectionPpsLimit` (integer, required): Packets per second allowed per established connection; 0 means no extra limit. min 0. - `newConnectionsPerSecond` (integer, required): New connections per second allowed from one source address, 0 to 30; 0 means no extra limit. min 0, max 30. - `onlyProxied` (boolean, required): Accept only traffic that arrives through Clouduxe's protected proxy. - `blockUdp` (boolean, required): Drop UDP to this range. - `protocolValidation` (boolean, required): Check that traffic follows the profile's protocol, and drop what does not. - `blockedIps` (array of BlockedIp, required): Blocked source addresses. - `ip` (string, required): The IPv4 address. - `expiresAt` (string (date-time) or null, required): When the block ends, or null for no end. - `trustedIps` (array of TrustedIp, required): Trusted source addresses. - `ip` (string, required): The IPv4 address. - `note` (string or null, required): Your note. - `updatedAt` (string (date-time) or null, required): When this state was read. ### Example ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Get a firewall `GET /services/{serviceId}/firewall` Use this to read a VPS's or Dedicated server's Shield firewall: protection on or off, the default policy, port rules, blocked and trusted addresses. Only for services with firewallAvailable true. Token scope: `firewall:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.get("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->get('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Turn protection on or off `PUT /services/{serviceId}/firewall/protection` Use this to switch Shield filtering for the server on or off. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `enabled` (boolean, required): true to filter traffic, false to pass it unfiltered. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PUT https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/protection \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"enabled":true}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.setProtection("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { enabled: true }); ``` Python: ```python import os import requests res = requests.put( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/protection", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "enabled": True, }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->setProtection('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['enabled' => true]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/protection", { method: "PUT", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ enabled: true }), }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Set the default policy `PUT /services/{serviceId}/firewall/default-policy` Use this to allow or deny traffic to ports without an enabled rule. Deny is refused while no rule is enabled. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `defaultPolicy` (string, required): allow or deny. One of `allow`, `deny`. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, firewall_would_block_all, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PUT https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/default-policy \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"defaultPolicy":"deny"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.setDefaultPolicy("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { defaultPolicy: "deny" }); ``` Python: ```python import os import requests res = requests.put( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/default-policy", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "defaultPolicy": "deny", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->setDefaultPolicy('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['defaultPolicy' => 'deny']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/default-policy", { method: "PUT", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ defaultPolicy: "deny" }), }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Add a firewall rule `POST /services/{serviceId}/firewall/rules` Use this to open and protect a port range with a protection profile. A server has at most 15 rules, and rules of one protocol cannot overlap. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port, at least portStart. min 1, max 65535. - `profile` (string, required): The protection profile. pattern ^[A-Za-z0-9_-]{1,40}$. - `enabled` (boolean): Whether the rule is on. Default true. - `ppsLimit` (integer): Default 0. min 0, max 4294967295. - `connectionPpsLimit` (integer): Default 0. min 0, max 4294967295. - `newConnectionsPerSecond` (integer): Default 0. min 0, max 30. - `onlyProxied` (boolean): Default false. - `blockUdp` (boolean): Default false. - `protocolValidation` (boolean, required): Whether to check traffic against the profile's protocol. ### Responses - `201`: The firewall, with the new rule. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, firewall_rule_overlap, firewall_rule_exists, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: firewall_rule_limit, firewall_value_refused, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"protocol":"tcp","portStart":30120,"portEnd":30120,"profile":"fivem","newConnectionsPerSecond":10,"protocolValidation":true}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.createRule("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { protocol: "tcp", portStart: 30120, portEnd: 30120, profile: "fivem", newConnectionsPerSecond: 10, protocolValidation: true }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "newConnectionsPerSecond": 10, "protocolValidation": True, }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->createRule('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['protocol' => 'tcp', 'portStart' => 30120, 'portEnd' => 30120, 'profile' => 'fivem', 'newConnectionsPerSecond' => 10, 'protocolValidation' => true]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ protocol: "tcp", portStart: 30120, portEnd: 30120, profile: "fivem", newConnectionsPerSecond: 10, protocolValidation: true }), }); const firewall = await res.json(); ``` ### Response (`201`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Update a firewall rule `PATCH /services/{serviceId}/firewall/rules/{ruleId}` Use this to change a rule's ports, profile, limits or checks, or to switch it off. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. - `ruleId` (string, required): The rule's id, such as tcp-30120. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `portStart` (integer): The first port. min 1, max 65535. - `portEnd` (integer): The last port. min 1, max 65535. - `profile` (string): The protection profile. pattern ^[A-Za-z0-9_-]{1,40}$. - `enabled` (boolean): Whether the rule is on. - `ppsLimit` (integer): Packets per second to the range. min 0, max 4294967295. - `connectionPpsLimit` (integer): Packets per second per connection. min 0, max 4294967295. - `newConnectionsPerSecond` (integer): New connections per second per source. min 0, max 30. - `onlyProxied` (boolean): Accept only proxied traffic. - `blockUdp` (boolean): Drop UDP. - `protocolValidation` (boolean): Check the profile's protocol. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, firewall_rule_overlap, firewall_would_block_all, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: firewall_value_refused, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PATCH https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120 \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"newConnectionsPerSecond":15}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.updateRule("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "tcp-30120", { newConnectionsPerSecond: 15 }); ``` Python: ```python import os import requests res = requests.patch( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "newConnectionsPerSecond": 15, }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->updateRule('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', 'tcp-30120', ['newConnectionsPerSecond' => 15]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ newConnectionsPerSecond: 15 }), }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Delete a firewall rule `DELETE /services/{serviceId}/firewall/rules/{ruleId}` Use this to close a port range. Refused when it would leave no enabled rule while the default policy denies. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. - `ruleId` (string, required): The rule's id, such as tcp-30120. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, firewall_would_block_all, idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120 \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.deleteRule("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "tcp-30120"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->deleteRule('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', 'tcp-30120'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/rules/tcp-30120", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Block an address `POST /services/{serviceId}/firewall/blocked-ips` Use this to drop all traffic from one IPv4 address, for a time or for good. The server's own address and addresses that serve its protection cannot be blocked. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `ip` (string (ipv4), required): One IPv4 address. - `expiresInSeconds` (integer): How long the block lasts, 60 seconds to one year. Omit it for no end. min 60, max 31536000. ### Responses - `201`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, ip_already_listed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: ip_address_invalid, ip_range_unsupported, ip_is_own_address, ip_is_infrastructure, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"ip":"198.51.100.77","expiresInSeconds":86400}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.blockIp("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { ip: "198.51.100.77", expiresInSeconds: 86400 }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "ip": "198.51.100.77", "expiresInSeconds": 86400, }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->blockIp('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['ip' => '198.51.100.77', 'expiresInSeconds' => 86400]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ ip: "198.51.100.77", expiresInSeconds: 86400 }), }); const firewall = await res.json(); ``` ### Response (`201`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Unblock an address `DELETE /services/{serviceId}/firewall/blocked-ips/{ip}` Use this to lift a block. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. - `ip` (string (ipv4), required): The IPv4 address. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: ip_address_invalid, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips/198.51.100.77 \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.unblockIp("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "198.51.100.77"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips/198.51.100.77", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->unblockIp('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', '198.51.100.77'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/blocked-ips/198.51.100.77", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Trust an address `POST /services/{serviceId}/firewall/trusted-ips` Use this so traffic from one IPv4 address, such as your monitoring, is never filtered. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `ip` (string (ipv4), required): One IPv4 address. - `note` (string): A note, at most 200 characters on one line. max length 200. ### Responses - `201`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, ip_already_listed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: ip_address_invalid, ip_range_unsupported, ip_is_infrastructure, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"ip":"192.0.2.15","note":"Office"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.trustIp("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { ip: "192.0.2.15", note: "Office" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "ip": "192.0.2.15", "note": "Office", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->trustIp('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['ip' => '192.0.2.15', 'note' => 'Office']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ ip: "192.0.2.15", note: "Office" }), }); const firewall = await res.json(); ``` ### Response (`201`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Untrust an address `DELETE /services/{serviceId}/firewall/trusted-ips/{ip}` Use this to remove an address from the trusted list. Addresses that serve the server's protection cannot be removed. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. - `ip` (string (ipv4), required): The IPv4 address. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: ip_address_invalid, ip_is_infrastructure, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips/192.0.2.15 \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.untrustIp("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "192.0.2.15"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips/192.0.2.15", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->untrustIp('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', '192.0.2.15'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/trusted-ips/192.0.2.15", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const firewall = await res.json(); ``` ### Response (`200`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## Apply a firewall preset `POST /services/{serviceId}/firewall/presets` Use this to add a ready-made rule set for a common server. Rules that would overlap an existing rule, or pass the 15-rule cap, are skipped. Token scope: `firewall:write`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `presetId` (string, required): A preset's id, from listFirewallPresets. ### Responses - `201`: The firewall. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: firewall_not_available, firewall_preset_covered, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: firewall_preset_unavailable, firewall_rule_limit, idempotency_mismatch. - `423`: The service is locked. Codes: service_locked, service_unconfirmed, firewall_resetting. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/presets \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"presetId":"minecraft-java"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const firewall = await cx.firewall.applyPreset("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { presetId: "minecraft-java" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/presets", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "presetId": "minecraft-java", }, ) firewall = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $firewall = $cx->firewall->applyPreset('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['presetId' => 'minecraft-java']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/firewall/presets", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ presetId: "minecraft-java" }), }); const firewall = await res.json(); ``` ### Response (`201`) ```json { "object": "firewall", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "enabled": true, "defaultPolicy": "deny", "rules": [ { "id": "tcp-30120", "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 10, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "udp-30120", "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 0, "onlyProxied": false, "blockUdp": false, "protocolValidation": true }, { "id": "tcp-22", "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true, "ppsLimit": 0, "connectionPpsLimit": 0, "newConnectionsPerSecond": 5, "onlyProxied": false, "blockUdp": false, "protocolValidation": false } ], "blockedIps": [ { "ip": "198.51.100.77", "expiresAt": "2026-12-05T10:00:00Z" } ], "trustedIps": [ { "ip": "192.0.2.15", "note": "Office" } ], "updatedAt": "2026-12-04T10:02:41Z" } ``` ## List firewall presets `GET /firewall-presets` Use this to pick a presetId for applyFirewallPreset. Token scope: `firewall:read`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The presets. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/firewall-presets \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const firewallPreset of cx.firewallPresets.list()) { console.log(firewallPreset.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/firewall-presets", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->firewallPresets->list() as $firewallPreset) { echo $firewallPreset->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/firewall-presets", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "firewall_preset", "id": "minecraft-java", "name": "Minecraft Java server", "rules": [ { "protocol": "tcp", "portStart": 25565, "portEnd": 25565 } ] } ], "hasMore": false, "nextCursor": null } ``` --- # SSH keys > Your SSH key library. Source: https://docs.clouduxe.com/api/reference/ssh-keys/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The SshKey object An SSH public key in your library, for VPS builds and reinstalls. ### Attributes - `object` (string, required): The object's type. Always "ssh_key". - `id` (string (uuid), required): The key's id. - `name` (string, required): The key's name. - `type` (string, required): The key type. One of `ssh-ed25519`, `ssh-rsa`, `ecdsa-sha2-nistp256`, `ecdsa-sha2-nistp384`, `ecdsa-sha2-nistp521`. - `fingerprint` (string, required): The key's SHA256 fingerprint, as ssh-keygen -l prints it. - `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object, required): Your own key-value data on this object. max 20 keys. - `createdAt` (string (date-time), required): When the key was added. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4471", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ``` ## List SSH keys `GET /ssh-keys` Use this to find key ids for createOrder and reinstallService. Owner tokens only. Token scope: `ssh_keys:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `reference` (string): Only objects with exactly this reference. max length 100. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of keys. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/ssh-keys \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const sshKey of cx.sshKeys.list()) { console.log(sshKey.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/ssh-keys", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->sshKeys->list() as $sshKey) { echo $sshKey->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/ssh-keys", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4471", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Add an SSH key `POST /ssh-keys` Use this to add a public key to your library, then pass its id when ordering or reinstalling. Token scope: `ssh_keys:write`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `name` (string, required): A name for the key, 1 to 64 printable characters. min length 1, max length 64. - `publicKey` (string, required): One OpenSSH public key line: ssh-ed25519, ecdsa-sha2-nistp256, -nistp384 or -nistp521, or ssh-rsa of at least 2048 bits, with an optional comment. max length 16384. - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Your own key-value data on this object. max 20 keys. ### Responses - `201`: The key. - `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: ssh_key_invalid, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/ssh-keys \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"name":"deploy-2026","publicKey":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl deploy@acme.example","reference":"client-4471"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const sshKey = await cx.sshKeys.create({ name: "deploy-2026", publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl deploy@acme.example", reference: "client-4471" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/ssh-keys", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "name": "deploy-2026", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl deploy@acme.example", "reference": "client-4471", }, ) sshKey = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $sshKey = $cx->sshKeys->create(['name' => 'deploy-2026', 'publicKey' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl deploy@acme.example', 'reference' => 'client-4471']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/ssh-keys", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ name: "deploy-2026", publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl deploy@acme.example", reference: "client-4471" }), }); const sshKey = await res.json(); ``` ### Response (`201`) ```json { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4471", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ``` ## Get an SSH key `GET /ssh-keys/{sshKeyId}` Use this to read one key's name and fingerprint. Token scope: `ssh_keys:read`. ### Path parameters - `sshKeyId` (string (uuid), required): The SSH key's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The key. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const sshKey = await cx.sshKeys.get("2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) sshKey = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $sshKey = $cx->sshKeys->get('2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const sshKey = await res.json(); ``` ### Response (`200`) ```json { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4471", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ``` ## Update an SSH key `PATCH /ssh-keys/{sshKeyId}` Use this for your own bookkeeping on a key. Token scope: `ssh_keys:write`. ### Path parameters - `sshKeyId` (string (uuid), required): The SSH key's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100. - `metadata` (object): Metadata keys to set (a string) or remove (null). Keys you leave out are kept. max 20 keys. ### Responses - `200`: The key. - `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PATCH https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"reference":"client-4472"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const sshKey = await cx.sshKeys.update("2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", { reference: "client-4472" }); ``` Python: ```python import os import requests res = requests.patch( "https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "reference": "client-4472", }, ) sshKey = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $sshKey = $cx->sshKeys->update('2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f', ['reference' => 'client-4472']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ reference: "client-4472" }), }); const sshKey = await res.json(); ``` ### Response (`200`) ```json { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4472", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ``` ## Delete an SSH key `DELETE /ssh-keys/{sshKeyId}` Use this to remove a key from your library. Servers already built with it keep it. Token scope: `ssh_keys:write`. ### Path parameters - `sshKeyId` (string (uuid), required): The SSH key's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The removed key. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: platform_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const sshKey = await cx.sshKeys.delete("2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) sshKey = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $sshKey = $cx->sshKeys->delete('2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/ssh-keys/2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const sshKey = await res.json(); ``` ### Response (`200`) ```json { "object": "ssh_key", "id": "2d6f1a8c-4b3e-4e9a-8f2d-6c1b5a0e7d3f", "name": "deploy-2026", "type": "ssh-ed25519", "fingerprint": "SHA256:pR7d2Kq9mXv3Lw8Hn5Ty1Bc6Zs4Fg0Ja2Ue7Wo9Qk3", "reference": "client-4471", "metadata": {}, "createdAt": "2026-12-01T08:12:40Z", "livemode": true } ``` --- # Billing > Invoices and wallet credit. Source: https://docs.clouduxe.com/api/reference/billing/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Invoice object An invoice or a credit note issued to your account. ### Attributes - `object` (string, required): The object's type. Always "invoice". - `id` (string (uuid), required): The invoice's id. - `number` (string, required): The printed number, such as C-INV-02731 (credit notes: C-CN-). - `documentType` (string, required): invoice (a tax invoice), credit_note, or free (a zero-value document). One of `invoice`, `credit_note`, `free`. - `status` (string or null, required): open, part_paid, overdue, paid or cancelled (settled by a credit note). Null for a credit note. One of `open`, `part_paid`, `overdue`, `paid`, `cancelled`. - `currency` (string, required): The invoice's currency. pattern ^[A-Z]{3}$. - `issuedAt` (string (date-time), required): When it was issued. - `issueDate` (string (date), required): The date printed as the date of issue. - `dueDate` (string (date), required): The due date. - `subtotal` (object, required): Before discount and tax. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `discount` (object, required): Discounts. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `tax` (object, required): Tax in total. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `taxBreakdown` (object or null, required): The GST split for an Indian invoice; null otherwise. - `cgst` (object or null, required): Central GST, or null. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `sgst` (object or null, required): State GST, or null. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `igst` (object or null, required): Integrated GST, or null. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `total` (object, required): The invoice total. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `amountPaid` (object or null, required): Paid so far. Null for a credit note. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `amountCredited` (object or null, required): Settled by credit notes. Null for a credit note. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `amountDue` (object or null, required): Still due. Null for a credit note. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `paidAt` (string (date-time) or null, required): When it was paid in full, or null. - `buyerGstin` (string or null, required): Your GSTIN as printed, or null. - `placeOfSupply` (object or null, required): The place of supply, for GST. - `country` (string, required): ISO 3166-1 alpha-2. - `gstState` (string or null, required): The Indian GST state code, or null. - `lines` (array of InvoiceLine, required): The invoice's lines. Empty in listInvoices; filled by getInvoice. - `id` (string (uuid), required): The line's id. - `description` (string, required): What the line is for. - `quantity` (integer, required): The quantity. - `unitAmount` (object, required): The price of one unit, excluding tax. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `discount` (object or null, required): The line's discount, or null. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `net` (object, required): After discount, before tax. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `taxRateBp` (integer, required): The tax rate in basis points (1800 is 18%). - `tax` (object, required): The line's tax. - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991. - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$. - `serviceId` (string (uuid) or null, required): The service the line bills, or null. - `periodStart` (string (date) or null, required): The first day billed, or null. - `periodEnd` (string (date) or null, required): The last day billed, or null. - `orderId` (string (uuid) or null, required): The order this invoice was issued for, or null. - `creditsInvoiceId` (string (uuid) or null, required): For a credit note: the invoice it credits. Null otherwise. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "invoice", "id": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "number": "C-INV-02731", "documentType": "invoice", "status": "paid", "currency": "INR", "issuedAt": "2026-12-04T09:15:23Z", "issueDate": "2026-12-04", "dueDate": "2026-12-04", "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "taxBreakdown": { "cgst": null, "sgst": null, "igst": { "amount": 23382, "currency": "INR" } }, "total": { "amount": 153282, "currency": "INR" }, "amountPaid": { "amount": 153282, "currency": "INR" }, "amountCredited": { "amount": 0, "currency": "INR" }, "amountDue": { "amount": 0, "currency": "INR" }, "paidAt": "2026-12-04T09:15:24Z", "buyerGstin": null, "placeOfSupply": { "country": "IN", "gstState": "29" }, "lines": [ { "id": "5c9a1e7f-2d4b-4f8c-b6a3-0e7d1c9f2a4b", "description": "NVMe VPS 4 GB (node1.acme.example), 4 Dec 2026 to 3 Jan 2027", "quantity": 1, "unitAmount": { "amount": 129900, "currency": "INR" }, "discount": null, "net": { "amount": 129900, "currency": "INR" }, "taxRateBp": 1800, "tax": { "amount": 23382, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "periodStart": "2026-12-04", "periodEnd": "2027-01-03" } ], "orderId": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "creditsInvoiceId": null, "livemode": true } ``` ## List invoices `GET /invoices` Use this to reconcile your bills, newest first. Owner tokens only. Token scope: `billing:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `status` (string): Only invoices with this status. One of `open`, `part_paid`, `overdue`, `paid`, `cancelled`. - `serviceId` (string (uuid)): Only invoices with a line for this service. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of invoices. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/invoices \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const invoice of cx.invoices.list()) { console.log(invoice.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/invoices", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->invoices->list() as $invoice) { echo $invoice->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/invoices", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "invoice", "id": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "number": "C-INV-02731", "documentType": "invoice", "status": "paid", "currency": "INR", "issuedAt": "2026-12-04T09:15:23Z", "issueDate": "2026-12-04", "dueDate": "2026-12-04", "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "taxBreakdown": { "cgst": null, "sgst": null, "igst": { "amount": 23382, "currency": "INR" } }, "total": { "amount": 153282, "currency": "INR" }, "amountPaid": { "amount": 153282, "currency": "INR" }, "amountCredited": { "amount": 0, "currency": "INR" }, "amountDue": { "amount": 0, "currency": "INR" }, "paidAt": "2026-12-04T09:15:24Z", "buyerGstin": null, "placeOfSupply": { "country": "IN", "gstState": "29" }, "lines": [], "orderId": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "creditsInvoiceId": null, "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Get an invoice `GET /invoices/{invoiceId}` Use this to read an invoice's lines, tax and amounts. Token scope: `billing:read`. ### Path parameters - `invoiceId` (string (uuid), required): The invoice's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The invoice. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const invoice = await cx.invoices.get("9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) invoice = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $invoice = $cx->invoices->get('9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const invoice = await res.json(); ``` ### Response (`200`) ```json { "object": "invoice", "id": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "number": "C-INV-02731", "documentType": "invoice", "status": "paid", "currency": "INR", "issuedAt": "2026-12-04T09:15:23Z", "issueDate": "2026-12-04", "dueDate": "2026-12-04", "subtotal": { "amount": 129900, "currency": "INR" }, "discount": { "amount": 0, "currency": "INR" }, "tax": { "amount": 23382, "currency": "INR" }, "taxBreakdown": { "cgst": null, "sgst": null, "igst": { "amount": 23382, "currency": "INR" } }, "total": { "amount": 153282, "currency": "INR" }, "amountPaid": { "amount": 153282, "currency": "INR" }, "amountCredited": { "amount": 0, "currency": "INR" }, "amountDue": { "amount": 0, "currency": "INR" }, "paidAt": "2026-12-04T09:15:24Z", "buyerGstin": null, "placeOfSupply": { "country": "IN", "gstState": "29" }, "lines": [ { "id": "5c9a1e7f-2d4b-4f8c-b6a3-0e7d1c9f2a4b", "description": "NVMe VPS 4 GB (node1.acme.example), 4 Dec 2026 to 3 Jan 2027", "quantity": 1, "unitAmount": { "amount": 129900, "currency": "INR" }, "discount": null, "net": { "amount": 129900, "currency": "INR" }, "taxRateBp": 1800, "tax": { "amount": 23382, "currency": "INR" }, "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "periodStart": "2026-12-04", "periodEnd": "2027-01-03" } ], "orderId": "e1b6a3f9-5d2c-4e7b-8a1f-9c4d0b2e6a5f", "creditsInvoiceId": null, "livemode": true } ``` ## Get an invoice PDF link `GET /invoices/{invoiceId}/pdf` Use this to download the tax invoice. The link works for about 5 minutes. Seconds after an invoice is issued its PDF may not exist yet: then this answers not_found with Retry-After. Token scope: `billing:read`. ### Path parameters - `invoiceId` (string (uuid), required): The invoice's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The link. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a/pdf \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const invoicePdf = await cx.invoices.getPdf("9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a/pdf", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) invoicePdf = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $invoicePdf = $cx->invoices->getPdf('9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/invoices/9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a/pdf", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const invoicePdf = await res.json(); ``` ### Response (`200`) ```json { "object": "invoice_pdf", "url": "https://files.example.net/invoices/9a2e5c1b/C-INV-02731.pdf?sig=Hk2Qm9xT4vLr8Pd3", "expiresAt": "2026-12-04T10:07:41Z" } ``` ## Get your wallet `GET /wallet` Use this to check credit before ordering. Top-ups are made in the panel. Token scope: `billing:read`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The wallet. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/wallet \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const wallet = await cx.wallet.get(); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/wallet", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) wallet = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $wallet = $cx->wallet->get(); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/wallet", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const wallet = await res.json(); ``` ### Response (`200`) ```json { "object": "wallet", "balances": [ { "amount": 500000, "currency": "INR" } ], "topUpCurrency": "INR", "livemode": true } ``` ## List wallet transactions `GET /wallet/transactions` Use this to see what added or spent credit, newest first. Token scope: `billing:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of transactions. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/wallet/transactions \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const walletTransaction of cx.wallet.listTransactions()) { console.log(walletTransaction.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/wallet/transactions", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->wallet->listTransactions() as $walletTransaction) { echo $walletTransaction->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/wallet/transactions", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "wallet_transaction", "id": "48211", "type": "wallet.apply", "amount": { "amount": -153282, "currency": "INR" }, "balanceAfter": { "amount": 500000, "currency": "INR" }, "invoiceId": "9a2e5c1b-7f4d-4b8a-a3c6-1d0e8f2b5c7a", "createdAt": "2026-12-04T09:15:24Z" }, { "object": "wallet_transaction", "id": "48190", "type": "wallet.topup", "amount": { "amount": 600000, "currency": "INR" }, "balanceAfter": { "amount": 653282, "currency": "INR" }, "invoiceId": null, "createdAt": "2026-12-04T08:50:02Z" } ], "hasMore": false, "nextCursor": null } ``` --- # Support > Tickets and attachments. Source: https://docs.clouduxe.com/api/reference/support/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Ticket object A support ticket. ### Attributes - `object` (string, required): The object's type. Always "ticket". - `id` (string (uuid), required): The ticket's id. - `reference` (string, required): The ticket's reference, such as CX-1482. - `subject` (string, required): The subject. - `status` (string, required): open, in_progress, awaiting_customer (staff replied and wait for you), customer_replied or closed. One of `open`, `in_progress`, `awaiting_customer`, `customer_replied`, `closed`. - `priority` (string, required): low, normal, high or urgent. One of `low`, `normal`, `high`, `urgent`. - `department` (object, required): The ticket's department. - `object` (string, required): The object's type. Always "department". - `id` (string (uuid), required): The department's id. - `name` (string, required): Its name. - `unread` (integer, required): Staff messages you have not read in the panel. - `messages` (array of TicketMessage, required): The messages, oldest first. Empty in listTickets; filled by getTicket and createTicket. - `id` (string (uuid), required): The message's id. - `author` (object, required): Who wrote it. - `type` (string, required): customer or staff. One of `customer`, `staff`. - `name` (string or null, required): The author's name, or null. - `body` (string, required): The message text. - `attachments` (array of TicketAttachment, required): Files on the message. - `id` (string (uuid), required): The attachment's id. Get a download link with getAttachment. - `filename` (string, required): The file name. - `size` (integer, required): Bytes. - `type` (string, required): The media type, sniffed from the file. - `removedAt` (string (date-time) or null, required): When staff removed it, or null. - `createdAt` (string (date-time), required): When it was written. - `redactedAt` (string (date-time) or null, required): When staff redacted it, or null. - `createdAt` (string (date-time), required): When it was opened. - `updatedAt` (string (date-time), required): When it last changed. - `lastActivityAt` (string (date-time), required): The last message's time. - `closedAt` (string (date-time) or null, required): When it was closed, or null. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "open", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 0, "messages": [ { "id": "b4a7e2c9-1d6f-4e3b-a9c5-8e2d1f0b7a6c", "author": { "type": "customer", "name": "Acme Hosting" }, "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "attachments": [ { "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "removedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "redactedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:31:10Z", "lastActivityAt": "2026-12-04T09:31:10Z", "closedAt": null, "livemode": true } ``` ## List support departments `GET /support/departments` Use this to pick a departmentId for createTicket. Token scope: `tickets:read`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The departments. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/support/departments \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const department of cx.support.listDepartments()) { console.log(department.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/support/departments", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->support->listDepartments() as $department) { echo $department->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/support/departments", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, { "object": "department", "id": "8b3f6e1d-4a9c-4d2b-b7e5-1c0a8f3d6e2a", "name": "Billing" } ], "hasMore": false, "nextCursor": null } ``` ## List tickets `GET /tickets` Use this to find tickets, latest activity first. Owner tokens only. Token scope: `tickets:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `status` (string): Only tickets with this status. One of `open`, `in_progress`, `awaiting_customer`, `customer_replied`, `closed`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of tickets. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/tickets \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const ticket of cx.tickets.list()) { console.log(ticket.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/tickets", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->tickets->list() as $ticket) { echo $ticket->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/tickets", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "awaiting_customer", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 1, "messages": [], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:48:55Z", "lastActivityAt": "2026-12-04T09:48:55Z", "closedAt": null, "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Open a ticket `POST /tickets` Use this to ask Clouduxe support for help, optionally about one service or invoice, with uploaded attachments. Limited to 20 a hour per account. Token scope: `tickets:write`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `departmentId` (string (uuid), required): The department, from listSupportDepartments. - `subject` (string, required): The subject, 1 to 200 characters on one line. min length 1, max length 200. - `body` (string, required): The first message, 1 to 20,000 characters. min length 1, max length 20000. - `priority` (string): low, normal, high or urgent. Default normal. One of `low`, `normal`, `high`, `urgent`. - `attachmentIds` (array of string (uuid)): Uploaded attachments, at most 10. max items 10. ### Responses - `201`: The ticket. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: account_closed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: department_unavailable, attachment_unavailable, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: maintenance, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/tickets \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"departmentId":"d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f","subject":"IPv6 unreachable on node1","body":"node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.","priority":"high","attachmentIds":["6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d"]}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const ticket = await cx.tickets.create({ departmentId: "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", subject: "IPv6 unreachable on node1", body: "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", priority: "high", attachmentIds: [ "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d" ] }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/tickets", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "departmentId": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "subject": "IPv6 unreachable on node1", "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "priority": "high", "attachmentIds": [ "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", ], }, ) ticket = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $ticket = $cx->tickets->create(['departmentId' => 'd2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f', 'subject' => 'IPv6 unreachable on node1', 'body' => 'node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.', 'priority' => 'high', 'attachmentIds' => ['6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d']]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/tickets", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ departmentId: "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", subject: "IPv6 unreachable on node1", body: "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", priority: "high", attachmentIds: [ "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d" ] }), }); const ticket = await res.json(); ``` ### Response (`201`) ```json { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "open", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 0, "messages": [ { "id": "b4a7e2c9-1d6f-4e3b-a9c5-8e2d1f0b7a6c", "author": { "type": "customer", "name": "Acme Hosting" }, "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "attachments": [ { "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "removedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "redactedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:31:10Z", "lastActivityAt": "2026-12-04T09:31:10Z", "closedAt": null, "livemode": true } ``` ## Get a ticket `GET /tickets/{ticketId}` Use this to read a ticket's conversation. Token scope: `tickets:read`. ### Path parameters - `ticketId` (string (uuid), required): The ticket's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The ticket. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const ticket = await cx.tickets.get("7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) ticket = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $ticket = $cx->tickets->get('7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const ticket = await res.json(); ``` ### Response (`200`) ```json { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "awaiting_customer", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 1, "messages": [ { "id": "b4a7e2c9-1d6f-4e3b-a9c5-8e2d1f0b7a6c", "author": { "type": "customer", "name": "Acme Hosting" }, "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "attachments": [ { "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "removedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "redactedAt": null }, { "id": "0e5b3d8a-6f1c-4b9e-8d2a-7c4f1e0a9b3d", "author": { "type": "staff", "name": "Support" }, "body": "Thanks. The route is restored; please check from your side.", "attachments": [], "createdAt": "2026-12-04T09:48:55Z", "redactedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:48:55Z", "lastActivityAt": "2026-12-04T09:48:55Z", "closedAt": null, "livemode": true } ``` ## Reply to a ticket `POST /tickets/{ticketId}/replies` Use this to add a message to an open ticket. Limited to 120 a hour per account. Token scope: `tickets:write`. ### Path parameters - `ticketId` (string (uuid), required): The ticket's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `body` (string, required): The message, 1 to 20,000 characters. min length 1, max length 20000. - `attachmentIds` (array of string (uuid)): Uploaded attachments, at most 10. max items 10. ### Responses - `201`: The ticket. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: ticket_closed, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: attachment_unavailable, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: maintenance, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/replies \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"body":"Confirmed, IPv6 works again. Thanks.","attachmentIds":[]}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const ticket = await cx.tickets.reply("7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", { body: "Confirmed, IPv6 works again. Thanks.", attachmentIds: [] }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/replies", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "body": "Confirmed, IPv6 works again. Thanks.", "attachmentIds": [], }, ) ticket = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $ticket = $cx->tickets->reply('7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b', ['body' => 'Confirmed, IPv6 works again. Thanks.', 'attachmentIds' => []]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/replies", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ body: "Confirmed, IPv6 works again. Thanks.", attachmentIds: [] }), }); const ticket = await res.json(); ``` ### Response (`201`) ```json { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "customer_replied", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 1, "messages": [ { "id": "b4a7e2c9-1d6f-4e3b-a9c5-8e2d1f0b7a6c", "author": { "type": "customer", "name": "Acme Hosting" }, "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "attachments": [ { "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "removedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "redactedAt": null }, { "id": "0e5b3d8a-6f1c-4b9e-8d2a-7c4f1e0a9b3d", "author": { "type": "staff", "name": "Support" }, "body": "Thanks. The route is restored; please check from your side.", "attachments": [], "createdAt": "2026-12-04T09:48:55Z", "redactedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:48:55Z", "lastActivityAt": "2026-12-04T09:48:55Z", "closedAt": null, "livemode": true } ``` ## Close a ticket `POST /tickets/{ticketId}/close` Use this when the issue is solved. Closing a closed ticket answers the same ticket. Token scope: `tickets:write`. ### Path parameters - `ticketId` (string (uuid), required): The ticket's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The ticket. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: maintenance, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/close \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const ticket = await cx.tickets.close("7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b"); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/close", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) ticket = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $ticket = $cx->tickets->close('7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/tickets/7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b/close", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const ticket = await res.json(); ``` ### Response (`200`) ```json { "object": "ticket", "id": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "reference": "CX-1482", "subject": "IPv6 unreachable on node1", "status": "closed", "priority": "high", "department": { "object": "department", "id": "d2f7a4c1-9b3e-4c6a-8e1f-5a0d7b2c9e4f", "name": "Technical support" }, "unread": 1, "messages": [ { "id": "b4a7e2c9-1d6f-4e3b-a9c5-8e2d1f0b7a6c", "author": { "type": "customer", "name": "Acme Hosting" }, "body": "node1 lost its IPv6 route after the restart at 09:20 UTC. IPv4 works.", "attachments": [ { "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "removedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "redactedAt": null }, { "id": "0e5b3d8a-6f1c-4b9e-8d2a-7c4f1e0a9b3d", "author": { "type": "staff", "name": "Support" }, "body": "Thanks. The route is restored; please check from your side.", "attachments": [], "createdAt": "2026-12-04T09:48:55Z", "redactedAt": null } ], "createdAt": "2026-12-04T09:31:10Z", "updatedAt": "2026-12-04T09:48:55Z", "lastActivityAt": "2026-12-04T09:48:55Z", "closedAt": "2026-12-04T10:10:00Z", "livemode": true } ``` ## Start an attachment upload `POST /attachments` Use this first to attach a file: it answers an upload URL. PUT the bytes there with the given headers, then call completeAttachment, then pass the id in attachmentIds. At most 10 MiB. Token scope: `tickets:write`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `filename` (string, required): The file name, 1 to 255 characters. min length 1, max length 255. - `size` (integer, required): The exact size in bytes, at most 10 MiB. min 1, max 10485760. - `contentType` (string, required): The file's media type. The stored type is sniffed from the bytes: PNG, JPEG, GIF, WebP, PDF, ZIP, gzip or plain text. ### Responses - `201`: Where to upload. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: maintenance, files_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/attachments \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"filename":"mtr-ipv6.txt","size":2048,"contentType":"text/plain"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const attachmentUpload = await cx.attachments.create({ filename: "mtr-ipv6.txt", size: 2048, contentType: "text/plain" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/attachments", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "filename": "mtr-ipv6.txt", "size": 2048, "contentType": "text/plain", }, ) attachmentUpload = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $attachmentUpload = $cx->attachments->create(['filename' => 'mtr-ipv6.txt', 'size' => 2048, 'contentType' => 'text/plain']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/attachments", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ filename: "mtr-ipv6.txt", size: 2048, contentType: "text/plain" }), }); const attachmentUpload = await res.json(); ``` ### Response (`201`) ```json { "object": "attachment_upload", "attachmentId": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "upload": { "url": "https://files.example.net/uploads/6e1d9b4a?sig=Qm3vT8xK2pLd7Rw4", "method": "PUT", "headers": { "content-length": "2048", "content-type": "application/octet-stream" }, "expiresAt": "2026-12-04T09:45:00Z" } } ``` ## Finish an attachment upload `POST /attachments/{attachmentId}/complete` Use this after the PUT: the file's type is checked from its bytes, and a ready attachment can be passed in attachmentIds. Token scope: `tickets:write`. ### Path parameters - `attachmentId` (string (uuid), required): The attachment's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The attachment. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: attachment_unavailable, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: maintenance, files_unavailable, unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d/complete \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const attachment = await cx.attachments.complete("6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d"); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d/complete", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) attachment = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $attachment = $cx->attachments->complete('6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d/complete", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const attachment = await res.json(); ``` ### Response (`200`) ```json { "object": "attachment", "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "status": "ready", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "ticketId": null, "download": null } ``` ## Get an attachment `GET /attachments/{attachmentId}` Use this to download a file from a ticket. The link lasts a few minutes. Token scope: `tickets:read`. ### Path parameters - `attachmentId` (string (uuid), required): The attachment's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The attachment. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: files_unavailable, unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const attachment = await cx.attachments.get("6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) attachment = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $attachment = $cx->attachments->get('6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/attachments/6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const attachment = await res.json(); ``` ### Response (`200`) ```json { "object": "attachment", "id": "6e1d9b4a-3c7f-4a2e-b8d6-0f5c2a9e1b7d", "status": "attached", "filename": "mtr-ipv6.txt", "size": 2048, "type": "text/plain", "ticketId": "7c3e9a1d-2b5f-4a8c-9e6d-4f1b0a7c2e9b", "download": { "url": "https://files.example.net/attachments/6e1d9b4a/mtr-ipv6.txt?sig=Zr5pW2nQ8kTd1Hv6", "expiresAt": "2026-12-04T09:55:00Z" } } ``` --- # Webhooks > Webhook endpoints and events. Source: https://docs.clouduxe.com/api/reference/webhooks/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The WebhookEndpoint object A URL that receives events. ### Attributes - `object` (string, required): The object's type. Always "webhook_endpoint". - `id` (string (uuid), required): The endpoint's id. - `url` (string (uri), required): The https URL events are POSTed to. - `description` (string or null, required): Your description. - `enabledEvents` (array of string, required): The event types sent here, or ["*"] for all. - `status` (string, required): enabled, or disabled (by you, or after 3 days of failed deliveries). One of `enabled`, `disabled`. - `apiVersion` (string, required): The API version event payloads are rendered in. - `secret` (string or null, required): The signing secret, cxwhsec_ followed by 43 characters. Returned only in the first answer when the endpoint is created and when its secret is rotated. A replay of the same Idempotency-Key answers null: if you lost the secret, rotate it. - `createdByTokenId` (string (uuid) or null, required): The API token that created the endpoint, or null when it was made in the panel. - `updatedByTokenId` (string (uuid) or null, required): The API token that last changed the URL, events or secret, or null when the panel did. - `createdAt` (string (date-time), required): When it was created. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": "cxwhsec_4fT9qLm2Xv7Rk3Np8Wd1Zs6Hc0Yb5Ue2Ja9Gt4Qx7Lp", "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## List webhook endpoints `GET /webhook-endpoints` Use this to see where events are sent. Token scope: `webhooks:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The endpoints. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/webhook-endpoints \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const webhookEndpoint of cx.webhookEndpoints.list()) { console.log(webhookEndpoint.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/webhook-endpoints", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->webhookEndpoints->list() as $webhookEndpoint) { echo $webhookEndpoint->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": null, "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Create a webhook endpoint `POST /webhook-endpoints` Use this to receive events at your URL. The first answer holds the signing secret: store it to verify Clouduxe-Signature. A replay of the same Idempotency-Key answers secret null; if you lost it, rotate it. The account owner is emailed. At most 10 endpoints. Token scope: `webhooks:write`. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `url` (string (uri), required): An https URL on port 443 or 8443, with a public DNS name. max length 2048. - `description` (string): Your description. max length 200. - `enabledEvents` (array of string, required): Event types to send, or ["*"] for all. min items 1. - `apiVersion` (string): The API version to render payloads in. Default: the token's version. ### Responses - `201`: The endpoint, with its secret. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `409`: The request conflicts with the object's current state. Codes: webhook_endpoint_limit, idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: webhook_url_refused, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/webhook-endpoints \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"url":"https://billing.acme.example/clouduxe/webhooks","description":"WHMCS production","enabledEvents":["service.provisioned","service.suspended","service.terminated","action.completed","invoice.created","invoice.overdue"]}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookEndpoint = await cx.webhookEndpoints.create({ url: "https://billing.acme.example/clouduxe/webhooks", description: "WHMCS production", enabledEvents: [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ] }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/webhook-endpoints", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue", ], }, ) webhookEndpoint = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookEndpoint = $cx->webhookEndpoints->create(['url' => 'https://billing.acme.example/clouduxe/webhooks', 'description' => 'WHMCS production', 'enabledEvents' => ['service.provisioned', 'service.suspended', 'service.terminated', 'action.completed', 'invoice.created', 'invoice.overdue']]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://billing.acme.example/clouduxe/webhooks", description: "WHMCS production", enabledEvents: [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ] }), }); const webhookEndpoint = await res.json(); ``` ### Response (`201`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": "cxwhsec_4fT9qLm2Xv7Rk3Np8Wd1Zs6Hc0Yb5Ue2Ja9Gt4Qx7Lp", "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## Get a webhook endpoint `GET /webhook-endpoints/{endpointId}` Use this to read one endpoint. The secret is not returned. Token scope: `webhooks:read`. ### Path parameters - `endpointId` (string (uuid), required): The endpoint's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The endpoint. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookEndpoint = await cx.webhookEndpoints.get("1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) webhookEndpoint = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookEndpoint = $cx->webhookEndpoints->get('1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const webhookEndpoint = await res.json(); ``` ### Response (`200`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": null, "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## Update a webhook endpoint `PATCH /webhook-endpoints/{endpointId}` Use this to change an endpoint's URL or events, or to disable or re-enable it. Token scope: `webhooks:write`. ### Path parameters - `endpointId` (string (uuid), required): The endpoint's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `url` (string (uri)): The new URL. max length 2048. - `description` (string or null): Your description. max length 200. - `enabledEvents` (array of string): Event types to send. min items 1. - `status` (string): enabled or disabled. One of `enabled`, `disabled`. ### Responses - `200`: The endpoint. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: webhook_url_refused, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X PATCH https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"status":"enabled"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookEndpoint = await cx.webhookEndpoints.update("1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", { status: "enabled" }); ``` Python: ```python import os import requests res = requests.patch( "https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "status": "enabled", }, ) webhookEndpoint = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookEndpoint = $cx->webhookEndpoints->update('1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e', ['status' => 'enabled']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ status: "enabled" }), }); const webhookEndpoint = await res.json(); ``` ### Response (`200`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": null, "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## Delete a webhook endpoint `DELETE /webhook-endpoints/{endpointId}` Use this to stop sending events to a URL. Token scope: `webhooks:write`. ### Path parameters - `endpointId` (string (uuid), required): The endpoint's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The deleted endpoint. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookEndpoint = await cx.webhookEndpoints.delete("1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) webhookEndpoint = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookEndpoint = $cx->webhookEndpoints->delete('1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const webhookEndpoint = await res.json(); ``` ### Response (`200`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "disabled", "apiVersion": "2026-12-01", "secret": null, "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## Rotate a webhook secret `POST /webhook-endpoints/{endpointId}/rotate-secret` Use this if a secret may have leaked. The first answer holds the new secret; a replay answers secret null. The old secret keeps working for oldSecretExpiresInSeconds (default 24 hours, 0 to stop it at once), and both signatures are sent meanwhile. Token scope: `webhooks:write`. ### Path parameters - `endpointId` (string (uuid), required): The endpoint's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `oldSecretExpiresInSeconds` (integer): Seconds the old secret stays valid, 0 to 86,400. Default 86,400. Send 0 after a leak to stop it at once. min 0, max 86400. ### Responses - `200`: The endpoint, with its new secret. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/rotate-secret \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"oldSecretExpiresInSeconds":0}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookEndpoint = await cx.webhookEndpoints.rotateSecret("1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", { oldSecretExpiresInSeconds: 0 }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/rotate-secret", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "oldSecretExpiresInSeconds": 0, }, ) webhookEndpoint = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookEndpoint = $cx->webhookEndpoints->rotateSecret('1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e', ['oldSecretExpiresInSeconds' => 0]); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/rotate-secret", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ oldSecretExpiresInSeconds: 0 }), }); const webhookEndpoint = await res.json(); ``` ### Response (`200`) ```json { "object": "webhook_endpoint", "id": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "url": "https://billing.acme.example/clouduxe/webhooks", "description": "WHMCS production", "enabledEvents": [ "service.provisioned", "service.suspended", "service.terminated", "action.completed", "invoice.created", "invoice.overdue" ], "status": "enabled", "apiVersion": "2026-12-01", "secret": "cxwhsec_4fT9qLm2Xv7Rk3Np8Wd1Zs6Hc0Yb5Ue2Ja9Gt4Qx7Lp", "createdByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "updatedByTokenId": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "createdAt": "2026-12-01T08:20:00Z", "livemode": true } ``` ## Send a test event `POST /webhook-endpoints/{endpointId}/test` Use this to check that your endpoint receives and verifies events. It queues one webhook_endpoint.test event, signed like any other, and answers the pending delivery: read its result with getWebhookDelivery a few seconds later. Token scope: `webhooks:write`. ### Path parameters - `endpointId` (string (uuid), required): The endpoint's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `202`: The delivery, queued. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: webhook_url_refused, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/test \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookDelivery = await cx.webhookEndpoints.test("1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e"); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/test", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) webhookDelivery = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookDelivery = $cx->webhookEndpoints->test('1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-endpoints/1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e/test", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const webhookDelivery = await res.json(); ``` ### Response (`202`) ```json { "object": "webhook_delivery", "id": "5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b", "eventId": "32ad3352-4e07-56f8-9b40-e8c32b942662", "endpointId": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "status": "pending", "responseStatus": null, "durationMs": null, "attemptedAt": null, "createdAt": "2026-12-04T10:06:00Z" } ``` ## Redeliver an event `POST /events/{eventId}/redeliver` Use this to resend an event of the last 30 days to one of your enabled endpoints, for example after your endpoint was down for more than 3 days. It carries the same event id. The delivery is queued; read its result with getWebhookDelivery. Token scope: `webhooks:write`. ### Path parameters - `eventId` (string (uuid), required): The event's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Body (required) - `endpointId` (string (uuid), required): The endpoint to deliver to. It must be enabled. ### Responses - `202`: The delivery, queued. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `413`: The request body is too large. Codes: request_too_large. - `415`: Unsupported media type. Codes: unsupported_media_type. - `422`: The request is well formed but cannot be carried out. Codes: webhook_url_refused, idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X POST https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b/redeliver \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \ -H "Content-Type: application/json" \ -d '{"endpointId":"1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e"}' ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookDelivery = await cx.events.redeliver("3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", { endpointId: "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e" }); ``` Python: ```python import os import requests res = requests.post( "https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b/redeliver", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, json={ "endpointId": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", }, ) webhookDelivery = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookDelivery = $cx->events->redeliver('3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b', ['endpointId' => '1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e']); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b/redeliver", { method: "POST", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", "Content-Type": "application/json", }, body: JSON.stringify({ endpointId: "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e" }), }); const webhookDelivery = await res.json(); ``` ### Response (`202`) ```json { "object": "webhook_delivery", "id": "5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b", "eventId": "3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", "endpointId": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "status": "pending", "responseStatus": null, "durationMs": null, "attemptedAt": null, "createdAt": "2026-12-04T10:06:00Z" } ``` ## Get a webhook delivery `GET /webhook-deliveries/{deliveryId}` Use this to read how a test send or a redelivery went: pending, delivered or failed, with your endpoint's status and timing. Token scope: `webhooks:read`. ### Path parameters - `deliveryId` (string (uuid), required): The delivery's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The delivery. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/webhook-deliveries/5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const webhookDelivery = await cx.webhookDeliveries.get("5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/webhook-deliveries/5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) webhookDelivery = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $webhookDelivery = $cx->webhookDeliveries->get('5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/webhook-deliveries/5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const webhookDelivery = await res.json(); ``` ### Response (`200`) ```json { "object": "webhook_delivery", "id": "5b9e2c7a-3d1f-4a8e-b6c2-9f0d4e7a1c3b", "eventId": "c8a0b2f6-1e4d-5a3b-9c7f-2d6e8a1b4f0c", "endpointId": "1f4b8e2d-6a9c-4d3f-a7e5-2c0b9d6f3a8e", "status": "delivered", "responseStatus": 200, "durationMs": 184, "attemptedAt": "2026-12-04T10:06:01Z", "createdAt": "2026-12-04T10:06:00Z" } ``` ## List events `GET /events` Use this to catch up on events from the last 30 days, newest first, for example after downtime on your side. Token scope: `webhooks:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `type` (string): Only events of this type. One of `order.paid`, `order.held`, `order.completed`, `order.cancelled`, `service.created`, `service.provisioned`, `service.provisioning_failed`, `service.suspended`, `service.unsuspended`, `service.plan_changed`, `service.cancellation_scheduled`, `service.cancellation_removed`, `service.renewed`, `service.terminating`, `service.terminated`, `action.completed`, `invoice.created`, `invoice.paid`, `invoice.overdue`, `invoice.cancelled`, `wallet.credited`, `ticket.replied`, `ticket.closed`, `api_token.revoked`, `protection.attack_started`, `protection.attack_ended`. - `createdAfter` (string (date-time)): Only events created after this time. - `createdBefore` (string (date-time)): Only events created before this time. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of events. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/events \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const eventItem of cx.events.list()) { console.log(eventItem.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/events", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->events->list() as $eventItem) { echo $eventItem->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/events", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "event", "id": "3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", "type": "service.provisioned", "apiVersion": "2026-12-01", "createdAt": "2026-12-04T09:17:51Z", "data": { "object": { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true }, "previousAttributes": { "status": "provisioning" } }, "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Get an event `GET /events/{eventId}` Use this to fetch one event by its id. Token scope: `webhooks:read`. ### Path parameters - `eventId` (string (uuid), required): The event's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The event. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const eventResult = await cx.events.get("3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) eventResult = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $eventResult = $cx->events->get('3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/events/3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const eventResult = await res.json(); ``` ### Response (`200`) ```json { "object": "event", "id": "3a8c5f2e-0d9b-4e7a-b6c1-7f4e2a9d0c5b", "type": "service.provisioned", "apiVersion": "2026-12-01", "createdAt": "2026-12-04T09:17:51Z", "data": { "object": { "object": "service", "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "type": "vps", "status": "active", "suspensionReason": null, "deletesAt": null, "planId": "vps-nvme-4-mumbai", "planName": "NVMe VPS 4 GB", "region": "mumbai", "label": "node1", "reference": "client-4471", "metadata": { "whmcsServiceId": "18342", "plan": "starter" }, "firewallAvailable": true, "billing": { "cycleMonths": 1, "price": { "amount": 129900, "currency": "INR" }, "currentPeriodStart": "2026-12-04", "paidThrough": "2027-01-03", "cancelAtPeriodEnd": false, "endsOn": null }, "server": { "powerState": "running", "hostname": "node1.acme.example", "ipv4": [ "203.0.113.24" ], "ipv6": [ "2001:db8:4f2a::24" ], "image": { "object": "image", "id": "ubuntu-24.04", "name": "Ubuntu 24.04 LTS", "family": "linux" }, "resources": { "cpuCores": 2, "memoryMb": 4096, "diskGb": 80, "trafficGb": 4000 }, "statusUpdatedAt": "2026-12-04T10:02:41Z", "stale": false }, "proxy": null, "createdAt": "2026-12-04T09:15:24Z", "livemode": true }, "previousAttributes": { "status": "provisioning" } }, "livemode": true } ``` --- # API tokens > Tokens: list and revoke. Tokens are made in the panel, at /account/api-tokens. Source: https://docs.clouduxe.com/api/reference/api-tokens/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The ApiToken object An API token. The token itself is shown only once, in the panel, when it is created; it is never returned by the API. ### Attributes - `object` (string, required): The object's type. Always "api_token". - `id` (string (uuid), required): The token's id. - `name` (string, required): The token's name. - `prefix` (string, required): The token's prefix: cxk_live_. One of `cxk_live_`. - `lastFour` (string, required): The token's last four characters, to tell tokens apart. - `scopes` (array of string, required): What the token may do. - `apiVersion` (string, required): The API version used when a request sends no Clouduxe-Version header. - `ipAllowlist` (array of string, required): Addresses or CIDR ranges the token may be used from. Empty means any address. - `createdBy` (object, required): Who made it. - `personId` (string (uuid), required): The person's id. - `name` (string or null, required): Their name, or null. - `createdAt` (string (date-time), required): When it was made. - `expiresAt` (string (date-time) or null, required): When it expires, or null for never. A token holding any elevated scope (marked elevated at https://docs.clouduxe.com/api/authentication#scopes) always expires, at most 365 days after creation. - `lastUsedAt` (string (date-time) or null, required): When it was last used (updated at most once a minute), or null. - `lastUsedIp` (string or null, required): The address it was last used from, or null. - `revokedAt` (string (date-time) or null, required): When it was revoked, or null. - `revokedReason` (string or null, required): Why: user, leaked (reported by secret scanning), member_removed, person_disabled, account_closed or expired. One of `user`, `leaked`, `member_removed`, `person_disabled`, `account_closed`, `expired`. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": null, "revokedReason": null, "livemode": true } ``` ## List API tokens `GET /api-tokens` Use this to audit which tokens exist and when they were last used. The account owner sees every token on the account; anyone else sees their own. Token scope: `api_tokens:read`. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of tokens. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/api-tokens \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const apiToken of cx.apiTokens.list()) { console.log(apiToken.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/api-tokens", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->apiTokens->list() as $apiToken) { echo $apiToken->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/api-tokens", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": null, "revokedReason": null, "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Get the current token `GET /api-tokens/current` Use this to check what the token you hold may do. Needs no scope. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The token. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/api-tokens/current \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const apiToken = await cx.apiTokens.getCurrent(); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/api-tokens/current", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) apiToken = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $apiToken = $cx->apiTokens->getCurrent(); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/api-tokens/current", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const apiToken = await res.json(); ``` ### Response (`200`) ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": null, "revokedReason": null, "livemode": true } ``` ## Get an API token `GET /api-tokens/{tokenId}` Use this to read one token's details. Token scope: `api_tokens:read`. ### Path parameters - `tokenId` (string (uuid), required): The token's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The token. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const apiToken = await cx.apiTokens.get("0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) apiToken = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $apiToken = $cx->apiTokens->get('0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const apiToken = await res.json(); ``` ### Response (`200`) ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": null, "revokedReason": null, "livemode": true } ``` ## Revoke an API token `DELETE /api-tokens/{tokenId}` Use this to stop a token working at once, for example after a leak. Any token can revoke itself without a scope; revoking another token needs api_tokens:write. Revoking a revoked token answers it unchanged. New tokens are made only in the panel. Token scope: `api_tokens:write`. ### Path parameters - `tokenId` (string (uuid), required): The token's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. - `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$. ### Responses - `200`: The revoked token. - `400`: The request is not valid. Codes: version_invalid, idempotency_key_required, idempotency_key_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress. - `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable. ### Request curl: ```bash curl -X DELETE https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" \ -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const apiToken = await cx.apiTokens.revoke("0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b"); ``` Python: ```python import os import requests res = requests.delete( "https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, ) apiToken = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $apiToken = $cx->apiTokens->revoke('0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/api-tokens/0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", { method: "DELETE", headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f", }, }); const apiToken = await res.json(); ``` ### Response (`200`) ```json { "object": "api_token", "id": "0b7f3c2a-9e4d-4f1a-8c6b-5d2e7a9f1c3b", "name": "whmcs-production", "prefix": "cxk_live_", "lastFour": "Q7x2", "scopes": [ "services:read", "services:write", "services:lifecycle", "services:destructive", "orders:read", "orders:write", "billing:read", "ssh_keys:read", "ssh_keys:write", "webhooks:read" ], "apiVersion": "2026-12-01", "ipAllowlist": [ "203.0.113.0/24" ], "createdBy": { "personId": "8d1e4b6a-2c3f-4a5b-9d7e-1f0a2b3c4d5e", "name": "Asha Rao" }, "createdAt": "2026-12-01T08:15:12Z", "expiresAt": "2027-12-01T08:15:12Z", "lastUsedAt": "2026-12-04T10:02:41Z", "lastUsedIp": "203.0.113.9", "revokedAt": "2026-12-04T10:05:00Z", "revokedReason": "user", "livemode": true } ``` --- # Protection > A protected server's DDoS protection, read-only: status, traffic now, and its attack history. Source: https://docs.clouduxe.com/api/reference/protection/ Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01. ## The Protection object A server's DDoS protection, read-only: what the panel's protection page shows. ### Attributes - `object` (string, required): The object's type. Always "protection". - `serviceId` (string (uuid), required): The service's id. - `status` (string, required): protected (on, no attack), under_attack (an attack is being mitigated now), elevated (traffic is higher than usual, no attack), paused (protection is off, so nothing is filtered), sealed (the address is idle and protection holds it closed; contact support), not_reporting (protection has not reported recently, so no claim about traffic is made), unknown (the state could not be read), or managed (a protected proxy, set up and watched by staff). One of `protected`, `under_attack`, `elevated`, `paused`, `sealed`, `not_reporting`, `unknown`, `managed`. - `mitigating` (boolean, required): True while an attack is being mitigated now. - `currentIncidentId` (string (uuid) or null, required): The incident being mitigated now, or null. - `traffic` (object or null, required): Traffic now, or null for a managed proxy. - `receivedPps` (integer or null, required): Packets per second arriving at the protection layer, or null when not known. - `droppedPps` (integer or null, required): Packets per second dropped by protection, or null when not known. - `measuredAt` (string (date-time) or null, required): When these rates were measured, or null. - `last24Hours` (object or null, required): Packets in the last 24 hours, or null when not known. - `receivedPackets` (integer or null, required): Packets received. - `droppedPackets` (integer or null, required): Packets dropped by protection. - `ports` (array of ProtectedPort, required): The protected ports, as the panel shows them. Change them with the firewall operations. - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`. - `portStart` (integer, required): The first port. min 1, max 65535. - `portEnd` (integer, required): The last port. min 1, max 65535. - `profile` (string or null, required): The protection profile that inspects this traffic, or null for the default checks. - `enabled` (boolean, required): Whether the rule is on. - `protectedSince` (string (date-time) or null, required): When protection data for this service starts: nothing before this service held the address is ever shown. - `updatedAt` (string (date-time) or null, required): When this state was read. - `livemode` (boolean, required): True for objects of your live account. ### Example ```json { "object": "protection", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "status": "under_attack", "mitigating": true, "currentIncidentId": "1c7e4a2f-9b3d-4f6e-a8c1-5d2b0e9f7a4c", "traffic": { "receivedPps": 912400, "droppedPps": 908100, "measuredAt": "2026-12-04T10:02:40Z" }, "last24Hours": { "receivedPackets": 3184001233, "droppedPackets": 2741980511 }, "ports": [ { "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true }, { "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true }, { "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true } ], "protectedSince": "2026-12-04T09:17:51Z", "updatedAt": "2026-12-04T10:02:40Z", "livemode": true } ``` ## Get protection status `GET /services/{serviceId}/protection` Use this to show whether a server is protected, under attack or paused, its traffic at the protection layer now, the incident being mitigated, and its protected ports. It shows only what the panel's protection page shows for this service. Token scope: `protection:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The protection state. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: protection_not_available. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const protection = await cx.protection.get("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) protection = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $protection = $cx->protection->get('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const protection = await res.json(); ``` ### Response (`200`) ```json { "object": "protection", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "status": "under_attack", "mitigating": true, "currentIncidentId": "1c7e4a2f-9b3d-4f6e-a8c1-5d2b0e9f7a4c", "traffic": { "receivedPps": 912400, "droppedPps": 908100, "measuredAt": "2026-12-04T10:02:40Z" }, "last24Hours": { "receivedPackets": 3184001233, "droppedPackets": 2741980511 }, "ports": [ { "protocol": "tcp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true }, { "protocol": "udp", "portStart": 30120, "portEnd": 30120, "profile": "fivem", "enabled": true }, { "protocol": "tcp", "portStart": 22, "portEnd": 22, "profile": "generic", "enabled": true } ], "protectedSince": "2026-12-04T09:17:51Z", "updatedAt": "2026-12-04T10:02:40Z", "livemode": true } ``` ## List attacks `GET /services/{serviceId}/protection/incidents` Use this to read a server's attack history, newest first: each incident's start, end, peak, vector and the action taken. Only incidents since this service held its address are listed. Token scope: `protection:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. ### Query parameters - `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100. - `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512. - `status` (string): Only ongoing or ended incidents. One of `ongoing`, `ended`. - `startedAfter` (string (date-time)): Only incidents that started after this time. - `startedBefore` (string (date-time)): Only incidents that started before this time. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: A page of incidents. - `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: protection_not_available. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); for await (const protectionIncident of cx.protection.listIncidents("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) { console.log(protectionIncident.id); } ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) page = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); foreach ($cx->protection->listIncidents('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $protectionIncident) { echo $protectionIncident->id, PHP_EOL; } ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const page = await res.json(); ``` ### Response (`200`) ```json { "object": "list", "data": [ { "object": "protection_incident", "id": "1c7e4a2f-9b3d-4f6e-a8c1-5d2b0e9f7a4c", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "status": "ongoing", "startedAt": "2026-12-04T10:01:12Z", "startKnown": true, "endedAt": null, "vector": "SYN flood", "targetPort": { "protocol": "tcp", "port": 30120 }, "peakPps": 920000, "droppedPackets": null, "actionsTaken": [ "filtered" ], "livemode": true }, { "object": "protection_incident", "id": "6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "status": "ended", "startedAt": "2026-12-04T03:12:40Z", "startKnown": true, "endedAt": "2026-12-04T03:41:05Z", "vector": "UDP flood", "targetPort": { "protocol": "udp", "port": 30120 }, "peakPps": 1840000, "droppedPackets": 2210448000, "actionsTaken": [ "filtered", "edge_filtered" ], "livemode": true } ], "hasMore": false, "nextCursor": null } ``` ## Get an attack `GET /services/{serviceId}/protection/incidents/{incidentId}` Use this to read one incident's figures, for example to show your customer what happened during an outage. Token scope: `protection:read`. ### Path parameters - `serviceId` (string (uuid), required): The service's id. - `incidentId` (string (uuid), required): The incident's id. ### Headers - `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. ### Responses - `200`: The incident. - `400`: The request is not valid. Codes: version_invalid. - `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked. - `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing. - `404`: Not found. Codes: not_found. - `409`: The request conflicts with the object's current state. Codes: protection_not_available. - `429`: A rate limit was reached. Codes: rate_limited. - `500`: Unexpected error. Codes: internal_error. - `503`: Temporarily unavailable. Codes: unavailable. ### Request curl: ```bash curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents/6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c \ -H "Authorization: Bearer $CLOUDUXE_API_KEY" ``` Node SDK: ```javascript import { Clouduxe } from "@clouduxe/sdk"; const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY }); const protectionIncident = await cx.protection.getIncident("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c"); ``` Python: ```python import os import requests res = requests.get( "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents/6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c", headers={ "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}", }, ) protectionIncident = res.json() ``` PHP SDK: ```php getenv('CLOUDUXE_API_KEY')]); $protectionIncident = $cx->protection->getIncident('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', '6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c'); ``` fetch: ```javascript const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/protection/incidents/6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c", { headers: { Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`, }, }); const protectionIncident = await res.json(); ``` ### Response (`200`) ```json { "object": "protection_incident", "id": "6a1f3c8e-2d7b-4e9a-b5c4-8f0e1d3a7b2c", "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", "status": "ended", "startedAt": "2026-12-04T03:12:40Z", "startKnown": true, "endedAt": "2026-12-04T03:41:05Z", "vector": "UDP flood", "targetPort": { "protocol": "udp", "port": 30120 }, "peakPps": 1840000, "droppedPackets": 2210448000, "actionsTaken": [ "filtered", "edge_filtered" ], "livemode": true } ```