The PrivateByte API lets you do most of what the client area does from code: create and power servers, take snapshots and backups, manage Gateways and proxies, place orders, pay invoices and open support tickets. It has 134 operations over HTTPS at https://api.privatebyte.com, uses scoped bearer keys, and publishes an OpenAPI spec. Every operation is labelled by what it can do, and destructive or money-spending calls need explicit confirmation in the request itself.
One API for the whole account. Servers, SSH keys, orders, the catalogue, services, billing, invoices, Gateways, proxies, account settings and support tickets.
Keys carry only the scopes you give them. A key without the right scope gets 403 FORBIDDEN_SCOPE. Keys that can delete data, open the console or spend money also need two-factor sign-in.
Every operation has a safety tier. Read, safe, destructive or money. Destructive calls repeat the id they change; money calls take a spending ceiling.
Retries are safe. Writes take an Idempotency-Key. The same key within 24 hours returns the first response and runs nothing twice.
Errors tell your code what to do. Refusals are application/problem+json with a code, a retryable flag and a request_id.
What the API covers
The API mirrors the client area. If you can do it by clicking, you can almost always do it with a request. The reference groups the 134 operations by area: servers, SSH keys, orders, catalogue, services, billing, invoices, Gateways, proxies, account, support tickets, rewards and referrals.
Requests and responses are JSON. Field names are snake_case, timestamps are ISO 8601 in UTC, and money is a whole number of minor units with the currency beside it, so 599 with USD means $5.99. That last rule removes a whole class of floating-point mistakes from billing code.
The full reference and the OpenAPI spec are at privatebyte.com/docs/api. Most HTTP tools and code generators can read the spec directly.
Your first request
Create a key in the client area under Account, API keys. The key is shown once, so store it somewhere safe. Then send it as a bearer token:
curl "https://api.privatebyte.com/v1/account" \
-H "Authorization: Bearer $PB_API_KEY"
A missing or wrong key gets 401 UNAUTHORIZED, with a request_id you can quote to support.
Listing your servers works the same way:
curl "https://api.privatebyte.com/v1/vms" \
-H "Authorization: Bearer $PB_API_KEY"
Give each key one job
Every key carries scopes, and every operation names the scopes it needs. A monitoring script needs vm:read and nothing else. A deploy pipeline might need vm:read, vm:power and vm:write. A billing export needs billing:read and invoices:pay only if it actually pays.
Splitting keys this way limits what a leaked key can do. Creating a key asks for your password. A key with a permission that can delete data, open the console, change who we contact, or spend money also needs a two-factor code, so turn on two-factor sign-in first. Changing your password or two-factor settings revokes every key on the account.
Safety tiers
Every operation is labelled with what it can do to your account:
- read changes nothing.
- safe makes a reversible change.
- destructive can lose data or cause downtime.
- money spends or commits funds.
Destructive operations take a confirm parameter that must repeat the id of the thing being changed. A script that deletes an SSH key has to say which key twice:
curl -X DELETE "https://api.privatebyte.com/v1/ssh-keys/{key_id}?confirm={key_id}" \
-H "Authorization: Bearer $PB_API_KEY"
If a variable holds the wrong value in one place, the request is refused instead of deleting something else.
Money operations take an explicit ceiling: the most the request is allowed to spend. Nothing is charged beyond the figure in the request, even if a price changes between reading the catalogue and placing the order.
Retries that never run twice
Networks drop replies. Without protection, retrying a "restart" or "order" request after a timeout can do the work twice. Writes that create or act therefore take an Idempotency-Key header, any string of 8 to 128 characters you choose:
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/restart" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: 6f1c2a9e-restart-web-1"
Send the same key with the same request within 24 hours and you get the first response again, marked Idempotent-Replayed: true. Use a new key for every new action. The same key with a different request is refused with 409 IDEMPOTENCY_CONFLICT.
Errors your code can act on
Every refusal is application/problem+json. Read code to decide what to do, retryable to know whether sending it again can help, and reason and details where the operation can say why. For example, a request blocked by an unpaid renewal returns 409 PRECONDITION with reason: unpaid_renewal_invoice and the invoice id in details.
An unknown id and an id that belongs to another account both answer 404 NOT_FOUND, so the API never confirms that someone else's resource exists.
Lists and limits
Long lists take limit and cursor. When a page has more after it, the response includes next_cursor; pass it back as cursor until it comes back null.
curl "https://api.privatebyte.com/v1/vms?limit=50&cursor={next_cursor}" \
-H "Authorization: Bearer $PB_API_KEY"
Requests are limited per account. Over the limit, the API answers 429 RATE_LIMITED with a Retry-After header in seconds. Wait that long and send the request again.
What people build with it
- Deploy pipelines that restart or reinstall a server after a release.
- Backups on your own schedule, taking a snapshot before every risky change.
- Monitoring that reads server resource use and opens a support ticket when something looks wrong.
- Billing exports that pull invoices into your accounting tool.
- Proxy tooling that checks balance and traffic before a large job.
FAQ
Is the API available on every account? Yes. Any account can create keys under Account, API keys.
Is there an OpenAPI spec? Yes. It is linked from the reference at privatebyte.com/docs/api and describes all 134 operations.
Can a key spend money without my say? Only if you give it a money scope, which needs two-factor sign-in, and every money call carries a spending ceiling set in the request.
What happens if I retry a request?
With the same Idempotency-Key within 24 hours, you get the first response again and nothing runs twice.
How do I report a problem?
Open a support ticket and quote the request_id from the error response or the X-Request-Id header.
