RedSwitches API Private beta Reference
Menu

API reference

Every endpoint of the RedSwitches API, built from the OpenAPI 3.1 spec (openapi.json, openapi.yaml). Base URL https://api.redswitches.com/v1.

MethodPathPermissionWhat it does
GET/auth/verifyreadCheck the key
GET/accountreadGet the account
GET/offersreadList instant servers on offer
GET/offers/{id}readGet one offer
GET/serversreadList servers
GET/servers/{id}readGet a server
GET/servers/{id}/trafficreadGet traffic
POST/servers/{id}/labelmanageRename a server
GET/servers/{id}/rdnsreadList reverse DNS requests
POST/servers/{id}/rdnsmanageRequest a reverse DNS change
POST/servers/{id}/powerpowerPower on, off or reboot
GET/actions/{id}readGet an action
GET/actions/{id}/credentialsreadRead an action's credentials once Beta
GET/ordersreadList orders
POST/ordersorderOrder an instant server
GET/orders/{id}readGet an order
GET/invoicesread_billingList invoices
GET/invoices/{id}read_billingGet an invoice
GET/ssh-keysreadList saved SSH keys
POST/ssh-keysssh_keysSave an SSH key
DELETE/ssh-keys/{id}ssh_keysRemove a saved SSH key
GET/servers/{id}/cancel-requestreadGet the cancellation request Beta
POST/servers/{id}/cancel-requestcancelRequest cancellation Beta
DELETE/servers/{id}/cancel-requestcancelAsk to withdraw the cancellation Beta
POST/servers/{id}/rescuerescueBoot into rescue mode Beta
GET/servers/{id}/osreadList OS images for reinstall Beta
POST/servers/{id}/reinstallreinstallReinstall a server Beta

Account

Check the key

GET/auth/verifypermission: read

The key this request was made with: label, hint, granted and effective permissions, expiry.

Responses

StatusBodyMeaning
200KeyInfoThe key.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Get the account

GET/accountpermission: read

Id, status and currency. credit only for a key with read_billing.

Responses

StatusBodyMeaning
200AccountThe account.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Offers

List instant servers on offer

GET/offerspermission: read

Instant servers in stock for this account, with prices in the account's currency. Not paginated.

Responses

StatusBodyMeaning
200OfferListOffers.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Get one offer

GET/offers/{id}permission: read

One offer of the list, or 404 when it is not on offer now.

Parameters

NameInTypeDescription
id requiredpathstring ^ofr_[1-9][0-9]{0,9}$A typed id (ofr_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200OfferThe offer.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Servers

List servers

GET/serverspermission: read

The account's servers, newest first. Cancelled and terminated services are not listed.

Parameters

NameInTypeDescription
cursorquerystring ^srv_[1-9][0-9]{0,9}$next_cursor of the previous page.
limitqueryintegerItems per page, 1 to 100 (default 50).

Responses

StatusBodyMeaning
200ServerPageA page of servers.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Get a server

GET/servers/{id}permission: read

The list fields plus IP addresses, OS, hardware and delivery state. Stored blocks carry their own as_of or are "unavailable". No request ever calls the server's network live.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200ServerDetailThe server.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Get traffic

GET/servers/{id}/trafficpermission: read

Data used in the current period and the allowance. used_bytes is "unavailable" (never zero) when no current figure is stored or the window reaches back before this account held the server.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200TrafficTraffic.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Rename a server

POST/servers/{id}/labelpermission: manage

Sets the server's label (cosmetic; never a host name). "" clears it.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object LabelRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
200LabelResultRenamed.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found.

Reverse DNS

List reverse DNS requests

GET/servers/{id}/rdnspermission: read

This server's open reverse DNS requests made by this account (pending or applied).

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200RdnsListRequests.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Request a reverse DNS change

POST/servers/{id}/rdnspermission: manage

Queues a PTR change for an IP of this server. The IP must be on the server's stored IP list. At most one open request per IP and 20 per server per day. Applied shortly afterwards, not in the request. On servers where it is carried out as an action, and always for hostname "" (clear the PTR), the answer is RdnsQueued with an action id to poll; another hostname for an IP with an open action is 409 server_busy.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object RdnsRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
202RdnsAccepted | RdnsQueuedAccepted: an rDNS request applied by the scheduled job (RdnsAccepted), or an action to poll (RdnsQueued, with an act_ id).
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found, not_supported, server_not_active, server_busy, ip_not_on_server, action_limit.

Power and actions

Power on, off or reboot

POST/servers/{id}/powerpermission: power

Records a power action and returns at once (202). Poll GET /actions/{id}. The key's server list must cover the server. One action per server at a time; ceilings per server and per account per rolling hour; a burst of power-offs pauses API power for the account.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object PowerRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
202ActionAcceptedQueued.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found, permission_denied, power_paused, server_busy, server_not_active, not_supported, action_limit.

Get an action

GET/actions/{id}permission: read

An action of this account (made with any of its keys).

Parameters

NameInTypeDescription
id requiredpathstring ^act_[1-9][0-9]{0,9}$A typed id (act_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200ActionThe action.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Read an action's credentials once

GET/actions/{id}/credentialspermission: readBeta — rolling out

Beta. The password (or rescue login) of a reinstall or rescue action that was made with return_password true. Needs read; only the key that started the action, after the action is done. The first read returns it and wipes it; unread credentials are wiped after 24 hours. Every read is audited and the owner is emailed. Afterwards, before the action is done, for another key, for an action without return_password, or when the password could not be kept (action reason password_unavailable): 404 not_found. While a switch is off (platform, layer, pause) the answer is 503 unavailable and the password is kept for a later read. HEAD is refused (405) so that nothing can consume the password without reading it. Do not retry this request after a network error or a 5xx answer: the lost answer may already have used the one read (retrying after 429 rate_limited is safe).

Parameters

NameInTypeDescription
id requiredpathstring ^act_[1-9][0-9]{0,9}$A typed id (act_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200CredentialsThe credentials, this one time.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found, permission_denied, unavailable.

Orders

List orders

GET/orderspermission: read

The account's orders, newest first.

Parameters

NameInTypeDescription
cursorquerystring ^ord_[1-9][0-9]{0,9}$next_cursor of the previous page.
limitqueryintegerItems per page, 1 to 100 (default 50).

Responses

StatusBodyMeaning
200OrderPageA page of orders.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Order an instant server

POST/orderspermission: order

Orders one instant server, paid from account credit. Run it first with ?dry_run=true (no Idempotency-Key needed) and send the returned total as expected_total. Then poll GET /orders/{id} until every service is ready.

Parameters

NameInTypeDescription
dry_runquery"true"true only: check and price the order; nothing is created or reserved. No Idempotency-Key needed.
Idempotency-Keyheaderstring ^[A-Za-z0-9_-]{8,64}$Required for a real order (8 to 64 letters, digits, dashes or underscores); not needed with dry_run=true.

Request body

JSON object OrderCreateRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
201OrderCreatedOrdered and paid from credit; delivery queued.
200OrderDryRunDry run: what the order would cost. Nothing created.
400, 401, 402, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, insufficient_credit, ordering_not_enabled, not_eligible, cooling_off, cap_reached, ordering_paused, price_changed, sold_out, order_not_placed, order_under_review, not_orderable.

Get an order

GET/orders/{id}permission: read

An order with each service's delivery state and poll_after.

Parameters

NameInTypeDescription
id requiredpathstring ^ord_[1-9][0-9]{0,9}$A typed id (ord_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200OrderThe order.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Invoices

List invoices

GET/invoicespermission: read_billing

The account's invoices, newest first (drafts hidden). Needs read_billing.

Parameters

NameInTypeDescription
cursorquerystring ^inv_[1-9][0-9]{0,9}$next_cursor of the previous page.
limitqueryintegerItems per page, 1 to 100 (default 50).

Responses

StatusBodyMeaning
200InvoicePageA page of invoices.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: permission_denied.

Get an invoice

GET/invoices/{id}permission: read_billing

One invoice with its line items. Needs read_billing.

Parameters

NameInTypeDescription
id requiredpathstring ^inv_[1-9][0-9]{0,9}$A typed id (inv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200InvoiceDetailThe invoice.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: permission_denied, not_found.

SSH keys

List saved SSH keys

GET/ssh-keyspermission: read

The account's saved SSH keys.

Responses

StatusBodyMeaning
200SshKeyListKeys.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Save an SSH key

POST/ssh-keyspermission: ssh_keys

Saves a public key on the account. The owner is emailed. At most 20 key changes per account per day.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object SshKeyCreateRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
201SshKeySaved.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, invalid_ssh_key, ssh_key_conflict, action_limit.

Remove a saved SSH key

DELETE/ssh-keys/{id}permission: ssh_keys

Removes a saved key from the account. Servers where it is already installed are not touched. The owner is emailed.

Parameters

NameInTypeDescription
id requiredpathstring ^sshkey_[1-9][0-9]{0,9}$A typed id (sshkey_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Responses

StatusBodyMeaning
200SshKeyDeletedRemoved.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: idempotency_key_required, idempotency_conflict, in_progress, not_found, action_limit.

Cancellation

Get the cancellation request

GET/servers/{id}/cancel-requestpermission: readBeta — rolling out

Beta. The server's cancellation state: none, requested (with dates) or withdrawal_requested.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200CancellationStateState.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Request cancellation

POST/servers/{id}/cancel-requestpermission: cancelBeta — rolling out

Beta. Files a cancellation at the end of the billing period (the server keeps running until then) for an active or suspended server. The owner is emailed. When a request already exists it is returned (200). Covered by the key's server list. At most 2 per account per day. 409 server_busy while a request to keep the server is less than a day old.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object CancelRequestBody. Unknown fields are refused.

Responses

StatusBodyMeaning
201CancellationStateRequested.
200CancellationStateA request already existed.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found, permission_denied, server_not_active, server_busy, action_limit.

Ask to withdraw the cancellation

DELETE/servers/{id}/cancel-requestpermission: cancelBeta — rolling out

Beta. Asks RedSwitches staff to withdraw the cancellation (filed once; repeating it changes nothing). Nothing is un-cancelled automatically. 404 when there is no cancellation request.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Responses

StatusBodyMeaning
200CancellationStateWithdrawal requested.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: idempotency_key_required, idempotency_conflict, in_progress, not_found, permission_denied.

Reinstall and rescue

Boot into rescue mode

POST/servers/{id}/rescuepermission: rescueBeta — rolling outoff unless RedSwitches turns it on

Beta. Off unless RedSwitches switches rescue on. Records a rescue action (202) that boots the server into rescue mode, as the portal's Rescue tab does. With return_password true the rescue login can be read once from GET /actions/{id}/credentials after the action is done. Leave rescue with POST /servers/{id}/power {"action":"reboot"}. Covered by the key's server list. At most 4 per server per day. 503 unavailable while RedSwitches has reinstalls and rescues paused.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object RescueRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
202RescueAcceptedQueued.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found, permission_denied, server_busy, server_not_active, not_supported, action_limit, unavailable.

List OS images for reinstall

GET/servers/{id}/ospermission: readBeta — rolling out

Beta. The OS images the portal offers for this server, from a stored list.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.

Responses

StatusBodyMeaning
200OsImageListImages.
400, 401, 403, 404, 405, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: not_found.

Reinstall a server

POST/servers/{id}/reinstallpermission: reinstallBeta — rolling outoff unless RedSwitches turns it on

Beta. Off unless RedSwitches switches reinstall on. Records a reinstall action (202) with the chosen saved SSH keys. No password is returned unless return_password is true (then readable once from GET /actions/{id}/credentials); otherwise, if one is set, it is emailed to the owner as in the portal. Covered by the key's server list. At most 2 per server and 5 per account per day. 503 unavailable while RedSwitches has reinstalls paused.

Parameters

NameInTypeDescription
id requiredpathstring ^srv_[1-9][0-9]{0,9}$A typed id (srv_<number>). Another prefix, a leading zero or anything encoded is 404.
Idempotency-Key requiredheaderstring ^[A-Za-z0-9_-]{8,64}$8 to 64 letters, digits, dashes or underscores. One per intended action; reuse it only to retry the same request.

Request body

JSON object ReinstallRequest. Unknown fields are refused.

Responses

StatusBodyMeaning
202ReinstallAcceptedQueued.
400, 401, 403, 404, 405, 409, 413, 422, 429, 500, 503ErrorErrors (see below and Rate limits and errors).

Error codes specific to this endpoint: invalid_body, idempotency_key_required, idempotency_conflict, in_progress, not_found, permission_denied, server_busy, server_not_active, not_supported, invalid_ssh_key, action_limit, unavailable.

Objects

MinorAmount

An amount in MINOR units (cents) as a string of digits, and its currency. Used by ordering: {"amount":"15609","currency":"EUR"} is 156.09 EUR.

FieldTypeDescription
amount alwaysstring ^(0|[1-9][0-9]{0,11})$
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.

Location

FieldTypeDescription
city alwaysstring
country alwaysstring ^[A-Z]{2}$ | nullISO 3166-1 alpha-2, or null when unknown.

KeyInfo

FieldTypeDescription
id alwaysstring ^key_[1-9][0-9]{0,9}$
label alwaysstring
hint alwaysstringThe key's last four characters.
env always"live" | "test"
permissions alwaysarray of "read" | "read_billing" | "order" | "manage" | "ssh_keys" | "power" | "cancel" | "reinstall" | "rescue"Permissions granted to the key.
effective_permissions alwaysarray of "read" | "read_billing" | "order" | "manage" | "ssh_keys" | "power" | "cancel" | "reinstall" | "rescue"Granted permissions that work right now (a permission does not work while RedSwitches has its part of the API switched off).
expires_at alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.

Account

FieldTypeDescription
id alwaysstring ^acc_[1-9][0-9]{0,9}$
status always"active" | "inactive" | "closed"
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
creditstring ^-?[0-9]{1,13}\.[0-9]{2}$Credit balance. Present only for a key with read_billing.

OfferPrice

FieldTypeDescription
cycle always"monthly" | "quarterly" | "semiannually" | "annually" | "biennially" | "triennially"
price alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$Recurring price per cycle, excluding tax, for the default configuration.
setup alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$One-time setup fee of that cycle.

OsChoice

FieldTypeDescription
id alwaysstring ^os_[1-9][0-9]{0,9}$
name alwaysstring

Offer

An instant server on offer. Prices are per billing cycle, excluding tax, in the account's currency, for the default configuration. Use a dry-run order for the exact total.

FieldTypeDescription
id alwaysstring ^ofr_[1-9][0-9]{0,9}$
name alwaysstring
location alwaysLocation | | null
cpu alwaysstring | null
ram alwaysstring | null
disks alwaysstring | null
port_speed alwaysstring | null
traffic alwaysstring | null
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
prices alwaysarray of OfferPrice
os alwaysarray of OsChoiceThe OS choices for an order (os_id).
stock alwaysinteger | "5+"Units in stock, 0 to 4, or "5+".
as_of alwaysstring (date-time)When this list was read (lists are cached for about 30 seconds).

OfferList

FieldTypeDescription
data alwaysarray of Offer

Server

A server of the account (cancelled and terminated services are not listed).

FieldTypeDescription
id alwaysstring ^srv_[1-9][0-9]{0,9}$
label alwaysstring | null
product alwaysstring
location alwaysLocation | | null
status always"pending" | "active" | "suspended"
primary_ip alwaysstring | nullIPv4 or IPv6 address, without a prefix length.
billing_cycle always"monthly" | "quarterly" | "semiannually" | "annually" | "biennially" | "triennially" | "one_time" | "free" | null
next_due_date alwaysstring (date) | null
recurring_amount alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
created alwaysstring (date) | null

IpBlock

FieldTypeDescription
as_of alwaysstring (date-time)UTC, ISO 8601, always with Z.
addresses alwaysarray of object

InstalledOs

FieldTypeDescription
as_of alwaysstring (date-time)UTC, ISO 8601, always with Z.
name alwaysstring | null
installing alwaysboolean

Hardware

FieldTypeDescription
as_of alwaysstring (date-time)UTC, ISO 8601, always with Z.
cpu alwaysstring | null
ram alwaysstring | null
disks alwaysstring | null

ServerDetail

One server: the list fields plus stored facts. Each stored block has its own as_of, or is the string "unavailable".

FieldTypeDescription
id alwaysstring ^srv_[1-9][0-9]{0,9}$
label alwaysstring | null
product alwaysstring
location alwaysLocation | | null
status always"pending" | "active" | "suspended"
primary_ip alwaysstring | nullIPv4 or IPv6 address, without a prefix length.
billing_cycle always"monthly" | "quarterly" | "semiannually" | "annually" | "biennially" | "triennially" | "one_time" | "free" | null
next_due_date alwaysstring (date) | null
recurring_amount alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
created alwaysstring (date) | null
ips alwaysIpBlock | "unavailable"
os alwaysobject
hardware alwaysHardware | "unavailable"
delivery always"awaiting_payment" | "assigning" | "installing" | "ready" | "attention" | "closed" | | nullNull for a server that is not an instant deploy.
rescue alwaysbooleanTrue while the server is booted into rescue mode (from stored state; false when not known). Leave rescue with a power reboot.

Traffic

FieldTypeDescription
id alwaysstring ^srv_[1-9][0-9]{0,9}$
used_bytes alwaysinteger | "unavailable"
unavailable_reason always"not_collected" | "ownership_changed_in_window" | nullWhy used_bytes is unavailable: nothing current is stored, or the measured window starts before this account held the server. Null when used_bytes is a number.
period_start alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
period_end alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
basis always"billing_period" | "last_30_days" | "since_ownership" | nullbilling_period: the account's billing month. last_30_days: the network's rolling 30-day total. since_ownership: counted from when this account started holding the server.
as_of alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
allowance_bytes alwaysinteger | nullNull when unmetered or unknown.
unmetered alwaysboolean

Order

FieldTypeDescription
id alwaysstring ^ord_[1-9][0-9]{0,9}$
date alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
status always"pending" | "active" | "cancelled" | "on_hold" | "other"
payment always"paid" | "free" | "unpaid" | "partially_paid" | "pending" | "cancelled" | "refunded" | "collections" | "unknown"
invoice alwaysstring ^inv_[1-9][0-9]{0,9}$ | null
services alwaysarray of object
poll_after alwaysinteger | nullSeconds until it is worth asking again; null when nothing is still being delivered.

ServerPage

FieldTypeDescription
data alwaysarray of Server
next_cursor alwaysstring ^srv_[1-9][0-9]{0,9}$ | nullPass as cursor for the next page; null on the last page.

OrderPage

FieldTypeDescription
data alwaysarray of Order
next_cursor alwaysstring ^ord_[1-9][0-9]{0,9}$ | nullPass as cursor for the next page; null on the last page.

InvoicePage

FieldTypeDescription
data alwaysarray of Invoice
next_cursor alwaysstring ^inv_[1-9][0-9]{0,9}$ | nullPass as cursor for the next page; null on the last page.

Invoice

Draft invoices are never shown.

FieldTypeDescription
id alwaysstring ^inv_[1-9][0-9]{0,9}$
number alwaysstring
status always"paid" | "unpaid" | "cancelled" | "refunded" | "collections" | "payment_pending" | "other"
date alwaysstring (date) | null
due_date alwaysstring (date) | null
paid_at alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
subtotal alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
tax alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
total alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
credit alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$Credit applied.
balance alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$Still due.

InvoiceItem

FieldTypeDescription
description alwaysstring
amount alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
taxed alwaysboolean
service alwaysstring ^srv_[1-9][0-9]{0,9}$ | null

InvoiceDetail

FieldTypeDescription
id alwaysstring ^inv_[1-9][0-9]{0,9}$
number alwaysstring
status always"paid" | "unpaid" | "cancelled" | "refunded" | "collections" | "payment_pending" | "other"
date alwaysstring (date) | null
due_date alwaysstring (date) | null
paid_at alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
currency alwaysstring ^[A-Z]{3}$ISO 4217 code of the account's currency.
subtotal alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
tax alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
total alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$A decimal amount in major units, as a string (never a float). Example "129.00".
credit alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$Credit applied.
balance alwaysstring ^-?[0-9]{1,13}\.[0-9]{2}$Still due.
items alwaysarray of InvoiceItem

SshKey

FieldTypeDescription
id alwaysstring ^sshkey_[1-9][0-9]{0,9}$
name alwaysstring
type alwaysstring
fingerprint alwaysstring | null
added alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.

SshKeyList

FieldTypeDescription
data alwaysarray of SshKey

SshKeyCreateRequest

FieldTypeDescription
namestringOptional. Up to 64 characters; no control characters, < or >.
public_key alwaysstringOne line, as in id_ed25519.pub.

SshKeyDeleted

FieldTypeDescription
id alwaysstring ^sshkey_[1-9][0-9]{0,9}$
deleted alwaystrue
installed_servers_unchanged alwaystrueRemoving a saved key does not touch servers where it is already installed.

LabelRequest

FieldTypeDescription
label alwaysstring ^[\p{L}\p{N} ._\-]{0,60}$Letters, digits, spaces, dots, dashes, underscores; at most 60. White space is collapsed. "" clears the label. Control characters are refused.

LabelResult

FieldTypeDescription
id alwaysstring ^srv_[1-9][0-9]{0,9}$
label alwaysstring | null

RdnsRequest

FieldTypeDescription
ip alwaysstringAn IPv4 or IPv6 address assigned to this server.
hostname alwaysstringA full host name (lower-cased, trailing dot removed), or "" to clear the PTR record.

RdnsAccepted

FieldTypeDescription
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
ip alwaysstring
hostname alwaysstring
state always"pending"
already_requested alwaysbooleanTrue when the same change was already waiting.

RdnsList

The requests applied by the scheduled job come first (oldest first), then up to 20 changes carried out as actions (newest first). To find the newest entry for an IP, sort by requested.

FieldTypeDescription
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
data alwaysarray of object

PowerRequest

FieldTypeDescription
action always"on" | "off" | "reboot"

ActionAccepted

An action was recorded and will run shortly. Poll GET /actions/{id}.

FieldTypeDescription
id alwaysstring ^act_[1-9][0-9]{0,9}$
kind always"power"
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
action always"on" | "off" | "reboot"
state always"queued"
poll_after alwaysinteger

Action

FieldTypeDescription
id alwaysstring ^act_[1-9][0-9]{0,9}$
kind always"label" | "rdns" | "ssh_key_add" | "ssh_key_remove" | "power" | "cancel_request" | "cancel_withdrawal" | "reinstall" | "rescue" | null
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$ | null
action always"on" | "off" | "reboot" | null
state always"queued" | "running" | "done" | "failed" | "unknown"unknown: the outcome could not be confirmed. No further API power action runs on that server until RedSwitches settles it.
reason always"expired" | "server_busy" | "server_not_active" | "server_changed" | "power_paused" | "not_supported" | "provider_refused" | "no_answer" | "provider_unavailable" | "settled_by_staff" | "key_no_longer_allowed" | "ip_not_on_server" | "paused" | "not_tracked" | "password_unavailable" | nullFor failed and unknown actions. A done action has none, except password_unavailable (a reinstall or rescue started, but the password asked for could not be kept) and not_tracked. Null otherwise or when there is no public word for it.
created alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
started alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
finished alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.

OrderCreateRequest

Exactly these fields; anything else is 400 invalid_body. Nothing from the body is echoed back.

FieldTypeDescription
offer_id alwaysstring ^ofr_[1-9][0-9]{0,9}$
billing_cycle always"monthly"Only monthly in this release.
os_id alwaysstring ^os_[1-9][0-9]{0,9}$One of the offer's os choices.
ssh_key_idstring ^sshkey_[1-9][0-9]{0,9}$Optional: a key saved on the account.
labelstring ^[\p{L}\p{N} ._\-]{1,60}$
expected_totalMinorAmountThe total you expect to pay now, from a dry run. Required unless dry_run=true.

OrderCreated

FieldTypeDescription
id alwaysstring ^ord_[1-9][0-9]{0,9}$
invoice_id alwaysstring ^inv_[1-9][0-9]{0,9}$
server_ids alwaysarray of string ^srv_[1-9][0-9]{0,9}$
status always"paid"
delivery always"queued"
billing_cycle always"monthly"
total alwaysMinorAmountPaid now, tax included, minor units.
recurring alwaysMinorAmountEach following cycle, before tax, minor units.
paid_from_credit alwaysMinorAmountAn amount in MINOR units (cents) as a string of digits, and its currency. Used by ordering: {"amount":"15609","currency":"EUR"} is 156.09 EUR.
poll_after always30

OrderDryRun

FieldTypeDescription
dry_run alwaystrue
offer_id alwaysstring ^ofr_[1-9][0-9]{0,9}$
billing_cycle always"monthly"
total alwaysMinorAmountThe first payment (setup and tax included). Send this as expected_total.
recurring alwaysMinorAmountEach following cycle, before tax.
paid_from_credit alwaysMinorAmountWhat would be paid from credit (the same shape as the 201 answer).

ErrorDetails

Typed facts to act on, computed by RedSwitches (never an echo of the request).

FieldTypeDescription
totalMinorAmountprice_changed: the current total.
neededMinorAmountinsufficient_credit: the amount missing.
cap"servers_day" | "servers_month" | "open" | "money_month" | "renewal_month" | "key_month"cap_reached: the limit the order would go over.
orderstring ^ord_[1-9][0-9]{0,9}$order_under_review: the order that was created.
retry_afterintegerin_progress, cooling_off: seconds to wait.
limitinteger | MinorAmountaction_limit: the ceiling (an integer). cap_reached: the limit in force: an integer for servers_day, servers_month and open; an amount in the account's currency (minor units) for money_month, renewal_month and key_month.
window"day" | "30_days" | "open"cap_reached: the window of the limit: day (servers_day), 30_days (servers_month, money_month, renewal_month, key_month), open (paid orders not delivered yet; no time window).
per"server_hour" | "account_hour" | "server_day" | "account_day"action_limit: the window of the ceiling.
fieldstringinvalid_body: the documented field that failed (absent when the failure is not about one field).
reasonstringinvalid_body: what is accepted, in fixed words (never your value).

Error

FieldTypeDescription
error alwaysobject

RdnsQueued

The change is carried out as an action. Poll GET /actions/{id}.

FieldTypeDescription
id alwaysstring ^act_[1-9][0-9]{0,9}$
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
ip alwaysstring
hostname alwaysstring"" when the PTR is being cleared.
state always"queued"
already_requested alwaysbooleanTrue when the same change was already open; its action is returned.
poll_after alwaysinteger

CancelRequestBody

The body may be omitted or {}.

FieldTypeDescription
reasonstringOptional. Up to 255 characters; no control characters, < > { }.

CancellationState

The server's cancellation request. A request made through the API takes effect at the end of the billing period.

FieldTypeDescription
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
state always"none" | "requested" | "withdrawal_requested"
requested alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
effective alwaysstring (date) | nullWhen the server ends (its next due date).
type always"end_of_billing_period" | "immediate" | null

OsImageList

data is null (reason not_collected) until the list has been read for this server's current hardware.

FieldTypeDescription
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
as_of alwaysstring (date-time) | nullUTC, ISO 8601, always with Z.
reason always"not_collected" | null
data alwaysarray of object | null

ReinstallRequest

FieldTypeDescription
os_id alwaysstring ^img_[A-Za-z0-9_.-]{1,64}$An image id from GET /servers/{id}/os (img_…; the order's os_… ids are refused with 400).
ssh_key_ids alwaysarray of string ^sshkey_[1-9][0-9]{0,9}$1 to 10 saved keys to install.
hostnamestringOptional. Lower-case letters, digits, dots and dashes.
raid"none" | "raid0" | "raid1" | "raid10"Optional; only on servers that offer a RAID choice (else 422 not_supported).
return_passwordbooleanOptional, default false. True: the root password set by the reinstall can be read ONCE from GET /actions/{id}/credentials after the action is done (within 24 hours). False: it is never returned (emailed to the owner as in the portal).

RescueRequest

The body may be {}.

FieldTypeDescription
return_passwordbooleanOptional, default false. True: the rescue login can be read ONCE from GET /actions/{id}/credentials after the action is done (within 24 hours). False: the rescue login is delivered as in the portal.

RescueAccepted

FieldTypeDescription
id alwaysstring ^act_[1-9][0-9]{0,9}$
kind always"rescue"
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
state always"queued"
return_password alwaysboolean
poll_after alwaysinteger

Credentials

Returned once. Store it at once: the next read is 404. The owner is emailed that a password was retrieved (never the password).

FieldTypeDescription
action_id alwaysstring ^act_[1-9][0-9]{0,9}$
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
username alwaysstring
password alwaysstring

ReinstallAccepted

FieldTypeDescription
id alwaysstring ^act_[1-9][0-9]{0,9}$
kind always"reinstall"
server_id alwaysstring ^srv_[1-9][0-9]{0,9}$
os_id alwaysstring ^img_[A-Za-z0-9_.-]{1,64}$An OS image id for reinstall (another namespace than the order's os_<n> choices).
state always"queued"
return_password alwaysboolean
poll_after alwaysinteger

Error codes

StatusCodeMessage
400body_not_allowedThis request must not have a body.
A GET, HEAD or DELETE request carried a body.
400idempotency_key_requiredThis request needs an Idempotency-Key header of 8 to 64 letters, digits, dashes or underscores.
A POST or DELETE without a valid Idempotency-Key header (not needed for an order dry run).
400invalid_bodyThe request body is not valid JSON of the documented shape for this endpoint. Unknown fields are refused.
Missing body, not JSON, not one object, a duplicate name, an unknown field, a wrong type, a value of the wrong shape, Content-Type not application/json, or over 4 KB. When one field is at fault, details.field and details.reason name it and the message becomes "The request body is not valid: <field>: <reason>." (fixed texts; your value is never echoed).
400invalid_parameterA query parameter is not allowed here or its value is not valid. See the API documentation for this endpoint.
An unknown, repeated, empty or malformed query parameter.
400key_in_urlAPI keys are accepted only in the Authorization header. A working key sent in a URL is revoked.
A key-shaped string was found anywhere in the URL. Every working key found there is revoked and its owner is emailed.
401invalid_keyMissing or invalid API key. Send it as "Authorization: Bearer <key>".
401key_expiredThis API key has expired.
401key_revokedThis API key has been revoked.
Also after a security event on the account (password, email or two-factor change, API access turned off).
401test_keyTest keys cannot be used on the live API.
402insufficient_creditThe account credit that may be spent through the API does not cover this order. Add funds in the client area.
details.needed holds the amount missing.
403account_blockedAPI access for this account is blocked. Please contact support.
403account_inactiveThis account is not active.
403api_not_enabledAPI access is not enabled for this account.
403cap_reachedThis order would go over a limit of this key or of the account. Nothing was ordered.
details.cap names the limit, details.limit its value and details.window its window. Account limits are set by RedSwitches; contact support to raise one.
403cooling_offOrdering opens 24 hours after it was turned on and after a new ordering key.
details.retry_after and the Retry-After header: seconds until ordering opens.
403email_not_verifiedThe account owner must verify their email address before the API can be used.
403ip_not_allowedThis key cannot be used from your IP address.
The key has an IP allow-list that does not include the caller.
403not_eligibleThis account cannot order through the API right now. The account owner can see the reason on the API page.
An eligibility check failed (for example the key has no spend cap).
403not_invitedAPI access is by invitation only for now.
403ordering_not_enabledOrdering through the API is not turned on for this account. The owner turns it on on the API page.
The account's ordering switch is off.
403ordering_pausedOrdering through the API is paused by RedSwitches. Nothing was ordered. Try again later.
RedSwitches paused API ordering.
403owner_changedThis API key was created by a user who no longer owns the account. The owner must create a new key.
403permission_deniedThis API key does not have the permission this endpoint needs.
Also when a power key's server list does not cover the server.
403power_pausedPower actions through the API are paused for this account. RedSwitches staff have been told.
Power is paused for the account, for example after a burst of power-offs.
404not_foundNothing was found at this address: no such endpoint, or no such item on this account.
Another account's item gives the identical answer.
405method_not_allowedThis endpoint does not take this method. The Allow header lists the methods it takes.
The Allow header lists the methods of the path (HEAD is not taken by GET /actions/{id}/credentials).
409in_progressA request with this Idempotency-Key is still being processed. Ask again with the same key in a few seconds.
details.retry_after and the Retry-After header: seconds to wait. Retry with the same Idempotency-Key and body.
409order_not_placedThe order could not be completed and nothing was charged. RedSwitches staff have been told.
409order_under_reviewThis order needs a check by RedSwitches staff before it continues. Do not repeat it; you will hear from us.
details.order names the order when one was created.
409price_changedThe total is not the expected_total that was sent. Nothing was ordered. The current total is in the details.
details.total holds the current total.
409server_busyAnother action on this server is queued, running or unsettled. Wait until it has finished, then try again.
Also while the server is being delivered or installed.
409server_not_activeThis server is not active (pending, suspended or ended), so this action is not available.
409sold_outThis server is not in stock any more. Nothing was ordered.
409ssh_key_conflictThat key is already saved on this account, or the account holds the most keys it can.
413body_too_largeThe request body is larger than 16 KB.
Refused before the API reads it.
422idempotency_conflictThis Idempotency-Key was used for a different request. Use a new key for a new order.
Same key and Idempotency-Key, different body or target.
422invalid_ssh_keyThat is not a valid SSH public key.
422ip_not_on_serverThat IP address is not assigned to this server.
422not_orderableThis offer cannot be ordered with these choices through the API.
Unknown or hidden offer, an OS that is not one of the offer's, an SSH key not on the account, a billing cycle the key does not allow.
422not_supportedThis server does not support that through the API.
429action_limitThis would go over a limit of the account for this action (see the details). Nothing was changed. Try again later.
details.limit and details.per.
429rate_limitedToo many requests. Wait for the number of seconds in the Retry-After header.
500internal_errorSomething went wrong on our side. Quote the request id when you contact support.
503unavailableThe API is temporarily unavailable.
The API, a part of it or a dependency is switched off or not answering. Nothing was done.