PrivateByte MCP
Manage PrivateByte servers, backups, proxies, billing and support tickets from an AI agent.
Hosted MCP Server
npx add-mcp 'https://mcp.privatebyte.com'Installs into Claude Code, Codex, Cursor and more
Documentation
PrivateByte API
Most of what you do in the client area, over HTTPS. Servers, Gateways, proxies, orders, billing and support tickets.
Requests and responses are JSON. Field names are snake_case. Timestamps are ISO 8601 in UTC. Money is whole minor units with a currency beside it: 599 with USD is $5.99.
Values in braces, such as {id}, are yours to fill in. The samples read your key from the PB_API_KEY environment variable.
OpenAPI spec Version 1.0.0134 operations
https://api.privatebyte.com
Authentication
Create a key in the client area under Account, API keys. The key is shown once. Send it as a bearer token on every request.
Each key carries scopes, and each operation names the scopes it needs. Give a key only what its job requires. A key without the scope gets 403 FORBIDDEN_SCOPE.
Creating a key asks for your password. A key with a permission that can delete data, open the console, change who we contact, replace a Gateway's device key, 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.
All scopes
account:contacts:writeaccount:readaccount:telegram:linkaccount:writebilling:paybilling:readgateway:readgateway:writeinvoices:payorders:cancelorders:createproxy:credentialsproxy:readproxy:whitelistrewards:readrewards:redeemservices:canceltickets:readtickets:writevm:destroyvm:powervm:readvm:write
curl "https://api.privatebyte.com/v1/account" \
-H "Authorization: Bearer $PB_API_KEY"
Safety tiers
Every operation is labelled with what it can do to your account.
- read Changes nothing.
- safe Reversible change.
- destructive Data loss or downtime.
- money Spends or commits funds.
Destructive operations take confirm, which must repeat the id of the thing being changed, or be true for account-wide actions. Money operations take an explicit ceiling, so nothing is spent beyond what the request states.
A destructive request repeats its target
curl -X DELETE "https://api.privatebyte.com/v1/ssh-keys/{key_id}?confirm={key_id}" \
-H "Authorization: Bearer $PB_API_KEY"
Idempotency
Writes that create or act take an Idempotency-Key header: any string of 8 to 128 characters that you choose. Send the same key with the same request within 24 hours and you get the first response again, marked Idempotent-Replayed: true. Nothing runs twice.
Use a new key for every new action. The same key with a different request is refused with 409 IDEMPOTENCY_CONFLICT.
If a reply is lost, retry with the same key. Where an operation behaves differently, its description says so.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/restart" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: 6f1c2a9e-restart-web-1"
Errors
A 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. Quote request_id (also in the X-Request-Id header) when you contact support.
All error codes
UNAUTHORIZEDFORBIDDEN_SCOPEACCOUNT_RESTRICTEDMAINTENANCENOT_FOUNDNOT_READYLIMIT_REACHEDALREADY_EXISTSPRECONDITIONVALIDATION_FAILEDRESOURCE_STATE_CONFLICTIDEMPOTENCY_CONFLICTIN_PROGRESSRATE_LIMITEDUPSTREAM_UNAVAILABLEUNAVAILABLEINTERNAL
An unknown id and an id that belongs to another account both answer 404 NOT_FOUND.
{
"type": "about:blank",
"status": 409,
"code": "PRECONDITION",
"title": "A precondition for this operation is not met.",
"detail": "A precondition for this operation is not met.",
"reason": "unpaid_renewal_invoice",
"details": {
"invoice_id": 9150
},
"request_id": "req_0123456789abcdef0123456789abcdef",
"retryable": false
}
Pagination
Long lists take limit and cursor. A page that has more after it returns next_cursor; pass it back as cursor. When next_cursor is null you have everything.
curl "https://api.privatebyte.com/v1/vms?limit=50&cursor={next_cursor}" \
-H "Authorization: Bearer $PB_API_KEY"
Rate limits
Requests are limited per account. Over the limit, the API answers 429 RATE_LIMITED with a Retry-After header in seconds. Wait that long, then send the request again.
Some writes have their own allowance, and their descriptions say so. Repeated requests with a wrong key are limited too.
MCP server
AI agents can use your account through the Model Context Protocol. Add https://mcp.privatebyte.com to your client as a remote server and send your API key as a Bearer token. Every tool is a call to this API with that key, so the key's permissions decide what the agent can do.
Tools that spend take a ceiling: the most you agree to pay. Tools that destroy data need the id repeated in confirm, and are marked so your client can ask you first. Give an agent a key with only the permissions it needs.
list_productsreads List what can be ordered, with monthly price and whether it is in stock.get_productreads Read one product: its prices per billing cycle and the operating systems and extras it can be ordered with.create_serverchanges Order a new server AND pay for it from the account wallet.order_productchanges Order something that is not a server (a Gateway, a static proxy address, proxy credit) AND pay for it from the account wallet.list_serversreads List the servers on the account with their id, name, plan, IP address and billing status..get_serverreads Read one server: power state, addresses, size, operating system and current resource use..server_powerchanges Start, stop or restart a server.get_operationreads Follow work started by another tool (power, backup, reinstall).create_snapshotchanges Take a snapshot of a server's disk as it is now, to roll back to later.create_backupchanges Start a full backup of a server.list_snapshotsreads List a server's snapshots with id, name, status and size.restore_snapshotasks first ROLLS THE SERVER'S DISK BACK to a snapshot.delete_snapshotasks first Delete one snapshot for good; it cannot be restored afterwards.list_backupsreads List a server's backups with id, status, type (manual or auto), size and time.restore_backupasks first OVERWRITES THE SERVER'S WHOLE DISK with a backup.delete_backupasks first Delete one backup for good; it cannot be restored afterwards.firewallasks first A server's firewall.server_usagereads A server's resource use: CPU, memory, disk and network now, plus up to 24 past samples over range (1h, 6h, 24h or 7d).ticketschanges Follow up on support tickets.set_rdnschanges Request a reverse DNS (PTR) record for one of a server's addresses, for example for a mail server; staff review it before it is set.rename_serverchanges Change a server's hostname (the name the machine calls itself), its display name in the account, or both.scheduleschanges A server's automatic backup and power schedules.isoasks first Boot a server from an ISO image, for a custom install or a rescue disk.top_upchanges Add funds to the account wallet: creates an unpaid funding invoice in the account currency and returns pay_url, a client-area link where the person pays it.add_ssh_keysasks first Let SSH keys log in to a server as its administrator (root).reinstall_serverasks first ERASES THE WHOLE DISK of a server and installs a fresh operating system.reset_server_passwordasks first Set a new administrator (root) password on a server and return it ONCE.open_consoleasks first Get a short-lived console (VNC over WebSocket) connection to a server.cancel_serviceasks first Cancel a service (a server's id is also its service id).get_balancereads Read the account wallet balance, in whole minor units with its currency.list_invoicesreads List recent invoices with their total and status.pay_invoicechanges Pay one unpaid invoice from the account wallet.proxy_statusreads Read the proxy balance, today's traffic, the default tier and where to connect.open_ticketchanges Open a support ticket read by PrivateByte staff.find_operationreads Search every operation of the PrivateByte API by words (for example "firewall rule", "reverse dns", "gateway key", "proxy whitelist").call_operationasks first Run any PrivateByte API operation by its name from find_operation.
{
"mcpServers": {
"privatebyte": {
"type": "http",
"url": "https://mcp.privatebyte.com",
"headers": {
"Authorization": "Bearer $PB_API_KEY"
}
}
}
}
Changelog
1.0.0November 2026 First release. 134 operations across servers, ssh keys, orders, catalog, services, billing, invoices, gateways, proxies, account, support tickets, rewards, referrals.
List your servers
GET /v1/vms
Operation vm.list
read vm:read
Lists the servers on your account that are active or suspended, in ascending id order. Cancelled and terminated servers are not listed. Each entry carries the server id that every other server operation takes as {id}. Page with limit and cursor until next_cursor is null. For live power state and resource figures, call vm.get for one server.
Query parameters
limitinteger 1–100, default 20cursorstring next_cursor from the previous page
Returns
dataarray of objects required Child fieldsidinteger required Server id. Use it as {id} in every /v1/vms/{id} path and asconfirmwhere an operation asks for the server idnamestring required Hostname or display name of the serverplanstring required Name of the plan the server is onstatusstring required Billing state. A suspended server is switched off by us and refuses every change except taking a backup, until its overdue invoice is paid. One of active, suspended.ipstring or null required Primary IP address, null when none is recorded yetnext_due_datestring or null required Date the next renewal is due (YYYY-MM-DD), null when unknown
next_cursorstring or null required Pass ascursorto get the next page; null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 4821,
"name": "web-1.example.com",
"plan": "Orbit",
"status": "active",
"ip": "203.0.113.10",
"next_due_date": "2026-12-01"
}
],
"next_cursor": null
}
One server, with live power state
GET /v1/vms/{id}
Operation vm.get
read vm:read
Returns one server with its billing state, live power state, size, addresses and current resource use. The live figures are read at the time of the call; when they cannot be read, power_state is unknown and the live fields are null, and the call still answers 200. Use it to check the result of a power operation, or to find out whether the server is suspended before changing it.
Path parameters
idinteger required Server id fromvm.list
Returns
idinteger required Server id. Use it as {id} in every /v1/vms/{id} path and asconfirmwhere an operation asks for the server idnamestring required Hostname or display name of the serverplanstring required Name of the plan the server is onstatusstring required Billing state. A suspended server is switched off by us and refuses every change except taking a backup, until its overdue invoice is paid. One of active, suspended.ipstring or null required Primary IP address, null when none is recorded yetnext_due_datestring or null required Date the next renewal is due (YYYY-MM-DD), null when unknownpower_statestring required Live power state. restarting, installing and migrating mean work is in progress; rescue means the server is booted into rescue mode; unknown means the live state could not be read just now, and every live figure below is then null. One of running, stopped, restarting, installing, rescue, suspended, migrating, unknown.vcpuinteger or null required Virtual CPU cores, null when the live state is unknownmemory_mbinteger or null required Memory in MB, null when the live state is unknowndisk_gbnumber or null required Primary disk size in GB, null when the live state is unknownosstring or null required Installed operating system, null when unknownlocationstring or null required Data centre location, null when unknownipsarray of strings required Every IPv4 and IPv6 address on the serveripv6_allocationsarray of objects required IPv6 addresses with the subnet and gateway needed to configure them inside the server; empty when the server has none Child fieldsaddressstring requiredsubnetstringgatewaystring
usernamestring or null required Login name of the administrator account inside the server (for example root), null when unknowncpu_usage_percentnumber or null requiredmemory_usage_percentnumber or null requiredmemory_used_mbnumber or null requireddisk_usage_percentnumber or null requireddisk_used_gbnumber or null requiredbandwidthobject or null required Network transfer counters in GB, null when the live state is unknown Child fieldsused_gbnumber or null requiredtotal_gbnumber or null requiredinbound_gbnumber or null requiredoutbound_gbnumber or null required
extra_disksarray of objects or null required Additional disks seen from inside a running server; null when the server is not running or the figures cannot be read Child fieldsdevicestring requiredtotal_gbnumber requiredused_gbnumber or null required
uptime_secondsnumber or null required Seconds since the server last booted, null when not running or unknown
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 4821,
"name": "web-1.example.com",
"plan": "Orbit",
"status": "active",
"ip": "203.0.113.10",
"next_due_date": "2026-12-01",
"power_state": "running",
"vcpu": 2,
"memory_mb": 4096,
"disk_gb": 50,
"os": "Ubuntu 24.04",
"location": "Europe",
"ips": [
"203.0.113.10",
"2001:db8:10::1"
],
"ipv6_allocations": [
{
"address": "2001:db8:10::1",
"subnet": "2001:db8:10::/64",
"gateway": "2001:db8:10::ffff"
}
],
"username": "root",
"cpu_usage_percent": 3.5,
"memory_usage_percent": 41,
"memory_used_mb": 1680,
"disk_usage_percent": 22,
"disk_used_gb": 11,
"bandwidth": {
"used_gb": 18.2,
"total_gb": 1024,
"inbound_gb": 6.1,
"outbound_gb": 12.1
},
"extra_disks": [],
"uptime_seconds": 86400
}
List recent activity on a server
GET /v1/vms/{id}/activity
Operation vm.activity.list
read vm:read
Returns the newest events on the server (started, stopped, reinstalled, backup created and so on), newest first, each with a plain label, an outcome and a time. Routine housekeeping is left out. It is meant for showing a person what happened; entries carry no ids, so it cannot follow a specific request. To follow a 202 response poll vm.operations.get, and for cancellable or retryable work use vm.tasks.list.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Newest first Child fieldsactionstring required What happened, as a label for people.Server operationcovers anything without a label of its own. One of Server operation, Server created, Server started, Server stopped, Server restarted, Operating system reinstalled, Server suspended, Server resumed, Plan changed, Boot mode changed, Root password reset, Server settings changed, Server powered off, IP address added, IP address removed, Reverse DNS updated, Backup created, Backup restored, Backup deleted, Snapshot created, Snapshot restored, Snapshot deleted.statusstring required pending means still running. One of success, failed, pending.occurred_attimestamp required When it finished, or when it started if it is still running
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/activity" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"action": "Server restarted",
"status": "success",
"occurred_at": "2026-11-14T10:00:21.000Z"
},
{
"action": "Backup created",
"status": "success",
"occurred_at": "2026-11-13T02:10:05.000Z"
}
]
}
Read a server's automatic backup schedule
GET /v1/vms/{id}/backup-schedule
Operation vm.backup_schedule.get
read vm:read
Returns whether scheduled backups are on, when they run and how many are kept. The time of day is in UTC. Backups taken by the schedule appear in vm.backups.list with type auto.
Path parameters
idinteger required Server id fromvm.list
Returns
enabledboolean required Whether scheduled backups run.scheduleobject or null required Null when no schedule has been set. Child fieldstypestring required One of daily, weekly, monthly.timeobject required Child fieldshourinteger requiredminutesinteger required
daysarray of integers required
limitinteger or null required How many scheduled backups are kept: 3, 5, 7, 14 or 30. Null when not set.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/backup-schedule" \
-H "Authorization: Bearer $PB_API_KEY"
{
"enabled": true,
"schedule": {
"type": "weekly",
"time": {
"hour": 3,
"minutes": 30
},
"days": [
1,
4
]
},
"limit": 7
}
Set a server's automatic backup schedule
POST /v1/vms/{id}/backup-schedule
Operation vm.backup_schedule.set
safe vm:writeIdempotency-Key
Saves the schedule, replacing the earlier one. Backups can run daily, weekly on chosen weekdays (1 is Monday, 7 is Sunday) or monthly on chosen days of the month, at one time of day given in UTC; limit is how many scheduled backups are kept (3, 5, 7, 14 or 30, default 7). To turn scheduled backups off send enabled false together with the schedule you had, not null. Returns the schedule as saved.
Path parameters
idinteger required Server id fromvm.list
Body
enabledboolean requiredscheduleobject or null required Child fieldstypestring required One of daily, weekly, monthly.timeobject required Child fieldshourinteger requiredminutesinteger required
daysarray of integers required
limit3 or 5 or 7 or 14 or 30
Returns
enabledboolean required Whether scheduled backups run.scheduleobject or null required Null when no schedule has been set. Child fieldstypestring required One of daily, weekly, monthly.timeobject required Child fieldshourinteger requiredminutesinteger required
daysarray of integers required
limitinteger or null required How many scheduled backups are kept: 3, 5, 7, 14 or 30. Null when not set.
Refusals specific to this operation
VALIDATION_FAILED400 The schedule is not acceptable:enabledtrue with no schedule, days that do not fit the type (none for daily, 1 to 7 for weekly, 1 to 31 for monthly, no repeats), or alimitother than 3, 5, 7, 14 or 30.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.backup_schedule.get, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/backup-schedule" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"schedule": {
"type": "weekly",
"time": {
"hour": 3,
"minutes": 30
},
"days": [
1,
4
]
},
"limit": 7
}'
{
"enabled": true,
"schedule": {
"type": "weekly",
"time": {
"hour": 3,
"minutes": 30
},
"days": [
1,
4
]
},
"limit": 7
}
A server's backups
GET /v1/vms/{id}/backups
Operation vm.backups.list
read vm:read
Lists the backups of a server, both the ones you started (manual) and the ones taken by the backup schedule (auto). A backup with status created is finished and can be restored with vm.backups.restore. Each id is what vm.backups.restore and vm.backups.delete take as {backup_id} and as confirm.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Child fieldsidinteger required Backup id. Use it as {backup_id} and asconfirmwhen restoring or deleting this backupstatusstring required created: finished and usable. pending or creating: still being taken. restoring: being restored onto the server right now. One of pending, creating, created, failed, restoring.typestring required manual: started by you. auto: taken by the backup schedule. One of manual, auto.size_bytesinteger required Size in bytes; 0 until the backup has finishedcreated_attimestamp or null required When the backup was taken, null when not recorded
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/backups" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 3051,
"status": "created",
"type": "manual",
"size_bytes": 5368709120,
"created_at": "2026-11-13T02:10:05.000Z"
}
]
}
Start a backup
POST /v1/vms/{id}/backups
Operation vm.backups.create
safe vm:writeIdempotency-Key
Starts a full backup of the server's disk. The server keeps running. Unlike other changes it is also allowed while the server is suspended, so data can be saved before it is lost. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: the new backup appears in vm.backups.list with status created when it is done.
Path parameters
idinteger required Server id fromvm.list
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403 Your account is restricted. Nothing was started. A suspended server alone does not cause this refusal.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/backups" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "backup",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Delete a backup
DELETE /v1/vms/{id}/backups/{backup_id}
Operation vm.backups.delete
destructive vm:destroyIdempotency-Key
Deletes one backup for good; it cannot be recovered. The server itself is not touched. confirm is a query parameter and must equal the backup id in the path. The answer is 200 with an operation object; the backup disappears from vm.backups.list once it is gone, and vm.operations.get can be polled the same way as after a 202 if you need to wait for that. The account owner is emailed.
Path parameters
idinteger required Server id fromvm.listbackup_idinteger required Backup id from the backups list
Query parameters
confirminteger required Must equal the backup id in the path ({backup_id}).
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the backup id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.NOT_FOUND404 The backup is not one of this server's backups, or is already deleted.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X DELETE "https://api.privatebyte.com/v1/vms/{id}/backups/{backup_id}?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "backup_delete",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Restore a backup. Overwrites the disk
POST /v1/vms/{id}/backups/{backup_id}/restore
Operation vm.backups.restore
destructive vm:destroyIdempotency-Key
Overwrites the server's disk with the contents of a backup: everything written since that backup is lost, and the server is offline while it runs. The backup must belong to this server. confirm must equal the backup id in the path. The account owner is emailed. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state.
Path parameters
idinteger required Server id fromvm.listbackup_idinteger required Backup id from the backups list
Body
confirminteger required Must equal the backup id in the path ({backup_id}), as an integer
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the backup id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.NOT_FOUND404 The backup is not one of this server's backups. Nothing was changed. Readvm.backups.list.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/backups/{backup_id}/restore" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 3051
}'
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "backup_restore",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Boot a server from its disk or the rescue system
POST /v1/vms/{id}/boot-mode
Operation vm.boot_mode.set
destructive vm:destroyIdempotency-Key
Sets what the server boots the next time it starts: disk is its installed operating system, rescue is a temporary recovery system for repairing the disk or recovering files. The change only takes effect at the next boot and this operation does not restart the server: call vm.restart (or vm.start if it is stopped) yourself. While the server runs the rescue system its own operating system and everything it serves are down; set disk and restart to go back. confirm must equal the server id.
Path parameters
idinteger required Server id fromvm.list
Body
boot_modestring required disk boots the installed operating system. rescue boots a temporary recovery system used to repair the disk or recover files. One of disk, rescue.confirminteger required Must equal the server id in the URL.
Returns
boot_modestring required disk boots the installed operating system. rescue boots a temporary recovery system used to repair the disk or recover files. One of disk, rescue.restart_requiredtrue required Always true: the change applies the next time the server boots. This operation does not restart or start the server.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.409409 IN_PROGRESS (reason: server_busy): Another change to the server is still being applied. Nothing was changed. Wait a few seconds and send the request again.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.get, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/boot-mode" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"boot_mode": "rescue",
"confirm": 4821
}'
{
"boot_mode": "rescue",
"restart_required": true
}
Open a console connection to a server
POST /v1/vms/{id}/console
Operation vm.console
destructive vm:destroy
Returns a WebSocket address for a VNC client that shows the server's screen and accepts keyboard and mouse input. This is full interactive control of the machine, including during boot and when its network is down, so treat the response as a secret. The connection must be opened before expires_at, about five minutes after the call; ask again for a new one after that. Each call returns a fresh connection and nothing is stored for replay (this operation takes no Idempotency-Key). confirm must equal the server id.
Path parameters
idinteger required Server id fromvm.list
Body
confirminteger required Must equal the server id in the path ({id}), as an integer
Returns
access_tokenstring required Single-purpose credential for this console connection. Treat it as a secret: whoever holds it controls the server until it expiresexpires_attimestamp required The connection must be opened before this time (about five minutes after the request). Ask for a new one afterwardswebsocket_urlstring required WebSocket address to connect a VNC client to. It already carries the access token
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the server id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/console" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"access_token": "example-console-token",
"expires_at": "2026-11-14T10:05:00.000Z",
"websocket_url": "wss://console.example.com/connect?token=example-console-token"
}
List a server's firewall rules
GET /v1/vms/{id}/firewall
Operation vm.firewall.list
read vm:read
Returns the rules of the firewall that sits in front of the server, outside its operating system. Rules are checked from the top of the list down and the first one that matches decides; traffic that no rule matches is allowed. With no rules everything is allowed. Rules act on new connections, so sessions that are already open are not cut, and they cover IPv4 only: IPv6 traffic is not filtered. enabled says whether the rules can be changed right now.
Path parameters
idinteger required Server id fromvm.list
Returns
enabledboolean required False when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.versioninteger required Goes up by one with every change to the rules.rulesarray of objects required In the order they are checked: the first matching rule decides, and traffic no rule matches is allowed. Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring required Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring required IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring required Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -idinteger required Rule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/firewall" \
-H "Authorization: Bearer $PB_API_KEY"
{
"enabled": true,
"version": 2,
"rules": [
{
"id": 1,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "203.0.113.0/24",
"action": "accept",
"comment": "SSH from the office"
},
{
"id": 2,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "0.0.0.0/0",
"action": "drop",
"comment": "Block other SSH"
}
]
}
Add a firewall rule at the end of a server's list
POST /v1/vms/{id}/firewall
Operation vm.firewall.add
destructive vm:destroyIdempotency-Key
Adds one rule and applies it at once, with no restart. The new rule goes to the bottom of the list, so it is checked last: Rules are checked from the top of the list down and the first one that matches decides; traffic that no rule matches is allowed. Use vm.firewall.move if it must come before an existing rule. A server can have up to 30 rules, and a rule that would drop all UDP or all traffic from everywhere with no port is refused because it would also block replies such as DNS. A wrong rule can lock you out of your own server (for example a drop rule that covers your SSH or remote desktop port). The console (vm.console) and this API are not affected by the firewall, so you can always get back in through the console and undo the change with vm.firewall.remove or vm.firewall.reset. confirm must equal the server id. Returns the whole list after the change.
Path parameters
idinteger required Server id fromvm.list
Body
ruleobject required Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -
confirminteger required Must equal the server id in the URL.
Returns
enabledboolean required False when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.versioninteger required Goes up by one with every change to the rules.rulesarray of objects required In the order they are checked: the first matching rule decides, and traffic no rule matches is allowed. Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring required Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring required IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring required Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -idinteger required Rule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.400400 VALIDATION_FAILED (reason: invalid_firewall_rule): The rule is not acceptable: the address is not IPv4 or has host bits set, the port is not a port or range between 1 and 65535, an icmp rule has a port, or the rule would drop all UDP or all traffic from everywhere.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.409409 LIMIT_REACHED (reason: firewall_rule_limit): The server already has the most rules it can have (details.max_rules). Remove one withvm.firewall.removefirst.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.firewall.list, and send the change again with a new key only if it did not apply.503503 UNAVAILABLE (reason: firewall_changes_unavailable): Firewall changes are switched off for this server (enabledis false invm.firewall.list). Rules already in force keep working. Retrying soon will not help.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/firewall" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"rule": {
"direction": "in",
"protocol": "tcp",
"port": "443",
"ip": "0.0.0.0/0",
"action": "accept",
"comment": "HTTPS"
},
"confirm": 4821
}'
{
"enabled": true,
"version": 3,
"rules": [
{
"id": 1,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "203.0.113.0/24",
"action": "accept",
"comment": "SSH from the office"
},
{
"id": 2,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "0.0.0.0/0",
"action": "drop",
"comment": "Block other SSH"
},
{
"id": 3,
"direction": "in",
"protocol": "tcp",
"port": "443",
"ip": "0.0.0.0/0",
"action": "accept",
"comment": "HTTPS"
}
]
}
Remove one firewall rule from a server
POST /v1/vms/{id}/firewall/{rule_id}/delete
Operation vm.firewall.remove
destructive vm:destroyIdempotency-Key
Deletes the rule and applies the remaining rules at once. Removing a rule changes what the rules below it catch: taking away an accept rule that sits above a drop rule can block that traffic. A wrong rule can lock you out of your own server (for example a drop rule that covers your SSH or remote desktop port). The console (vm.console) and this API are not affected by the firewall, so you can always get back in through the console and undo the change with vm.firewall.remove or vm.firewall.reset. confirm must equal the rule id, not the server id. Returns the whole list after the change.
Path parameters
idinteger required Server id fromvm.listrule_idinteger required Firewall rule id fromvm.firewall.list
Body
confirminteger required Must equal the rule id in the URL.
Returns
enabledboolean required False when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.versioninteger required Goes up by one with every change to the rules.rulesarray of objects required In the order they are checked: the first matching rule decides, and traffic no rule matches is allowed. Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring required Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring required IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring required Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -idinteger required Rule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the rule id as an integer (field: confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: firewall_rule_not_found): The server has no rule with this id. Read the rule ids withvm.firewall.list.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.firewall.list, and send the change again with a new key only if it did not apply.503503 UNAVAILABLE (reason: firewall_changes_unavailable): Firewall changes are switched off for this server (enabledis false invm.firewall.list). Rules already in force keep working. Retrying soon will not help.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/firewall/{rule_id}/delete" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 2
}'
{
"enabled": true,
"version": 4,
"rules": [
{
"id": 1,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "203.0.113.0/24",
"action": "accept",
"comment": "SSH from the office"
},
{
"id": 3,
"direction": "in",
"protocol": "tcp",
"port": "443",
"ip": "0.0.0.0/0",
"action": "accept",
"comment": "HTTPS"
}
]
}
Move a firewall rule one place up or down
POST /v1/vms/{id}/firewall/{rule_id}/move
Operation vm.firewall.move
destructive vm:destroyIdempotency-Key
Swaps the rule with the one directly above it (up, checked sooner) or below it (down, checked later) and applies the new order at once. Rules are checked from the top of the list down and the first one that matches decides; traffic that no rule matches is allowed. Call it again to move a rule further. A wrong rule can lock you out of your own server (for example a drop rule that covers your SSH or remote desktop port). The console (vm.console) and this API are not affected by the firewall, so you can always get back in through the console and undo the change with vm.firewall.remove or vm.firewall.reset. confirm must equal the rule id, not the server id. Returns the whole list in its new order.
Path parameters
idinteger required Server id fromvm.listrule_idinteger required Firewall rule id fromvm.firewall.list
Body
directionstring required up moves the rule one place earlier (checked sooner); down one place later. One of up, down.confirminteger required Must equal the rule id in the URL.
Returns
enabledboolean required False when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.versioninteger required Goes up by one with every change to the rules.rulesarray of objects required In the order they are checked: the first matching rule decides, and traffic no rule matches is allowed. Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring required Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring required IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring required Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -idinteger required Rule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the rule id as an integer (field: confirm). Nothing was changed.400400 VALIDATION_FAILED (reason: rule_already_first): The rule is already at the top, so it cannot move up.400400 VALIDATION_FAILED (reason: rule_already_last): The rule is already at the bottom, so it cannot move down.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: firewall_rule_not_found): The server has no rule with this id. Read the rule ids withvm.firewall.list.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.firewall.list, and send the change again with a new key only if it did not apply.503503 UNAVAILABLE (reason: firewall_changes_unavailable): Firewall changes are switched off for this server (enabledis false invm.firewall.list). Rules already in force keep working. Retrying soon will not help.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/firewall/{rule_id}/move" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"direction": "up",
"confirm": 3
}'
{
"enabled": true,
"version": 4,
"rules": [
{
"id": 1,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "203.0.113.0/24",
"action": "accept",
"comment": "SSH from the office"
},
{
"id": 3,
"direction": "in",
"protocol": "tcp",
"port": "443",
"ip": "0.0.0.0/0",
"action": "accept",
"comment": "HTTPS"
},
{
"id": 2,
"direction": "in",
"protocol": "tcp",
"port": "22",
"ip": "0.0.0.0/0",
"action": "drop",
"comment": "Block other SSH"
}
]
}
Remove every firewall rule from a server
POST /v1/vms/{id}/firewall/reset
Operation vm.firewall.reset
destructive vm:destroyIdempotency-Key
Deletes all of the server's rules at once, which puts the firewall back to how a new server starts: no rules, all traffic allowed. Use it to recover when a rule has locked you out. The removed rules cannot be brought back, so read them with vm.firewall.list first if you may want them again. confirm must equal the server id. Returns the now empty list.
Path parameters
idinteger required Server id fromvm.list
Body
confirminteger required Must equal the server id in the URL.
Returns
enabledboolean required False when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.versioninteger required Goes up by one with every change to the rules.rulesarray of objects required In the order they are checked: the first matching rule decides, and traffic no rule matches is allowed. Child fieldsdirectionstring required in: traffic arriving at the server. out: traffic leaving it. One of in, out.protocolstring required any covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.portstring required Destination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.ipstring required IPv4 address or network with no host bits set, e.g. 203.0.113.9 or 198.51.100.0/24. It is the source for direction in and the destination for direction out. Defaults to 0.0.0.0/0 (anywhere). IPv6 is not supported.actionstring required accept lets matching traffic through. drop discards it without a reply. One of accept, drop.commentstring required Your own note, up to 80 characters: letters, digits, spaces and. _: / @ ( ) +, -idinteger required Rule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.firewall.list, and send the change again with a new key only if it did not apply.503503 UNAVAILABLE (reason: firewall_changes_unavailable): Firewall changes are switched off for this server (enabledis false invm.firewall.list). Rules already in force keep working. Retrying soon will not help.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/firewall/reset" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"enabled": true,
"version": 5,
"rules": []
}
Cut power to a server immediately, without a clean shutdown
POST /v1/vms/{id}/force-stop
Operation vm.force_stop
destructive vm:powerIdempotency-Key
Cuts power at once, like pulling the plug: the operating system gets no chance to shut down, so unsaved data can be lost and a file system may need repair. Use it only when vm.stop did not work. confirm must equal the server id in the path. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state.
Path parameters
idinteger required Server id fromvm.list
Body
confirminteger required Must equal the server id in the path ({id}), as an integer
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the server id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/force-stop" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "force_stop",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Change a server's hostname
POST /v1/vms/{id}/hostname
Operation vm.hostname.set
safe vm:writeIdempotency-Key
Records a new hostname for the server and uses it as the server's name in your account (the name in vm.list and vm.get). The server is not restarted and nothing is run inside it, so the hostname the operating system itself reports may stay as it is until you change it there. Returns the hostname that was saved.
Path parameters
idinteger required Server id fromvm.list
Body
hostnamestring required A host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Returns
hostnamestring required A host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.get, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/hostname" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"hostname": "web-1.example.com"
}'
{
"hostname": "web-1.example.com"
}
List a server's addresses and their reverse DNS
GET /v1/vms/{id}/ips
Operation vm.ips.list
read vm:read
Returns every address assigned to the server, IPv4 and IPv6, each with the state of its reverse DNS (PTR) record: none, pending review, active, rejected, or removal pending. IPv6 addresses also carry the subnet and gateway needed to configure them on the server. Use an address from this list with vm.rdns.set or vm.rdns.clear.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Child fieldsipstring required The addressversion4 or 6 required 4 for IPv4, 6 for IPv6subnetstring IPv6 only: the subnet this address belongs to, needed to configure the address on the servergatewaystring IPv6 only: the gateway for that subnetrdnsobject required Child fieldshostnamestring or null required The PTR host name requested or in force; null when status is nonestatusstring required none: no request. pending: waiting for staff review. active: the PTR record is set. rejected: declined; send a corrected request or open a support ticket. removal_pending: an active record was cleared and staff are removing it; it reads none once removed. One of none, pending, active, rejected, removal_pending.updated_attimestamp or null required When the request last changed (made, reviewed or withdrawn); null when there has never been onecreated_attimestamp or null required When the request was made or withdrawn by you; null when there has never been onereview_notestring or null required The reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/ips" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"ip": "203.0.113.10",
"version": 4,
"rdns": {
"hostname": "mail.example.com",
"status": "active",
"updated_at": "2026-11-13T16:20:00.000Z",
"created_at": "2026-11-13T09:00:00.000Z",
"review_note": "PTR record set"
}
},
{
"ip": "2001:db8:10::5",
"version": 6,
"subnet": "2001:db8:10::/64",
"gateway": "2001:db8:10::1",
"rdns": {
"hostname": null,
"status": "none",
"updated_at": null,
"created_at": null,
"review_note": null
}
}
]
}
Request a reverse DNS (PTR) record
PUT /v1/vms/{id}/ips/{ip}/rdns
Operation vm.rdns.set
safe vm:writeIdempotency-Key
Files a request for the address to resolve back to the host name you give. A person reviews it, so the record is not set by this call: the answer is 202 with rdns.status pending. To follow it, call vm.ips.list and read rdns.status for the address until it is active (the record is set) or rejected (see review_note); review can take hours, so check every few minutes at most. Point the host name's own DNS at the address first, because a request that does not match may be rejected. A new request for the same address replaces the earlier one.
Path parameters
idinteger required Server id fromvm.listipstring required One of this server's own IPv4 or IPv6 addresses, fromvm.ips.list
Body
hostnamestring required Fully qualified host name the address should resolve back to, e.g. mail.example.com: 4 to 253 characters, letters, digits and hyphens in dot-separated labels, ending in a top-level domain. Stored in lower case
Returns
ipobject required Child fieldsipstring required The addressversion4 or 6 required 4 for IPv4, 6 for IPv6rdnsobject required Child fieldshostnamestring or null required The PTR host name requested or in force; null when status is nonestatusstring required none: no request. pending: waiting for staff review. active: the PTR record is set. rejected: declined; send a corrected request or open a support ticket. removal_pending: an active record was cleared and staff are removing it; it reads none once removed. One of none, pending, active, rejected, removal_pending.updated_attimestamp or null required When the request last changed (made, reviewed or withdrawn); null when there has never been onecreated_attimestamp or null required When the request was made or withdrawn by you; null when there has never been onereview_notestring or null required The reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
VALIDATION_FAILED400 The host name is not a fully qualified name such as mail.example.com (field: hostname).ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: ip_not_on_server): The address is not one of this server's own addresses. Read them withvm.ips.list.
curl -X PUT "https://api.privatebyte.com/v1/vms/{id}/ips/{ip}/rdns" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"hostname": "mail.example.com"
}'
{
"ip": {
"ip": "203.0.113.10",
"version": 4,
"rdns": {
"hostname": "mail.example.com",
"status": "pending",
"updated_at": "2026-11-14T10:00:00.000Z",
"created_at": "2026-11-14T10:00:00.000Z",
"review_note": null
}
}
}
Withdraw a reverse DNS (PTR) request for an address
DELETE /v1/vms/{id}/ips/{ip}/rdns
Operation vm.rdns.clear
safe vm:writeIdempotency-Key
Withdraws the request on file for the address. A pending or rejected request is withdrawn at once and rdns.status reads none; there is nothing to poll. If the record is already active, staff remove it from DNS: rdns.status reads removal_pending until they have, then none, so poll vm.ips.list every few minutes at most.
Path parameters
idinteger required Server id fromvm.listipstring required One of this server's own IPv4 or IPv6 addresses, fromvm.ips.list
Returns
ipobject required Child fieldsipstring required The addressversion4 or 6 required 4 for IPv4, 6 for IPv6rdnsobject required Child fieldshostnamestring or null required The PTR host name requested or in force; null when status is nonestatusstring required none: no request. pending: waiting for staff review. active: the PTR record is set. rejected: declined; send a corrected request or open a support ticket. removal_pending: an active record was cleared and staff are removing it; it reads none once removed. One of none, pending, active, rejected, removal_pending.updated_attimestamp or null required When the request last changed (made, reviewed or withdrawn); null when there has never been onecreated_attimestamp or null required When the request was made or withdrawn by you; null when there has never been onereview_notestring or null required The reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: ip_not_on_server): The address is not one of this server's own addresses. Read them withvm.ips.list.
curl -X DELETE "https://api.privatebyte.com/v1/vms/{id}/ips/{ip}/rdns" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"ip": {
"ip": "203.0.113.10",
"version": 4,
"rdns": {
"hostname": null,
"status": "none",
"updated_at": "2026-11-14T10:05:00.000Z",
"created_at": "2026-11-14T10:05:00.000Z",
"review_note": null
}
}
}
Set a stopped server to boot from an ISO image
POST /v1/vms/{id}/iso
Operation vm.iso.mount
destructive vm:destroyIdempotency-Key
Attaches an image from vm.iso.list and makes it the boot device. The server must be stopped first (vm.stop, then wait until vm.get shows power_state stopped), must be set to boot from disk, and must not already have an image mounted. This operation does not start the server: call vm.start, and it boots from the image; work in the installer through the console (vm.console). Mounting changes nothing on the disk, but an installer can erase it, and an installer does not get a network address by itself: enter the server's address and gateway by hand. confirm must equal the server id.
Path parameters
idinteger required Server id fromvm.list
Body
iso_image_idinteger required An image id from the ISO image list of this server.confirminteger required Must equal the server id in the URL.
Returns
mountedstring or null required Name of the mounted image, or null when none is mounted.restart_requiredtrue required Always true: the change applies the next time the server boots. This operation does not restart or start the server.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.400400 VALIDATION_FAILED (reason: iso_already_mounted): An image is already mounted. Remove it withvm.iso.unmountfirst.400400 VALIDATION_FAILED (reason: boot_mode_is_rescue): The server is set to boot the rescue system. Set it back withvm.boot_mode.set(disk) first.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: iso_image_not_found): The image id is not one of this server's images. Read the ids withvm.iso.list.409409 IN_PROGRESS (reason: server_not_stopped): The server is not stopped. Stop it withvm.stop, wait untilvm.getshows power_state stopped, then send the request again.409409 IN_PROGRESS (reason: server_busy): The server is stopped but another task on it is still running. Wait for it to finish, then send the request again.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.iso.list, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/iso" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"iso_image_id": 37,
"confirm": 4821
}'
{
"mounted": "debian-13-netinst",
"restart_required": true
}
List the ISO images a server can boot from
GET /v1/vms/{id}/iso-images
Operation vm.iso.list
read vm:read
Returns the ISO images that have been uploaded for this server, which is an empty list until one is, and the name of the one it is currently set to boot from, if any. Use an image id with vm.iso.mount. If the image you need is not listed, open a support ticket (tickets.create) with a download link to it.
Path parameters
idinteger required Server id fromvm.list
Returns
imagesarray of objects required ISO images this server can boot from. Child fieldsidinteger requirednamestring requiredsize_mbnumber required Image size in megabytes.
mountedstring or null required Name of the image the server is set to boot from, or null when none is mounted.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/iso-images" \
-H "Authorization: Bearer $PB_API_KEY"
{
"images": [
{
"id": 37,
"name": "debian-13-netinst",
"size_mb": 790
}
],
"mounted": null
}
Detach the ISO image and boot from disk again
POST /v1/vms/{id}/iso/unmount
Operation vm.iso.unmount
destructive vm:destroyIdempotency-Key
Removes the mounted image and sets the server to boot from its own disk. The server must be stopped first (vm.stop, then wait until vm.get shows power_state stopped). This operation does not start the server: call vm.start afterwards. It succeeds without changing anything when no image is mounted. confirm must equal the server id.
Path parameters
idinteger required Server id fromvm.list
Body
confirminteger required Must equal the server id in the URL.
Returns
mountedstring or null required Name of the mounted image, or null when none is mounted.restart_requiredtrue required Always true: the change applies the next time the server boots. This operation does not restart or start the server.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.400400 VALIDATION_FAILED (reason: boot_mode_is_rescue): The server is set to boot the rescue system, not an image. Usevm.boot_mode.set(disk) instead.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.409409 IN_PROGRESS (reason: server_not_stopped): The server is not stopped. Stop it withvm.stop, wait untilvm.getshows power_state stopped, then send the request again.409409 IN_PROGRESS (reason: server_busy): The server is stopped but another task on it is still running. Wait for it to finish, then send the request again.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.iso.list, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/iso/unmount" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"mounted": null,
"restart_required": true
}
Read up to 24 past resource samples for a server
GET /v1/vms/{id}/metrics/history
Operation vm.metrics.history
read vm:read
Returns samples of CPU, memory, disk space, disk activity and network activity over the chosen range (1h, 6h, 24h or 7d; default 1h), oldest first. When more than 24 samples exist the period is split into 24 equal parts and the latest sample of each part is returned. History is kept for 7 days. A missing sample or a null value means nothing was measured then, not zero usage; an empty list means nothing has been collected for that period.
Path parameters
idinteger required Server id fromvm.list
Query parameters
rangestring History period; defaults to 1h.
Returns
historyarray of objects required Oldest first. A gap means no sample was collected, not zero usage. Child fieldssampled_attimestamp required When the sample was taken.cpu_usage_percentnumber or null required CPU in use, 0 to 100, averaged across the server's vCPUs. Null when it could not be measured.memory_usage_percentnumber or null required Memory in use, 0 to 100. Null when it could not be measured.disk_usage_percentnumber or null required Space used on the main disk, 0 to 100. Null when it could not be measured.disk_read_kb_per_secnumber or null required Disk reads. A rate in kilobytes per second around the time of the sample, not a running total. Null when it could not be measured.disk_write_kb_per_secnumber or null required Disk writes. A rate in kilobytes per second around the time of the sample, not a running total. Null when it could not be measured.network_in_kb_per_secnumber or null required Traffic received. A rate in kilobytes per second around the time of the sample, not a running total. Null when it could not be measured.network_out_kb_per_secnumber or null required Traffic sent. A rate in kilobytes per second around the time of the sample, not a running total. Null when it could not be measured.bandwidth_used_gbnumber or null required Traffic counted so far, in gigabytes: a running total, not a rate. Null on samples that do not carry it.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/metrics/history" \
-H "Authorization: Bearer $PB_API_KEY"
{
"history": [
{
"sampled_at": "2026-11-14T09:00:00.000Z",
"cpu_usage_percent": 11.5,
"memory_usage_percent": 37.2,
"disk_usage_percent": 41,
"disk_read_kb_per_sec": 3.1,
"disk_write_kb_per_sec": 98.4,
"network_in_kb_per_sec": 75,
"network_out_kb_per_sec": 280.9,
"bandwidth_used_gb": null
},
{
"sampled_at": "2026-11-14T09:05:00.000Z",
"cpu_usage_percent": 64,
"memory_usage_percent": 39.8,
"disk_usage_percent": 41,
"disk_read_kb_per_sec": null,
"disk_write_kb_per_sec": null,
"network_in_kb_per_sec": 1250.3,
"network_out_kb_per_sec": 4100,
"bandwidth_used_gb": 182.44
}
]
}
Change the name a server is shown under in your account
POST /v1/vms/{id}/name
Operation vm.name.set
safe vm:writeIdempotency-Key
Changes only the label shown for the server in your account (the name in vm.list and vm.get). The server itself is not touched and keeps running. The name follows the same rules as a hostname. Returns the name that was saved.
Path parameters
idinteger required Server id fromvm.list
Body
namestring required A host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Returns
namestring required A host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.get, and send the change again with a new key only if it did not apply.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/name" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "web-1.example.com"
}'
{
"name": "web-1.example.com"
}
Status of an operation started on a server
GET /v1/vms/{id}/operations/{op_id}
Operation vm.operations.get
read vm:read
Returns the current status of one operation started by a 202 response: start, stop, restart, force stop, reinstall, backup create, restore or delete, snapshot restore or delete. This is the operation to poll: read operation.status every 5 seconds; pending and running mean keep waiting, succeeded and failed are final (a cancelled operation reports failed). progress is a percentage when one is known. Operation ids are kept for 24 hours and only answer on the server they were started on; after that the call is 404.
Path parameters
idinteger required Server id fromvm.listop_idstring required Operation id from a 202 response
Returns
operationobject required Child fieldsidstring required The operation id you asked aboutactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.statusstring required pending: accepted, not started or not yet observable. running: in progress. succeeded and failed are final; a cancelled operation reports failed. One of pending, running, succeeded, failed.progressinteger or null required Percent complete, 0 to 100; null when no progress figure is availablevm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was acceptedupdated_attimestamp or null required When the status last changed, null when not known
Refusals specific to this operation
NOT_FOUND404 The operation id is older than 24 hours, was started on a different server, or is not yours.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/operations/{op_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "restart",
"status": "succeeded",
"progress": 100,
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z",
"updated_at": "2026-11-14T10:00:21.000Z"
}
}
OS images this server can be reinstalled with
GET /v1/vms/{id}/os-images
Operation vm.os_images.list
read vm:read
Lists the operating system images this particular server can be reinstalled with. Pass an entry's id as os_image_id to vm.reinstall; an id that is not in this list for this server is refused. Read it shortly before reinstalling, because the choice can change.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Child fieldsidinteger required Image id. Pass it asos_image_idto POST /v1/vms/{id}/reinstallnamestring required Family and version together, e.g. Ubuntu 24.04familystring requiredversionstring required
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/os-images" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 41,
"name": "Ubuntu 24.04",
"family": "Ubuntu",
"version": "24.04"
},
{
"id": 37,
"name": "Debian 12",
"family": "Debian",
"version": "12"
}
]
}
Set a new administrator (root) password and return it once
POST /v1/vms/{id}/password-reset
Operation vm.password_reset
destructive vm:destroyIdempotency-Key
Sets a new random password for the administrator account inside the server (root on Linux) and returns it in this response. The old password stops working. The new one is shown this once and is not kept anywhere: a replay with the same Idempotency-Key answers password: null with a note, so store the password when you receive it, and run the operation again with a new key if it was lost. confirm must equal the server id. The account owner is emailed.
Path parameters
idinteger required Server id fromvm.list
Body
confirminteger required Must equal the server id in the path ({id}), as an integer
Returns
passwordstring or null required The new administrator (root) password. Shown in this one response and stored nowhere; null only when this is a replay of an earlier request with the same Idempotency-Keynotestring Present only on a replay: says the reset already happened
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the server id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409 PRECONDITION (reason: boot_mode_is_rescue): The server is running the rescue system, so the password of its installed system cannot be set. Set the boot mode back to disk withvm.boot_mode.set, restart, then try again.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.UPSTREAM_UNAVAILABLE502 The request may or may not have taken effect. Repeating it with the same Idempotency-Key returns this same answer; check the current state first, then send a new request with a new key if it is still needed.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/password-reset" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"password": "example-Passw0rd-shown-once"
}
Ping a server's primary address from our network
POST /v1/vms/{id}/ping
Operation vm.ping
safe vm:readIdempotency-Key
Sends three pings from our side to the server's primary IP address and reports whether it answered and the average round-trip time. It changes nothing on the server. unreachable only means ping got no answer: a server whose firewall drops ping reports unreachable while working normally, so check vm.get power_state before concluding it is down.
Path parameters
idinteger required Server id fromvm.list
Returns
latencynumber or null required Average round-trip time in whole milliseconds; null when unreachable or not measuredstatusstring required unreachable means no reply to ping within a few seconds. A server whose firewall drops ping reports unreachable while working normally. One of reachable, unreachable.
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409 NOT_READY (reason: no_ip_address): The server has no IP address yet, usually because it is still being set up. Retry oncevm.getlists an address inips.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/ping" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"latency": 12,
"status": "reachable"
}
Read your automatic server start/stop schedule
GET /v1/vms/{id}/power-schedule
Operation vm.power_schedule.get
read vm:read
Returns the server's automatic start and stop schedule, or schedule null when it has none, together with the next time each action will run. The start and stop times are local times in the schedule's own timezone; the next times are the same moments as UTC timestamps.
Path parameters
idinteger required Server id fromvm.list
Returns
scheduleobject or null required Null when the server has no schedule. Child fieldsenabledboolean required When false the schedule is kept but nothing runs.timezonestring required IANA time zone the start and stop times are in, e.g. Europe/London.daysarray of integers required Weekdays the schedule runs on: 0 is Sunday, 6 is Saturday.startstring or null required Local time the server is started, HH:MM (24-hour). Null when the schedule does not start it.stopstring or null required Local time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.updated_attimestamp required When the schedule was last saved.
nextobject required Child fieldsstart_attimestamp or null required The next scheduled start. Null when none falls in the next 8 days.stop_attimestamp or null required The next scheduled stop. Null when none falls in the next 8 days.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/power-schedule" \
-H "Authorization: Bearer $PB_API_KEY"
{
"schedule": {
"enabled": true,
"timezone": "Europe/London",
"days": [
1,
2,
3,
4,
5
],
"start": "08:00",
"stop": "19:00",
"updated_at": "2026-11-14T10:00:00.000Z"
},
"next": {
"start_at": "2026-11-16T08:00:00.000Z",
"stop_at": "2026-11-16T19:00:00.000Z"
}
}
Set when a server starts and stops automatically
PUT /v1/vms/{id}/power-schedule
Operation vm.power_schedule.set
safe vm:powerIdempotency-Key
Saves the schedule, replacing any earlier one. A schedule has one start time and one stop time (either may be null), used on every chosen weekday, in the IANA time zone you name; it does not run in UTC unless you set timezone to UTC. The server is acted on only at those times, so starting or stopping it yourself in between is left alone until the next scheduled time. A scheduled stop shuts the operating system down and powers the server off if it has not stopped after a few minutes, so everything it serves is down until the next start. A schedule can be saved for a suspended server but only runs while the server is active. Returns the saved schedule and the next run times.
Path parameters
idinteger required Server id fromvm.list
Body
enabledboolean requiredtimezonestring requireddaysarray of integers requiredstartstring or null requiredstopstring or null required
Returns
scheduleobject or null required Null when the server has no schedule. Child fieldsenabledboolean required When false the schedule is kept but nothing runs.timezonestring required IANA time zone the start and stop times are in, e.g. Europe/London.daysarray of integers required Weekdays the schedule runs on: 0 is Sunday, 6 is Saturday.startstring or null required Local time the server is started, HH:MM (24-hour). Null when the schedule does not start it.stopstring or null required Local time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.updated_attimestamp required When the schedule was last saved.
nextobject required Child fieldsstart_attimestamp or null required The next scheduled start. Null when none falls in the next 8 days.stop_attimestamp or null required The next scheduled stop. Null when none falls in the next 8 days.
Refusals specific to this operation
VALIDATION_FAILED400 The schedule is not acceptable: an unknown time zone, a time not written HH:MM, an enabled schedule with no day or with neither start nor stop, or start and stop less than 15 minutes apart.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.power_schedule.get, and send the change again with a new key only if it did not apply.
curl -X PUT "https://api.privatebyte.com/v1/vms/{id}/power-schedule" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"timezone": "Europe/London",
"days": [
1,
2,
3,
4,
5
],
"start": "08:00",
"stop": "19:00"
}'
{
"schedule": {
"enabled": true,
"timezone": "Europe/London",
"days": [
1,
2,
3,
4,
5
],
"start": "08:00",
"stop": "19:00",
"updated_at": "2026-11-14T10:00:00.000Z"
},
"next": {
"start_at": "2026-11-16T08:00:00.000Z",
"stop_at": "2026-11-16T19:00:00.000Z"
}
}
Remove your automatic server power schedule
DELETE /v1/vms/{id}/power-schedule
Operation vm.power_schedule.delete
destructive vm:powerIdempotency-Key
Removes the schedule, so the server is no longer started or stopped automatically. The server's current power state is not changed. It succeeds when there is no schedule to remove. Returns schedule null. Send the server id again as ?confirm=.
Path parameters
idinteger required Server id fromvm.list
Query parameters
confirminteger required Must equal the server id in the path ({id}).
Returns
scheduleobject or null required Null when the server has no schedule. Child fieldsenabledboolean required When false the schedule is kept but nothing runs.timezonestring required IANA time zone the start and stop times are in, e.g. Europe/London.daysarray of integers required Weekdays the schedule runs on: 0 is Sunday, 6 is Saturday.startstring or null required Local time the server is started, HH:MM (24-hour). Null when the schedule does not start it.stopstring or null required Local time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.updated_attimestamp required When the schedule was last saved.
nextobject required Child fieldsstart_attimestamp or null required The next scheduled start. Null when none falls in the next 8 days.stop_attimestamp or null required The next scheduled stop. Null when none falls in the next 8 days.
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id in the path.UPSTREAM_UNAVAILABLE502 The change was sent but could not be confirmed, so it may or may not have applied. The same Idempotency-Key keeps returning this answer. Read the current state withvm.power_schedule.get, and send the change again with a new key only if it did not apply.
curl -X DELETE "https://api.privatebyte.com/v1/vms/{id}/power-schedule?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"schedule": null,
"next": {
"start_at": null,
"stop_at": null
}
}
Reinstall the OS. Wipes the disk
POST /v1/vms/{id}/reinstall
Operation vm.reinstall
destructive vm:destroyIdempotency-Key
Erases the whole disk and installs a fresh operating system; everything on the server is lost and it is offline until the install finishes. os_image_id must come from vm.os_images.list for this server and confirm must equal the server id. The account owner is emailed. This call returns no password, and SSH keys added earlier are erased with the disk: once the install has finished, call vm.password_reset to get a login password and vm.ssh_keys.attach to put keys back. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows power_state installing while it runs and running afterwards. Take a backup or snapshot first if anything on the disk matters.
Path parameters
idinteger required Server id fromvm.list
Body
os_image_idinteger required An image id from GET /v1/vms/{id}/os-images for this serverconfirminteger required Must equal the server id in the path ({id}), as an integer
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the server id in the path (fieldis confirm). Nothing was changed.400400 VALIDATION_FAILED (reason: os_image_not_offered):os_image_idis not an image this server can be installed with. Nothing was changed. Readvm.os_images.listfor this server and use one of its ids.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/reinstall" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"os_image_id": 41,
"confirm": 4821
}'
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "reinstall",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Restart a server
POST /v1/vms/{id}/restart
Operation vm.restart
safe vm:powerIdempotency-Key
Restarts a server; it is unreachable for a short time while it reboots. Nothing on its disk is changed. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state.
Path parameters
idinteger required Server id fromvm.list
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/restart" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "restart",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
A server's snapshots
GET /v1/vms/{id}/snapshots
Operation vm.snapshots.list
read vm:read
Lists the snapshots of a server. A snapshot is a point-in-time copy of the disk kept beside the server, quicker to take and restore than a backup; up to 7 are kept per server. A snapshot can be restored or deleted once its status is available. Each id is what vm.snapshots.restore and vm.snapshots.delete take as {snapshot_id} and as confirm.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Child fieldsidinteger required Snapshot id. Use it as {snapshot_id} and asconfirmwhen restoring or deleting this snapshotnamestring requiredstatusstring requiredavailablewhen the snapshot is ready to restore or delete; any other value means it is still being processedsize_gbnumber required Size in GB; 0 when not known yetcreated_attimestamp or null required When the snapshot was taken, null when not recorded
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/snapshots" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 77,
"name": "before-upgrade",
"status": "available",
"size_gb": 12.4,
"created_at": "2026-11-14T09:30:00.000Z"
}
]
}
Take a snapshot (up to 7 kept)
POST /v1/vms/{id}/snapshots
Operation vm.snapshots.create
safe vm:writeIdempotency-Key
Takes a snapshot of the server's disk as it is now and answers 201 with the snapshot once it exists; there is nothing to poll, but wait for status available in vm.snapshots.list before restoring it. The server keeps running. The body is optional: name defaults to a name built from the current time. A server keeps at most 7 snapshots and takes one at a time.
Path parameters
idinteger required Server id fromvm.list
Body
namestring 1 to 40 characters: letters, numbers, spaces and. _: / @ ( ) + -. Defaults to a name built from the current UTC time
Returns
snapshotobject required Child fieldsidinteger required Snapshot id. Use it as {snapshot_id} and asconfirmwhen restoring or deleting this snapshotnamestring requiredstatusstring requiredavailablewhen the snapshot is ready to restore or delete; any other value means it is still being processedsize_gbnumber required Size in GB; 0 when not known yetcreated_attimestamp or null required When the snapshot was taken, null when not recorded
Refusals specific to this operation
VALIDATION_FAILED400nameis longer than 40 characters or uses a character other than letters, numbers, spaces and. _: / @ ( ) + -.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409 LIMIT_REACHED (reason: snapshot_limit): The server already has the most snapshots it can keep;details.limitis that number. Delete one withvm.snapshots.delete, then retry.409409 IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait untilvm.snapshots.listshows every snapshot asavailable, then retry.409409 IN_PROGRESS (reason: server_busy): The server is in the middle of another operation, or is neither running nor stopped. Wait for that to finish (vm.getpower_state), then retry.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.UPSTREAM_UNAVAILABLE502 The request may or may not have taken effect. Repeating it with the same Idempotency-Key returns this same answer; check the current state first, then send a new request with a new key if it is still needed.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/snapshots" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "before-upgrade"
}'
{
"snapshot": {
"id": 77,
"name": "before-upgrade",
"status": "available",
"size_gb": 12.4,
"created_at": "2026-11-14T09:30:00.000Z"
}
}
Delete a snapshot
DELETE /v1/vms/{id}/snapshots/{snapshot_id}
Operation vm.snapshots.delete
destructive vm:destroyIdempotency-Key
Deletes one snapshot for good; it cannot be recovered. The server's current disk is not touched. confirm is a query parameter and must equal the snapshot id in the path. The call waits until the snapshot is gone and then answers 200 with an operation object as a receipt, so there is nothing to poll. The account owner is emailed.
Path parameters
idinteger required Server id fromvm.listsnapshot_idinteger required Snapshot id from the snapshots list
Query parameters
confirminteger required Must equal the snapshot id in the path ({snapshot_id}).
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the snapshot id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.NOT_FOUND404 The snapshot is not one of this server's snapshots, or is already deleted.409409 IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait untilvm.snapshots.listshows every snapshot asavailable, then retry.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.UPSTREAM_UNAVAILABLE502 The deletion was sent but could not be confirmed in time. Readvm.snapshots.list: if the snapshot is gone it worked; if it is still there, retry with a new Idempotency-Key.
curl -X DELETE "https://api.privatebyte.com/v1/vms/{id}/snapshots/{snapshot_id}?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "snapshot_delete",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Restore a snapshot. Overwrites the disk
POST /v1/vms/{id}/snapshots/{snapshot_id}/restore
Operation vm.snapshots.restore
destructive vm:destroyIdempotency-Key
Rolls the server's disk back to a snapshot: everything written since the snapshot was taken is lost, and the server restarts. The snapshot must belong to this server and be available. confirm must equal the snapshot id in the path. The account owner is emailed. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state.
Path parameters
idinteger required Server id fromvm.listsnapshot_idinteger required Snapshot id from the snapshots list
Body
confirminteger required Must equal the snapshot id in the path ({snapshot_id}), as an integer
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the snapshot id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.NOT_FOUND404 The snapshot is not one of this server's snapshots. Nothing was changed. Readvm.snapshots.list.409409 IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait untilvm.snapshots.listshows every snapshot asavailable, then retry.409409 IN_PROGRESS (reason: server_busy): The server is in the middle of another operation, or is neither running nor stopped. Wait for that to finish (vm.getpower_state), then retry.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/snapshots/{snapshot_id}/restore" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 77
}'
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "snapshot_restore",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Add SSH keys from your library to a running server
POST /v1/vms/{id}/ssh-keys
Operation vm.ssh_keys.attach
destructive vm:destroyIdempotency-Key
Adds the chosen library keys to the administrator (root) account of the server, so whoever holds the matching private keys can log in over SSH. The server must be running and reachable at the address recorded for it; keys already on the server stay, and nothing is restarted. Windows servers do not take SSH keys. The account owner is told each time keys are added. confirm must equal the server id. Returns how many keys were added.
Path parameters
idinteger required Server id fromvm.list
Body
key_idsarray of strings required 1 to 10 key ids from your SSH key libraryconfirminteger required Must equal the server id in the URL
Returns
attachedinteger required How many keys were added to the server
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the server id as an integer (field: confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended, or the account is restricted from making changes.404404 NOT_FOUND (reason: ssh_key_not_found): One or more of the key ids are not in your library. Read the ids withssh_keys.list. Nothing was added.409409 RESOURCE_STATE_CONFLICT (reason: server_address_not_confirmed): The address recorded for the server could not be matched to the server itself, so no key was added. This needs support: open a ticket (tickets.create).UPSTREAM_UNAVAILABLE502 The keys could not be put on the server, or only some of them were. Check withvm.getthat the server is running, then send the request again with a new Idempotency-Key.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/ssh-keys" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"key_ids": [
"3f9a1c0b7d2e4a65"
],
"confirm": 4821
}'
{
"attached": 1
}
Power a server on
POST /v1/vms/{id}/start
Operation vm.start
safe vm:powerIdempotency-Key
Powers on a server that is switched off. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state. The response also carries green_credit: when the server had been switched off for a while, a credit for that time is added to your account balance by this call, and amount_minor, currency and off_seconds say how much and for how long; it is null when no credit applies.
Path parameters
idinteger required Server id fromvm.list
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
green_creditobject or null required A credit for time the server was switched off, already added to your account balance by this start. null when no credit applies Child fieldsamount_minorinteger required Credit added to your account balance, in minor units ofcurrencycurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.off_secondsinteger required How long the server was switched off, in seconds, for which this credit was given
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/start" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "start",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
},
"green_credit": {
"amount_minor": 42,
"currency": "USD",
"off_seconds": 93600
}
}
Power a server off
POST /v1/vms/{id}/stop
Operation vm.stop
safe vm:powerIdempotency-Key
Asks the operating system to shut down cleanly, then powers the server off. The server is offline until you start it again; nothing on its disk is changed. It answers 202 as soon as the work is accepted, not when it is done. To follow it, call vm.operations.get (GET /v1/vms/{id}/operations/{op_id}) with operation.id every 5 seconds and read operation.status: pending and running mean keep polling, succeeded and failed are final. If it is still pending after 5 minutes, stop polling and check the result directly: vm.get shows the live power_state. If the operating system ignores the request and the server is still running, use vm.force_stop.
Path parameters
idinteger required Server id fromvm.list
Returns
operationobject required Child fieldsidstring required Operation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hoursactionstring required What was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.status"pending" required Always pending here: the work has been accepted, not finishedvm_idinteger required Server id the operation runs oncreated_attimestamp required When the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/stop" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"operation": {
"id": "op_3f9a1c0b7d2e4f6a8b0c1d2e",
"action": "stop",
"status": "pending",
"vm_id": 4821,
"created_at": "2026-11-14T10:00:00.000Z"
}
}
List the recent background tasks of a server
GET /v1/vms/{id}/tasks
Operation vm.tasks.list
read vm:read
Returns up to 100 recent tasks that ran on the server, whoever started them: you through the API or the client area, a schedule, or our own systems. Use it to see what the server has been doing, or to find a task that is stuck and can be cancelled or one that failed and can be retried (cancelable, retryable). It is not the way to follow a 202 response: task ids are not linked to operation ids, so poll vm.operations.get for that.
Path parameters
idinteger required Server id fromvm.list
Returns
dataarray of objects required Child fieldsidstring required Task id. Use it as {task_ref} and asconfirmwhen cancelling or retrying this taskactionstring required Kind of work, as a short machine name such as vm-start or backup-createstatusstring required succeeded and failed are final; a cancelled task reports failed. One of pending, running, succeeded, failed.progressnumber required Percent complete, 0 to 100created_attimestamp or null required When the task was queued, null when not recordedupdated_attimestamp or null required When the task last changed, null when not recordedcancelableboolean required Whether POST …/cancel can stop this task nowretryableboolean required Whether POST …/retry may run this task again. Always false for work that erases or overwrites a disk
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/tasks" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": "task_0123456789abcdef0123456789abcdef",
"action": "vm-restart",
"status": "succeeded",
"progress": 100,
"created_at": "2026-11-14T10:00:00.000Z",
"updated_at": "2026-11-14T10:00:21.000Z",
"cancelable": false,
"retryable": true
}
]
}
Read one task belonging to your server
GET /v1/vms/{id}/tasks/{task_ref}
Operation vm.tasks.get
read vm:read
Returns one task from vm.tasks.list, re-read at the time of the call, with its status, progress and whether it can be cancelled or retried. Use it after vm.tasks.cancel or vm.tasks.retry to see the effect.
Path parameters
idinteger required Server id fromvm.listtask_refstring required Task id fromvm.tasks.list
Returns
idstring required Task id. Use it as {task_ref} and asconfirmwhen cancelling or retrying this taskactionstring required Kind of work, as a short machine name such as vm-start or backup-createstatusstring required succeeded and failed are final; a cancelled task reports failed. One of pending, running, succeeded, failed.progressnumber required Percent complete, 0 to 100created_attimestamp or null required When the task was queued, null when not recordedupdated_attimestamp or null required When the task last changed, null when not recordedcancelableboolean required Whether POST …/cancel can stop this task nowretryableboolean required Whether POST …/retry may run this task again. Always false for work that erases or overwrites a disk
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/tasks/{task_ref}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": "task_0123456789abcdef0123456789abcdef",
"action": "vm-restart",
"status": "succeeded",
"progress": 100,
"created_at": "2026-11-14T10:00:00.000Z",
"updated_at": "2026-11-14T10:00:21.000Z",
"cancelable": false,
"retryable": true
}
Cancel a running or queued task on a server
POST /v1/vms/{id}/tasks/{task_ref}/cancel
Operation vm.tasks.cancel
destructive vm:writeIdempotency-Key
Asks for a task to be stopped. Only a task whose cancelable is true can be cancelled, so read it first. What the task had already done is not undone: a cancelled restore or reinstall can leave the server unusable until it is run again. confirm must equal the task id in the path. The answer only says the request was passed on; read vm.tasks.get to see the task become failed.
Path parameters
idinteger required Server id fromvm.listtask_refstring required Task id fromvm.tasks.list
Body
confirmstring required Must equal the task id in the path ({task_ref})
Returns
acceptedtrue required The request was passed on; read the task again to see its new statustask_refstring required The task id that was acted on
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the task id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.UPSTREAM_UNAVAILABLE502 The cancel was not accepted, for example because the task had already finished. Read the task again before retrying.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/tasks/{task_ref}/cancel" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": "task_0123456789abcdef0123456789abcdef"
}'
{
"accepted": true,
"task_ref": "task_0123456789abcdef0123456789abcdef"
}
Run a failed task again
POST /v1/vms/{id}/tasks/{task_ref}/retry
Operation vm.tasks.retry
destructive vm:writevm:powerIdempotency-Key
Runs a task again. Only tasks whose retryable is true qualify: starting, stopping or restarting the server, taking a backup and taking a snapshot. Work that erases or overwrites a disk (reinstall, restore) is never retried from history; start it again with its own operation. Because a retry can change the power state, the key needs the power scope as well as the write scope. confirm must equal the task id in the path. Read vm.tasks.get afterwards to follow it.
Path parameters
idinteger required Server id fromvm.listtask_refstring required Task id fromvm.tasks.list
Body
confirmstring required Must equal the task id in the path ({task_ref})
Returns
acceptedtrue required The request was passed on; read the task again to see its new statustask_refstring required The task id that was acted on
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing, has the wrong type or does not equal the task id in the path (fieldis confirm). Nothing was changed.ACCOUNT_RESTRICTED403 The server is suspended (vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409 PRECONDITION (reason: retry_not_safe): This kind of task is never retried from history because it erases or overwrites data. Nothing was changed. Start the work again with its own operation, for examplevm.reinstallorvm.backups.restore.MAINTENANCE423 We are doing maintenance on this server. Nothing was changed. Retry later.
curl -X POST "https://api.privatebyte.com/v1/vms/{id}/tasks/{task_ref}/retry" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": "task_0123456789abcdef0123456789abcdef"
}'
{
"accepted": true,
"task_ref": "task_0123456789abcdef0123456789abcdef"
}
Read a server's current resource use
GET /v1/vms/{id}/usage
Operation vm.usage
read vm:read
Returns the latest readings for one server: CPU and memory in use, disk and network activity as rates in kilobytes per second, and uptime. These are single recent samples, not averages or totals. For how the figures changed over time use vm.metrics.history; for disk space and bandwidth totals use vm.get.
Path parameters
idinteger required Server id fromvm.list
Returns
cpu_usage_percentnumber required CPU in use, 0 to 100, averaged across the server's vCPUs. Latest sample.memory_used_mbnumber required Memory in use, in megabytes. Latest sample. It can read close to the total when real use cannot be measured: see memory_usage_percent.memory_total_mbnumber required Memory the server has, in megabytes.memory_usage_percentnumber or null required memory_used_mb as a share of memory_total_mb, 0 to 100, rounded. Null when the reading is not reliable.disk_read_kb_per_secnumber required Disk reads. A rate in kilobytes per second from the latest sample, not a running total.disk_write_kb_per_secnumber required Disk writes. A rate in kilobytes per second from the latest sample, not a running total.network_in_kb_per_secnumber required Traffic received. A rate in kilobytes per second from the latest sample, not a running total.network_out_kb_per_secnumber required Traffic sent. A rate in kilobytes per second from the latest sample, not a running total.uptime_secondsnumber Seconds since the server last booted. 0 when not known.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/vms/{id}/usage" \
-H "Authorization: Bearer $PB_API_KEY"
{
"cpu_usage_percent": 12,
"memory_used_mb": 1536,
"memory_total_mb": 4096,
"memory_usage_percent": 38,
"disk_read_kb_per_sec": 4.5,
"disk_write_kb_per_sec": 120.25,
"network_in_kb_per_sec": 86,
"network_out_kb_per_sec": 310.5,
"uptime_seconds": 345600
}
SSH keys
Public keys stored on your account, ready to attach to a server.
3 operations
Endpoints
List the SSH public keys in your library
GET /v1/ssh-keys
Operation ssh_keys.list
read vm:read
Returns the public keys saved on your account, each with its id, label, algorithm and fingerprint. The library only stores keys: use vm.ssh_keys.attach to put one on a server. Private keys are never held here.
Returns
dataarray of objects required Child fieldsidstring required Key id, used to attach or delete the keynamestring required Your label for the keytypestring required Key algorithm, e.g. ssh-ed25519fingerprintstring required SHA-256 of the public key, as 64 hex characterscreated_attimestamp required When the key was added to the library
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/ssh-keys" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": "3f9a1c0b7d2e4a65",
"name": "deploy laptop",
"type": "ssh-ed25519",
"fingerprint": "98aa94fb42bc3a12a603c6c1422f51cf443997bfe0d7ad2120ffab258493363e",
"created_at": "2026-11-14T10:00:00.000Z"
}
]
}
Save an SSH public key in your library
POST /v1/ssh-keys
Operation ssh_keys.add
safe vm:writeIdempotency-Key
Stores one public key on your account so it can be attached to servers later with vm.ssh_keys.attach; saving it does not put it on any server. Send the public key line only, never a private key. Accepted types are ssh-ed25519, ssh-rsa of at least 2048 bits, and ecdsa-sha2-nistp256, nistp384 and nistp521. A library holds up to 25 keys and the same key cannot be saved twice. Returns the saved key with its id.
Body
namestring Your label for the key, up to 64 characters. Defaults to "SSH key"public_keystring required One OpenSSH public key line: "<type> <base64> [comment]". Accepted types: ssh-ed25519, ssh-rsa of at least 2048 bits, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521. Never send a private key
Returns
ssh_keyobject required Child fieldsidstring required Key id, used to attach or delete the keynamestring required Your label for the keytypestring required Key algorithm, e.g. ssh-ed25519fingerprintstring required SHA-256 of the public key, as 64 hex characterscreated_attimestamp required When the key was added to the library
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: invalid_public_key): The text is not one well-formed public key of an accepted type, or it is an RSA key shorter than 2048 bits.ACCOUNT_RESTRICTED403 The account is restricted from making changes.409409 ALREADY_EXISTS (reason: ssh_key_already_in_library): This key is already in your library. Find its id withssh_keys.list.409409 LIMIT_REACHED (reason: ssh_key_limit): The library is full. Remove a key withssh_keys.deletefirst.
curl -X POST "https://api.privatebyte.com/v1/ssh-keys" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "deploy laptop",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8g [email protected]"
}'
{
"ssh_key": {
"id": "3f9a1c0b7d2e4a65",
"name": "deploy laptop",
"type": "ssh-ed25519",
"fingerprint": "98aa94fb42bc3a12a603c6c1422f51cf443997bfe0d7ad2120ffab258493363e",
"created_at": "2026-11-14T10:00:00.000Z"
}
}
Remove an SSH public key from your library
DELETE /v1/ssh-keys/{key_id}
Operation ssh_keys.delete
destructive vm:writeIdempotency-Key
Deletes the key from your library so it can no longer be attached. Servers that already have the key keep it and it still grants login there: remove it on each server yourself. The key can be saved again later with ssh_keys.add. Send the key id again as ?confirm=.
Path parameters
key_idstring required SSH key id from the library
Query parameters
confirmstring required Must equal the key id in the path ({key_id}).
Returns
oktrue required
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the key id in the path.ACCOUNT_RESTRICTED403 The account is restricted from making changes.
curl -X DELETE "https://api.privatebyte.com/v1/ssh-keys/{key_id}?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"ok": true
}
List your orders, newest first
GET /v1/orders
Operation orders.list
read billing:read
Returns your orders with their stock reservation and the billing status of each service. Filter by currency and page with cursor (descending order ids). It gives no totals: read the invoice for amounts, and orders.get for one order.
Query parameters
limitinteger 1–100 orders, default 20cursorstring next_cursor from the previous page; descending order IDscurrencystring Exact order currency
Returns
dataarray of objects required Child fieldsidinteger requiredcurrencystring required Currency of every amount in this order. One of USD, EUR, GBP.created_attimestamp or null required When the order was placed, ISO 8601 UTC. Null when not recordedreservationobject or null required Null when the order has no stock reservation, for example an order placed outside the API. Child fieldscreated_attimestamp required When the stock was reserved, ISO 8601 UTCexpires_attimestamp required When the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returnedstatestring required held: stock is reserved and the order is unpaid. funded: the order was paid in time. released: the order was cancelled or ran out of time and its stock was returned. One of held, funded, released.
servicesarray of objects required Child fieldsidinteger required Service id. Read it with the services operations; it is also the server id once the server existsproduct_idinteger or null requiredstatusstring required Billing status of the service: pending (order not yet paid), active, suspended or cancelledquantityinteger requiredrecurring_amount_minorinteger required Recurring price per unit and billing cycle, in whole minor units of the order currency
next_cursorstring or null required Pass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/orders" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 5012,
"currency": "USD",
"created_at": "2026-11-14T10:00:00.000Z",
"reservation": {
"created_at": "2026-11-14T10:00:00.000Z",
"expires_at": "2026-11-14T10:15:00.000Z",
"state": "held"
},
"services": [
{
"id": 7044,
"product_id": 1201,
"status": "pending",
"quantity": 1,
"recurring_amount_minor": 599
}
]
}
],
"next_cursor": null
}
Create an order from a previewed price
POST /v1/orders
Operation orders.create
money orders:createbilling:readIdempotency-Key
Creates the order, one service per unit and one unpaid invoice, and holds the stock until reservation.expires_at (15 minutes). It takes no payment itself: max_invoice_minor is the spending ceiling, the most the first invoice may come to, and the order is refused if a price has changed since orders.preview. Next, pay invoice_id before the reservation ends (invoices.credit.create pays it from wallet credit); the server is then built automatically, and each id in service_ids is the service (services.get) and the server (vm.get). An order left unpaid is released, its stock returned, and a later payment becomes wallet credit. If you do not get a reply, call orders.recover with the same Idempotency-Key value instead of ordering again.
Body
currencystring required Currency of every amount in this request. Must be your account currency, as returned by the order preview. One of USD, EUR, GBP.max_invoice_minorinteger required Spending ceiling: the most the first invoice of this order may come to, in whole minor units of currency. The request is refused when the items add up to morecoupon_codestring coupon_code from the order preview, unchangedreservation_termsobject reservation_terms from the order preview, unchanged. Required for a new order Child fieldsduration_seconds900 required How long stock is held for an unpaid order, in secondscredit_partial_payments_to_wallettrue required If the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currencycredit_late_payments_to_wallettrue required A payment that arrives after the order was released becomes wallet credit; it does not revive the order
itemsarray of objects required Child fieldsproduct_idinteger required Product id from the cataloguebilling_cyclestring required One of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.quantityinteger How many identical units. Each unit becomes its own serviceconfigurationarray of objects One entry per option chosen. An operating_system option must be chosen where the product has one; other options are optional Child fieldsoption_idinteger required Option id from the productvalue_idinteger required Id of the chosen value of that option
hostnamestring Hostname for the server, lower case, for example web1.example.comunit_price_minorinteger required unit_price_minor of this item from the order preview, unchangedunit_setup_fee_minorinteger required unit_setup_fee_minor of this item from the order preview, unchangedunit_invoice_price_minorinteger unit_invoice_price_minor of this item from the order preview, unchanged. Required when coupon_code is sent
Returns
kind"order_acceptance" requiredcoupon_codestring The coupon applied, when one was requestedorder_idinteger requiredinvoice_idinteger or null required The unpaid invoice to pay for this order. Null only when nothing is dueservice_idsarray of integers required One service per unit ordered. A service id is also the server id once the server existscurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.amount_minorinteger required Total of the first invoice, in whole minor units of currencyreservationobject required The window in which stock is held for the unpaid order. Passing expires_at does not by itself mean the order was released: read the order to see its current state. It is separate from the invoice due date. Child fieldscreated_attimestamp required When the stock was reserved, ISO 8601 UTCexpires_attimestamp required When the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returned
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: price_changed): A unit amount in the request no longer matches the current price. Nothing was created. Callorders.previewagain and send the new amounts.400400 VALIDATION_FAILED (reason: reservation_terms_required): reservation_terms is missing. Copy it fromorders.preview.400400 VALIDATION_FAILED (reason: billing_cycle_not_offered): The item at details.item_index asks for a billing cycle the product has no price for. Use a cycle from the product prices.400400 VALIDATION_FAILED (reason: option_not_offered): The item at details.item_index names an option or value the product does not have, or one with no price on that billing cycle. Readcatalog.products.getagain.400400 VALIDATION_FAILED (reason: operating_system_required): The item at details.item_index has no choice for an operating_system option. Add one to its configuration.400400 VALIDATION_FAILED (reason: country_required): The item at details.item_index is a static proxy address and has no choice for its country option. Add one to its configuration;catalog.products.getlists the countries in stock.400400 VALIDATION_FAILED (reason: coupon_invalid): coupon_code cannot be used by this account. Remove it, or check it withcatalog.coupons.preview.403403 ACCOUNT_RESTRICTED (reason: email_not_verified): The account email address is not verified. The customer must verify it in the client area before ordering.NOT_FOUND404 A product_id in the request is not on sale. Readcatalog.products.listfor the products you can order.409409 LIMIT_REACHED (reason: open_order_limit): The account already has the most unpaid orders it may hold at once. Pay or cancel one (orders.cancel), or wait for it to run out.UPSTREAM_UNAVAILABLE502 The order may or may not have been created. Do not order again with a new key: retry with the same Idempotency-Key, or callorders.recover.503503 UNAVAILABLE (reason: out_of_stock): An item is sold out in the quantity asked. Nothing was created. Order fewer units, another product, or try later.503503 UNAVAILABLE (reason: product_not_orderable): The product (details.product_id) cannot be ordered through the API right now: its configuration_status is unavailable. Try later or choose another product.
curl -X POST "https://api.privatebyte.com/v1/orders" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"max_invoice_minor": 599,
"reservation_terms": {
"duration_seconds": 900,
"credit_partial_payments_to_wallet": true,
"credit_late_payments_to_wallet": true
},
"items": [
{
"product_id": 1201,
"billing_cycle": "monthly",
"quantity": 1,
"configuration": [
{
"option_id": 71,
"value_id": 801
}
],
"hostname": "web1.example.com",
"unit_price_minor": 599,
"unit_setup_fee_minor": 0
}
]
}'
{
"kind": "order_acceptance",
"order_id": 5012,
"invoice_id": 9031,
"service_ids": [
7044
],
"currency": "USD",
"amount_minor": 599,
"reservation": {
"created_at": "2026-11-14T10:00:00.000Z",
"expires_at": "2026-11-14T10:15:00.000Z"
}
}
Read one order and the status of its services
GET /v1/orders/{order_id}
Operation orders.get
read billing:read
Returns when the order was placed, its stock reservation (held while unpaid, funded once paid, released when cancelled or out of time) and the billing status of each service. Use it after orders.create to see whether the order was paid or released. A billing status of active does not by itself mean the server is built: read the server with vm.get using the service id.
Path parameters
order_idinteger required Your order id, fromorders.listororders.create
Returns
idinteger requiredcurrencystring required Currency of every amount in this order. One of USD, EUR, GBP.created_attimestamp or null required When the order was placed, ISO 8601 UTC. Null when not recordedreservationobject or null required Null when the order has no stock reservation, for example an order placed outside the API. Child fieldscreated_attimestamp required When the stock was reserved, ISO 8601 UTCexpires_attimestamp required When the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returnedstatestring required held: stock is reserved and the order is unpaid. funded: the order was paid in time. released: the order was cancelled or ran out of time and its stock was returned. One of held, funded, released.
servicesarray of objects required Child fieldsidinteger required Service id. Read it with the services operations; it is also the server id once the server existsproduct_idinteger or null requiredstatusstring required Billing status of the service: pending (order not yet paid), active, suspended or cancelledquantityinteger requiredrecurring_amount_minorinteger required Recurring price per unit and billing cycle, in whole minor units of the order currency
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/orders/{order_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 5012,
"currency": "USD",
"created_at": "2026-11-14T10:00:00.000Z",
"reservation": {
"created_at": "2026-11-14T10:00:00.000Z",
"expires_at": "2026-11-14T10:15:00.000Z",
"state": "held"
},
"services": [
{
"id": 7044,
"product_id": 1201,
"status": "pending",
"quantity": 1,
"recurring_amount_minor": 599
}
]
}
Read how an order was cancelled or ran out of time
GET /v1/orders/{order_id}/cancellation
Operation orders.cancellation.get
read billing:read
Returns the release record of an order: why it was released (you cancelled it, or it ran out of time unpaid), when, and how much part payment was credited to your wallet. It changes nothing. release is null when the order has not been released.
Path parameters
order_idinteger required Your order id, fromorders.listororders.create
Returns
releaseobject or null required The record of an order being released. It is fixed at release time: it is not your current wallet balance. Child fieldskind"order_release" requiredorder_idinteger requiredinvoice_idinteger or null requiredservice_idsarray of integers requiredcurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.state"released" requiredreasonstring required customer_cancelled: you cancelled it. expired: the reservation ran out unpaid first. One of customer_cancelled, expired.released_attimestamp required When the order was released, ISO 8601 UTCwallet_credit_minorinteger required Part payment returned to your wallet when the order was released, in whole minor units of currency. Zero when nothing had been paid
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/orders/{order_id}/cancellation" \
-H "Authorization: Bearer $PB_API_KEY"
{
"release": {
"kind": "order_release",
"order_id": 5012,
"invoice_id": 9031,
"service_ids": [
7044
],
"currency": "USD",
"state": "released",
"reason": "customer_cancelled",
"released_at": "2026-11-14T10:06:30.000Z",
"wallet_credit_minor": 0
}
}
Cancel an unpaid order and return its reserved stock
POST /v1/orders/{order_id}/cancellation
Operation orders.cancel
destructive orders:cancelbilling:readIdempotency-Key
Cancels an order that was created through this API and has not been paid. Its reserved stock is returned, its invoice and its pending services are cancelled, and anything already part-paid towards it is credited to your wallet in the same currency (wallet_credit_minor). A paid order is refused: this never stops or deletes a server; use services.cancel for a running service. confirm must equal the order id. Calling it again returns the same release record.
Path parameters
order_idinteger required Your order id, fromorders.listororders.create
Body
confirminteger required Must equal the order id in the URLcredit_partial_payments_to_wallettrue required Must be true: you agree that anything already paid towards the order invoice is returned as wallet credit in the same currency, not to the original payment method
Returns
kind"order_release" requiredorder_idinteger requiredinvoice_idinteger or null requiredservice_idsarray of integers requiredcurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.state"released" requiredreasonstring required customer_cancelled: you cancelled it. expired: the reservation ran out unpaid first. One of customer_cancelled, expired.released_attimestamp required When the order was released, ISO 8601 UTCwallet_credit_minorinteger required Part payment returned to your wallet when the order was released, in whole minor units of currency. Zero when nothing had been paid
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the order id in the URL (the refusal carries field: confirm), or credit_partial_payments_to_wallet is not true. Nothing is changed.409409 RESOURCE_STATE_CONFLICT (reason: order_not_cancellable): The order is paid, has a payment in progress, has a server, or was not created through this API. Nothing was changed.UPSTREAM_UNAVAILABLE502 The cancellation may or may not have happened. Readorders.cancellation.getbefore trying again.
curl -X POST "https://api.privatebyte.com/v1/orders/{order_id}/cancellation" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 5012,
"credit_partial_payments_to_wallet": true
}'
{
"kind": "order_release",
"order_id": 5012,
"invoice_id": 9031,
"service_ids": [
7044
],
"currency": "USD",
"state": "released",
"reason": "customer_cancelled",
"released_at": "2026-11-14T10:06:30.000Z",
"wallet_credit_minor": 0
}
Price an order exactly, without creating it
POST /v1/orders/preview
Operation orders.preview
read billing:read
Returns the exact price of an order: per-unit recurring price and setup fee with the chosen options, volume and coupon discounts, the first-invoice total (subtotal_minor) and whether every item is in stock. Nothing is reserved, created or charged, and the prices are not held. Take product_id, billing_cycle and the option ids from catalog.products.get; a server needs an operating system choice. To buy, copy currency, coupon_code, reservation_terms and each item with its unit amounts into orders.create.
Body
itemsarray of objects required Child fieldsproduct_idinteger required Product id from the cataloguebilling_cyclestring required One of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.quantityinteger How many identical units. Each unit becomes its own serviceconfigurationarray of objects One entry per option chosen. An operating_system option must be chosen where the product has one; other options are optional Child fieldsoption_idinteger required Option id from the productvalue_idinteger required Id of the chosen value of that option
coupon_codestring
Returns
reservation_termsobject required Copy unchanged into the order. By sending it back you accept these terms Child fieldsduration_seconds900 required How long stock is held for an unpaid order, in secondscredit_partial_payments_to_wallettrue required If the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currencycredit_late_payments_to_wallettrue required A payment that arrives after the order was released becomes wallet credit; it does not revive the order
kind"estimate" requiredcoupon_codestring The coupon as stored. Copy it unchanged into the ordercurrencystring required Your account currency. Every amount in this response is in it. One of USD, EUR, GBP.subtotal_minorinteger required Total of the first invoice for all items, in whole minor units of currency: recurring price plus setup fees, less discountstax_includedfalse required Always false: no tax is addeddiscounts_includedboolean required True when a volume discount or the requested coupon lowered any pricequantityinteger required Total units across all itemsavailabilitystring required available: every item is in stock in the quantity asked. unavailable: at least one item is not; the order would be refused. unknown: stock could not be read just now; the order would be refused, try again shortly. One of available, unavailable, unknown.itemsarray of objects required Child fieldsitem_indexinteger required Position of this item in the request, from 0product_idinteger requirednamestring requiredcategorystring required One of vps, hosting, dedicated, proxies, gateway.billing_cyclestring required One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.quantityinteger requiredunit_price_minorinteger required Recurring price per unit and billing cycle, with the chosen options, after any volume discount and recurring couponunit_setup_fee_minorinteger required One-off fee per unit on the first invoiceunit_invoice_price_minorinteger First-invoice amount per unit, including setup and coupon. Present only when a coupon was requested; copy it into the ordersubtotal_minorinteger required First-invoice amount for this item: per-unit amount times quantityavailabilitystring required One of available, unavailable, unknown.configurationarray of objects required Child fieldsoption_idinteger requiredvalue_idinteger requirednamestring required Name of the chosen value
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: billing_cycle_not_offered): The item at details.item_index asks for a billing cycle the product has no price for. Use a cycle from the product prices.400400 VALIDATION_FAILED (reason: option_not_offered): The item at details.item_index names an option or value the product does not have, or one with no price on that billing cycle. Readcatalog.products.getagain.400400 VALIDATION_FAILED (reason: operating_system_required): The item at details.item_index has no choice for an operating_system option. Add one to its configuration.400400 VALIDATION_FAILED (reason: country_required): The item at details.item_index is a static proxy address and has no choice for its country option. Add one to its configuration;catalog.products.getlists the countries in stock.400400 VALIDATION_FAILED (reason: coupon_invalid): coupon_code cannot be used by this account. Remove it, or check it withcatalog.coupons.preview.NOT_FOUND404 A product_id in the request is not on sale. Readcatalog.products.listfor the products you can order.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.503503 UNAVAILABLE (reason: product_not_orderable): The product (details.product_id) cannot be ordered through the API right now: its configuration_status is unavailable. Try later or choose another product.
curl -X POST "https://api.privatebyte.com/v1/orders/preview" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"product_id": 1201,
"billing_cycle": "monthly",
"quantity": 1,
"configuration": [
{
"option_id": 71,
"value_id": 801
}
]
}
]
}'
{
"reservation_terms": {
"duration_seconds": 900,
"credit_partial_payments_to_wallet": true,
"credit_late_payments_to_wallet": true
},
"kind": "estimate",
"currency": "USD",
"subtotal_minor": 599,
"tax_included": false,
"discounts_included": false,
"quantity": 1,
"availability": "available",
"items": [
{
"item_index": 0,
"product_id": 1201,
"name": "Example VPS 2 GB",
"category": "vps",
"billing_cycle": "monthly",
"quantity": 1,
"unit_price_minor": 599,
"unit_setup_fee_minor": 0,
"subtotal_minor": 599,
"availability": "available",
"configuration": [
{
"option_id": 71,
"value_id": 801,
"name": "Ubuntu 24.04"
}
]
}
]
}
Find the order made by a request whose reply was lost
POST /v1/orders/recover
Operation orders.recover
read billing:read
Looks up the order that an earlier orders.create request made, without creating or charging anything. Send that request's Idempotency-Key value as request_key together with the same order body. observation accepted returns the order exactly as orders.create would have; not_observed means no order exists for that key, so it is safe to call orders.create again.
Body
request_keystring required The Idempotency-Key header value you sent with the original order requestorderobject required The original order request body, unchanged Child fieldscurrencystring required Currency of every amount in this request. Must be your account currency, as returned by the order preview. One of USD, EUR, GBP.max_invoice_minorinteger required Spending ceiling: the most the first invoice of this order may come to, in whole minor units of currency. The request is refused when the items add up to morecoupon_codestring coupon_code from the order preview, unchangedreservation_termsobject reservation_terms from the order preview, unchanged. Required for a new order Child fieldsduration_seconds900 required How long stock is held for an unpaid order, in secondscredit_partial_payments_to_wallettrue required If the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currencycredit_late_payments_to_wallettrue required A payment that arrives after the order was released becomes wallet credit; it does not revive the order
itemsarray of objects required Child fieldsproduct_idinteger required Product id from the cataloguebilling_cyclestring required One of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.quantityinteger How many identical units. Each unit becomes its own serviceconfigurationarray of objects One entry per option chosen. An operating_system option must be chosen where the product has one; other options are optionalhostnamestring Hostname for the server, lower case, for example web1.example.comunit_price_minorinteger required unit_price_minor of this item from the order preview, unchangedunit_setup_fee_minorinteger required unit_setup_fee_minor of this item from the order preview, unchangedunit_invoice_price_minorinteger unit_invoice_price_minor of this item from the order preview, unchanged. Required when coupon_code is sent
Returns
orderobject or null required The accepted order, or null when none was found for this request key Child fieldskind"order_acceptance" requiredcoupon_codestring The coupon applied, when one was requestedorder_idinteger requiredinvoice_idinteger or null required The unpaid invoice to pay for this order. Null only when nothing is dueservice_idsarray of integers required One service per unit ordered. A service id is also the server id once the server existscurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.amount_minorinteger required Total of the first invoice, in whole minor units of currencyreservationobject required The window in which stock is held for the unpaid order. Passing expires_at does not by itself mean the order was released: read the order to see its current state. It is separate from the invoice due date. Child fieldscreated_attimestamp required When the stock was reserved, ISO 8601 UTCexpires_attimestamp required When the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returned
observationstring required accepted: the original request created the order returned here. not_observed: no order exists for this request key, so it is safe to send the order again. One of accepted, not_observed.
Refusals specific to this operation
IDEMPOTENCY_CONFLICT409 The request key belongs to an order with a different body. Send the original body unchanged.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl -X POST "https://api.privatebyte.com/v1/orders/recover" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_key": "order-web1-2026-11-14",
"order": {
"currency": "USD",
"max_invoice_minor": 599,
"reservation_terms": {
"duration_seconds": 900,
"credit_partial_payments_to_wallet": true,
"credit_late_payments_to_wallet": true
},
"items": [
{
"product_id": 1201,
"billing_cycle": "monthly",
"quantity": 1,
"configuration": [
{
"option_id": 71,
"value_id": 801
}
],
"hostname": "web1.example.com",
"unit_price_minor": 599,
"unit_setup_fee_minor": 0
}
]
}
}'
{
"order": {
"kind": "order_acceptance",
"order_id": 5012,
"invoice_id": 9031,
"service_ids": [
7044
],
"currency": "USD",
"amount_minor": 599,
"reservation": {
"created_at": "2026-11-14T10:00:00.000Z",
"expires_at": "2026-11-14T10:15:00.000Z"
}
},
"observation": "accepted"
}
Catalog
The products you can order, with their prices, options and stock. Check a coupon here before you use it on an order.
3 operations
Endpoints
Check a coupon code and what it takes off
POST /v1/catalog/coupons/preview
Operation catalog.coupons.preview
read billing:read
Checks a coupon without creating or reserving anything. Send product_id to learn whether the coupon applies to that product, and amount_minor as well to get the exact discount on that amount. A code that cannot be used answers 200 with valid false; the reason is not given. To see a coupon applied to a whole order, send it as coupon_code to orders.preview.
Body
codestring required The coupon code as the customer typed itproduct_idinteger Product id from the catalogue. Send it to learn whether the coupon applies to that productamount_minorinteger Per-unit first-invoice amount in your account currency, in whole minor units, after volume pricing and including setup; requires product_id. Send it to learn the exact discount
Returns
validfalse The code does not exist, is not active, has run out, or you have already used itcodestring The code exactly as stored. Copy this form into coupon_code when orderingtypestring percentage: percent_off is set. fixed: amount_off_minor is set. One of percentage, fixed.percent_offnumber Percent taken off. Present only when type is percentageamount_off_minorinteger Amount taken off, in whole minor units of currency. Present only when type is fixedcurrencystring Your account currency. Every amount in this response is in it. One of USD, EUR, GBP.recurringboolean True when the discount also applies to renewals; false when it applies to the first invoice onlyapplies_to_all_productsbooleanproduct_idsarray of integers Products the coupon is limited to. Empty when applies_to_all_products is trueapplies_to_productboolean Whether the coupon applies to the product_id you sent. Present only when you sent onediscount_minorinteger What the coupon takes off the amount_minor you sent. Present only when you sent an amount and the coupon appliesamount_after_discount_minorinteger amount_minor less discount_minor, never below zeroexpires_attimestamp or null When the coupon stops working, ISO 8601 UTC. Null when it has no end dateper_user_checkedtrue Always true: your own past use of the code was checked
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl -X POST "https://api.privatebyte.com/v1/catalog/coupons/preview" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "WELCOME10",
"product_id": 1201,
"amount_minor": 599
}'
{
"valid": true,
"code": "WELCOME10",
"type": "percentage",
"percent_off": 10,
"currency": "USD",
"recurring": false,
"applies_to_all_products": true,
"product_ids": [],
"applies_to_product": true,
"discount_minor": 60,
"amount_after_discount_minor": 539,
"expires_at": "2026-12-31T23:59:59.000Z",
"per_user_checked": true
}
List the products you can order
GET /v1/catalog/products
Operation catalog.products.list
read account:read
Returns the products on sale with their billing cycles, prices and whether each is in stock. This is the first step of buying a server: pick a product id here (category vps for servers), then call catalog.products.get for its operating systems and options. Prices are list prices before any discount and without tax; orders.preview gives the exact total. Page with cursor, ascending by product id.
Query parameters
limitinteger 1–100, default 20cursorstring next_cursor from the previous page; ascending product idscategorystring Store category
Returns
dataarray of objects required Child fieldsidinteger required Product id. Use it as product_id when previewing and creating an ordernamestring requiredcategorystring required One of vps, hosting, dedicated, proxies, gateway.regionstring or null required Country code of the region the product is hosted in (for example us, nl, uk). Null when the product is not tied to one regioncurrencystring required Your account currency. Every amount in this product, its prices and its options is in this currency. One of USD, EUR, GBP.pricesarray of objects required One entry per billing cycle the product is sold on Child fieldscyclestring required Billing cycle this price is for. Use it as billing_cycle when ordering. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.amount_minorinteger required Recurring price per cycle, in whole minor units (cents) of the product currency. Tax is not includedsetup_fee_minorinteger required One-off fee added to the first invoice, in whole minor units of the product currency
stock_statusstring required available: can be ordered. sold_out: cannot be ordered now. unknown: stock could not be read just now, so an order may be refused; try again shortly. One of available, sold_out, unknown.
next_cursorstring or null required Pass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/catalog/products" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 1201,
"name": "Example VPS 2 GB",
"category": "vps",
"region": "uk",
"currency": "USD",
"prices": [
{
"cycle": "monthly",
"amount_minor": 599,
"setup_fee_minor": 0
},
{
"cycle": "annually",
"amount_minor": 5750,
"setup_fee_minor": 0
}
],
"stock_status": "available"
}
],
"next_cursor": null
}
Read one product with its prices and options
GET /v1/catalog/products/{id}
Operation catalog.products.get
read account:read
Returns everything needed to order a product: its billing cycles and prices, region, stock status and its options (operating system, extra IPv4 address, extra disk) with the id of every choice. An order item names its choices as option_id and value_id pairs taken from here. Order only when configuration_status is ready and stock_status is available; then call orders.preview for the exact total.
Path parameters
idinteger required Product id fromcatalog.products.list
Returns
idinteger required Product id. Use it as product_id when previewing and creating an ordernamestring requiredcategorystring required One of vps, hosting, dedicated, proxies, gateway.regionstring or null required Country code of the region the product is hosted in (for example us, nl, uk). Null when the product is not tied to one regioncurrencystring required Your account currency. Every amount in this product, its prices and its options is in this currency. One of USD, EUR, GBP.pricesarray of objects required One entry per billing cycle the product is sold on Child fieldscyclestring required Billing cycle this price is for. Use it as billing_cycle when ordering. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.amount_minorinteger required Recurring price per cycle, in whole minor units (cents) of the product currency. Tax is not includedsetup_fee_minorinteger required One-off fee added to the first invoice, in whole minor units of the product currency
stock_statusstring required available: can be ordered. sold_out: cannot be ordered now. unknown: stock could not be read just now, so an order may be refused; try again shortly. One of available, sold_out, unknown.configuration_statusstring required ready: the options below are complete and the product can be ordered through the API. unavailable: it cannot be ordered through the API right now and options may be empty. One of ready, unavailable.optionsarray of objects required Child fieldsidinteger required Option id. Use it as option_id in an order item configurationnamestring requiredkindstring required operating_system: what the server is installed with; an order must choose one. additional_ipv4 and additional_disk: optional paid extras. country: where a static proxy address is located; an order must choose one, and only countries in stock are listed. other: an option the API cannot order yet. One of operating_system, additional_ipv4, additional_disk, country, other.valuesarray of objects required Child fieldsidinteger required Choice id. Use it as value_id in an order item configurationnamestring requiredincludedboolean required True when the choice is free of charge; prices is then emptypricesarray of objects required Extra price of this choice per billing cycle, added to the product price
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/catalog/products/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 1201,
"name": "Example VPS 2 GB",
"category": "vps",
"region": "uk",
"currency": "USD",
"prices": [
{
"cycle": "monthly",
"amount_minor": 599,
"setup_fee_minor": 0
},
{
"cycle": "annually",
"amount_minor": 5750,
"setup_fee_minor": 0
}
],
"stock_status": "available",
"configuration_status": "ready",
"options": [
{
"id": 71,
"name": "Operating System",
"kind": "operating_system",
"values": [
{
"id": 801,
"name": "Ubuntu 24.04",
"included": true,
"prices": []
},
{
"id": 803,
"name": "Debian 12",
"included": true,
"prices": []
}
]
},
{
"id": 72,
"name": "Additional IPv4",
"kind": "additional_ipv4",
"values": [
{
"id": 811,
"name": "1 extra address",
"included": false,
"prices": [
{
"cycle": "monthly",
"amount_minor": 300,
"setup_fee_minor": 0
}
]
}
]
}
]
}
List your services
GET /v1/services
Operation services.list
read billing:read
Returns every service on the account, including pending and cancelled ones, with its product, price per cycle and renewal date. Filter with status (pending, active, suspended, cancelled) and page with cursor, ascending by service id. For a server product the service id is also the server id used by the vm operations.
Query parameters
limitinteger 1–100, default 20cursorstring next_cursor from the previous page; ascending service idsstatusstring Billing status to filter by: pending, active, suspended or cancelled
Returns
dataarray of objects required Child fieldsidinteger required Service id. For a server product it is also the server id used by the server operationsproduct_idinteger requiredproduct_namestring or null required Name of the product. Null when it could not be readlabelstring or null required The name you gave the service, usually the server hostname. Null when none was setstatusstring required Billing status in lower case: pending (its order is not yet paid), active, suspended or cancelledrecurring_amount_minorinteger required Price charged each billing cycle, in whole minor units of currencycurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.renewal_datestring or null required Day the paid period ends and the next renewal is due, YYYY-MM-DD (UTC). Null when the service has no renewal date, for example before its first payment
next_cursorstring or null required Pass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/services" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 7044,
"product_id": 1201,
"product_name": "Example VPS 2 GB",
"label": "web1.example.com",
"status": "active",
"recurring_amount_minor": 599,
"currency": "USD",
"renewal_date": "2026-12-14"
}
],
"next_cursor": null
}
Read one service
GET /v1/services/{id}
Operation services.get
read billing:read
Returns one service, whatever its status. It describes billing only: for the state of the server itself call vm.get with the same id. renewal_date is the day the paid period ends.
Path parameters
idinteger required Your service id, fromservices.list
Returns
idinteger required Service id. For a server product it is also the server id used by the server operationsproduct_idinteger requiredproduct_namestring or null required Name of the product. Null when it could not be readlabelstring or null required The name you gave the service, usually the server hostname. Null when none was setstatusstring required Billing status in lower case: pending (its order is not yet paid), active, suspended or cancelledrecurring_amount_minorinteger required Price charged each billing cycle, in whole minor units of currencycurrencystring required ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.renewal_datestring or null required Day the paid period ends and the next renewal is due, YYYY-MM-DD (UTC). Null when the service has no renewal date, for example before its first payment
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/services/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 7044,
"product_id": 1201,
"product_name": "Example VPS 2 GB",
"label": "web1.example.com",
"status": "active",
"recurring_amount_minor": 599,
"currency": "USD",
"renewal_date": "2026-12-14"
}
Cancel a service
POST /v1/services/{id}/cancel
Operation services.cancel
destructive services:cancelIdempotency-Key
Stops billing for the service at once: no further renewal invoice is issued, and this cannot be undone through the API. The server is not deleted. It keeps running until the end of the period already paid for (suspend_at), then it is suspended and its data kept; if no paid time is left it is suspended straight away, which takes it offline. confirm must equal the service id. The server field of the response says which of these happened. Once a service is cancelled its server is no longer listed or reachable through the server operations (they answer 404), even while it is still running: take any backup or copy you need before you cancel.
Path parameters
idinteger required Your service id, fromservices.list
Body
when"immediate" required Always immediate: billing stops now. The server still runs to the end of the period already paid forconfirminteger required Must equal the service id in the URLreasonstring Why you are cancelling, in your own words
Returns
idinteger requiredstatus"cancelled" required The billing status of the service after this requesteffective"immediate" required Billing stopped at once: no further renewal invoice is issuedinfrastructure_changedboolean required True only when this request suspended the server and the suspension was confirmedserverstring required suspended: the server is suspended and its data kept. scheduled: the server stays online until suspend_at, then it is suspended and its data kept. suspend_failed: billing is cancelled but the suspension is not confirmed; our team has been alerted. none: the service has no server. One of suspended, scheduled, suspend_failed, none.suspend_attimestamp or null required End of the period already paid for, ISO 8601 UTC; the server is suspended once it has passed. Null unless server is scheduled
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the service id in the URL (the refusal carries field: confirm), or when is not immediate. Nothing is changed.ACCOUNT_RESTRICTED403 The service is in a state that cannot be cancelled through the API, or it is on hold. Contact support.409409 RESOURCE_STATE_CONFLICT (reason: order_unpaid): The service is pending: it belongs to an order that has not been paid. Cancel the order withorders.cancelinstead.IN_PROGRESS409 Another change to this service is being applied. Try again shortly.UPSTREAM_UNAVAILABLE502 The cancellation may or may not have been recorded. Readservices.get: status cancelled means it was.
curl -X POST "https://api.privatebyte.com/v1/services/{id}/cancel" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"when": "immediate",
"confirm": 7044,
"reason": "Project finished"
}'
{
"id": 7044,
"status": "cancelled",
"effective": "immediate",
"infrastructure_changed": false,
"server": "scheduled",
"suspend_at": "2026-12-14T00:00:00.000Z"
}
Get a service's renewal invoice early
POST /v1/services/{id}/renewal
Operation services.renewal.request
money billing:paybilling:readIdempotency-Key
Issues the normal renewal invoice of an active service ahead of time and returns its invoice_id; if an unpaid renewal invoice already exists, that one is returned. It takes no payment and the amount is the normal renewal price of the service: pay the invoice afterwards (invoices.credit.create pays from wallet credit). The service must be active and due for renewal within the next 30 days. confirm must equal the service id.
Path parameters
idinteger required Your service id, fromservices.list
Body
confirminteger required Must equal the service id in the URL
Returns
invoice_idinteger required The unpaid renewal invoice for this service: newly issued, or the one that was already open
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the service id in the URL (the refusal carries field: confirm). Nothing is issued.403403 ACCOUNT_RESTRICTED (reason: email_not_verified): The account email address is not verified. The customer must verify it in the client area first.NOT_FOUND404 Also returned for a service of yours that is overdue or has no renewal (cancelled, one-off or free). Check renewal_date withservices.get.409409 PRECONDITION (reason: renewal_not_due): The service renews more than 30 days from now.details.renewal_dateis the renewal date anddetails.opens_datethe first day an early renewal can be issued.409409 PRECONDITION (reason: service_not_active): The service is suspended, so its renewal cannot be issued early.409409 PRECONDITION (reason: service_change_in_progress): A plan change for this service is not finished. Wait until it completes, then ask again.409409 PRECONDITION (reason: renewal_not_available): No renewal invoice could be issued or found for this service, for example because the renewal is already paid.
curl -X POST "https://api.privatebyte.com/v1/services/{id}/renewal" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 7044
}'
{
"invoice_id": 9102
}
Read your wallet balance
GET /v1/billing/balance
Operation billing.balance
read billing:read
Returns the wallet credit you can spend, in whole minor units (cents), and the currency your account is billed in. Nothing needs to be true first. Check it before paying invoices from the wallet: credit only pays invoices in the same currency. To add credit use billing.deposits.create.
Returns
balance_minorinteger required Wallet credit available to spend, in whole minor units (cents) ofcurrencycurrencystring required The currency your account is billed in. balance_minor is the wallet credit held in this currency. One of USD, EUR, GBP.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/balance" \
-H "Authorization: Bearer $PB_API_KEY"
{
"balance_minor": 2500,
"currency": "USD"
}
Find a batch payment by its Idempotency-Key
GET /v1/billing/credit-batches
Operation billing.credit_batches.find
read billing:read
Use this when the reply to billing.credit_batches.create was lost or the outcome was unknown. Send the original Idempotency-Key as request_key with the same currency and the same invoices list (same order and ceilings, as JSON text). batch is the original receipt, or null when that request has not paid anything. null does not prove it never will if the request may still be running: use billing.credit_batches.cancel to settle that. It changes nothing.
Query parameters
request_keystring required Exact original Idempotency-Key used for this batchcurrencystring required Original confirmed currencyinvoicesstring required JSON array of the exact original ordered invoice_id and max_amount_minor objects; 1 to 25 unique invoices, at most 4096 JSON characters
Returns
batchobject or null required The receipt of the original request, or null when that request did not pay anything Child fieldsbatch_idstring requiredcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objects required One payment per invoice, in the same order asinvoices. Every invoice in a batch is paid in full Child fieldspayment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorinteger required Wallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/credit-batches?request_key={request_key}¤cy={currency}&invoices={invoices}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"batch": {
"batch_id": "crb_0123456789abcdef0123456789abcdef",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"payments": [
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
},
{
"payment_id": "crp_22222222222222222222222222222222",
"invoice_id": 9102,
"currency": "USD",
"applied_minor": 799,
"wallet_balance_after_minor": 1102,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
],
"wallet_balance_after_minor": 1102
}
}
Pay up to 25 invoices from your wallet at once
POST /v1/billing/credit-batches
Operation billing.credit_batches.create
money invoices:paybilling:readIdempotency-Key
Spends wallet credit on 1 to 25 unpaid invoices in one step. Use it when the wallet already covers them; for one invoice, or to make a part payment, use invoices.credit.create. Every invoice is paid in full or nothing is paid: the batch is refused if the wallet cannot cover the whole selection or any invoice needs more than its max_amount_minor. Those per-invoice ceilings are your consent to the amounts (read balance_minor from invoices.get first); confirm must be true. The receipt lists one payment per invoice and the wallet balance afterwards. A receipt proves the invoice was paid; any service on it is activated or renewed shortly afterwards, not within this call. If the reply is lost, or the answer is 502 UPSTREAM_UNAVAILABLE, the outcome is unknown: do not send it again with a new Idempotency-Key. Call billing.credit_batches.find, and billing.credit_batches.cancel if the original must never complete.
Body
currencystring required Currency of the wallet and of every listed invoice. One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
confirmtrue required Must be true. The request names several invoices, so there is no single id to repeat; the per-invoice ceilings are your consent to the amounts
Returns
batch_idstring requiredcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objects required One payment per invoice, in the same order asinvoices. Every invoice in a batch is paid in full Child fieldspayment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorinteger required Wallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: ceiling_exceeded): An invoice needs more than the max_amount_minor you set for it. Nothing was paid; read the invoices again and resend with a new Idempotency-Key.400400 VALIDATION_FAILED (reason: currency_mismatch): An invoice is not in the currency you sent. Nothing was paid.400400 VALIDATION_FAILED (reason: invoice_not_payable): An invoice in the selection is already paid, cancelled or has nothing left to pay. Nothing was paid.400400 VALIDATION_FAILED (reason: request_cancelled): This Idempotency-Key was cancelled withbilling.credit_batches.canceland can never pay.ACCOUNT_RESTRICTED403 The account email is not verified yet, or the account is restricted.409409 PRECONDITION (reason: gateway_payment_refused): An invoice in the batch holds a Gateway that cannot be paid for now: it is on hold, or its location is no longer on sale to your account. Nothing in the batch was paid.detailscarries invoice_id and service_ids; contact support.409409 LIMIT_REACHED (reason: insufficient_wallet_balance): The wallet does not cover the whole selection. Nothing was paid; checkbilling.balance, then add funds or pay fewer invoices.IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.UPSTREAM_UNAVAILABLE502 Billing did not answer. The outcome may be unknown: callbilling.credit_batches.findwith the original Idempotency-Key before doing anything else.
curl -X POST "https://api.privatebyte.com/v1/billing/credit-batches" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"confirm": true
}'
{
"batch_id": "crb_0123456789abcdef0123456789abcdef",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"payments": [
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
},
{
"payment_id": "crp_22222222222222222222222222222222",
"invoice_id": 9102,
"currency": "USD",
"applied_minor": 799,
"wallet_balance_after_minor": 1102,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
],
"wallet_balance_after_minor": 1102
}
Read the receipt of a batch wallet payment
GET /v1/billing/credit-batches/{batch_id}
Operation billing.credit_batches.get
read billing:read
Returns the receipt made by billing.credit_batches.create: the invoices paid, one payment per invoice and the wallet balance after the batch. A receipt never changes; read invoices.get or billing.balance for the current state.
Path parameters
batch_idstring required Id of a batch wallet payment, frombilling.credit_batches.create
Returns
batch_idstring requiredcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objects required One payment per invoice, in the same order asinvoices. Every invoice in a batch is paid in full Child fieldspayment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorinteger required Wallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/credit-batches/{batch_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"batch_id": "crb_0123456789abcdef0123456789abcdef",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"payments": [
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
},
{
"payment_id": "crp_22222222222222222222222222222222",
"invoice_id": 9102,
"currency": "USD",
"applied_minor": 799,
"wallet_balance_after_minor": 1102,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
],
"wallet_balance_after_minor": 1102
}
Read how a batch payment request ended
GET /v1/billing/credit-batches/cancellation
Operation billing.credit_batches.resolution.get
read billing:read
Tells you whether an earlier billing.credit_batches.create, named by its original Idempotency-Key in request_key with the same currency and invoices, ended as completed (with its receipt) or cancelled. resolution is null when it has neither paid nor been cancelled, so its outcome is still open. It is the read-only counterpart of billing.credit_batches.cancel: use it to check before deciding to cancel.
Query parameters
request_keystring required Exact original payment Idempotency-Keycurrencystring required Exact original confirmed currencyinvoicesstring required JSON array of the original ordered invoice_id and max_amount_minor objects, 1 to 25 unique invoices
Returns
resolutionobject or null required null when the original request neither paid nor was cancelled: its outcome is still open Child fieldsstate"cancelled" requiredcancellationobject required Child fieldscancellation_idstring required Id of the cancellation recordcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paidcancelledtrue required Always true: the original request can never take a payment now
batchobject required Child fieldsbatch_idstring requiredcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paidpaymentsarray of objects required One payment per invoice, in the same order asinvoices. Every invoice in a batch is paid in fullwallet_balance_after_minorinteger required Wallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/credit-batches/cancellation?request_key={request_key}¤cy={currency}&invoices={invoices}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"resolution": {
"state": "completed",
"batch": {
"batch_id": "crb_0123456789abcdef0123456789abcdef",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"payments": [
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
},
{
"payment_id": "crp_22222222222222222222222222222222",
"invoice_id": 9102,
"currency": "USD",
"applied_minor": 799,
"wallet_balance_after_minor": 1102,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
],
"wallet_balance_after_minor": 1102
}
}
}
Stop a batch payment request, or get its receipt
POST /v1/billing/credit-batches/cancellation
Operation billing.credit_batches.cancel
safe invoices:paybilling:readIdempotency-Key
Closes the outcome of an earlier billing.credit_batches.create whose result you do not know. Name it by its original Idempotency-Key in request_key, with the same currency and invoices, and confirm true; this call needs an Idempotency-Key of its own. If the original had not paid, it is cancelled permanently and can never pay (state cancelled); if it had already paid, nothing is reversed and you get its receipt (state completed). It never refunds or spends. After a cancellation, pay with a new request and a new Idempotency-Key.
Body
currencystring required Currency of the wallet and of every listed invoice. One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
confirmtrue required Must be true. The request names several invoices, so there is no single id to repeat; the per-invoice ceilings are your consent to the amountsrequest_keystring required The Idempotency-Key of the original batch payment request you want stopped
Returns
state"cancelled"cancellationobject Child fieldscancellation_idstring required Id of the cancellation recordcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
cancelledtrue required Always true: the original request can never take a payment now
batchobject Child fieldsbatch_idstring requiredcurrencystring required One of USD, EUR, GBP.invoicesarray of objects required 1 to 25 different invoices, in the order they are to be paid Child fieldsinvoice_idinteger required One of your invoicesmax_amount_minorinteger required Spending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objects required One payment per invoice, in the same order asinvoices. Every invoice in a batch is paid in full Child fieldspayment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorinteger required Wallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
UPSTREAM_UNAVAILABLE502 Billing did not answer. The outcome may be unknown: callbilling.credit_batches.resolution.getwith the original Idempotency-Key before doing anything else.
curl -X POST "https://api.privatebyte.com/v1/billing/credit-batches/cancellation" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"request_key": "batch-2026-11-14-a",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"confirm": true
}'
{
"state": "cancelled",
"cancellation": {
"cancellation_id": "crb_fedcba9876543210fedcba9876543210",
"currency": "USD",
"invoices": [
{
"invoice_id": 9101,
"max_amount_minor": 599
},
{
"invoice_id": 9102,
"max_amount_minor": 799
}
],
"cancelled": true
}
}
Read the smallest and largest funding amount
GET /v1/billing/deposit-limits
Operation billing.deposits.limits
read billing:read
Returns minimum_amount_minor and maximum_amount_minor for one funding request in the currency you name, in whole minor units (cents). The limits are per request, not per day, and are not converted between currencies. Read it before billing.deposits.create so the amount is not refused.
Query parameters
currencystring required Currency in which these numeric funding limits apply; no FX conversion
Returns
currencystring required One of USD, EUR, GBP.minimum_amount_minorinteger required Smallest amount one funding request may ask for, in whole minor units (cents)maximum_amount_minorinteger required Largest amount one funding request may ask for, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/deposit-limits?currency={currency}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"currency": "USD",
"minimum_amount_minor": 500,
"maximum_amount_minor": 1000000
}
Find a funding invoice by its Idempotency-Key
GET /v1/billing/deposits
Operation billing.deposits.find
read billing:read
Use this when the reply to billing.deposits.create was lost or the outcome was unknown. Send the original Idempotency-Key as request_key with the same currency and amount_minor. deposit is the original record, or null when no funding invoice exists for that request; if the original request may still be running, ask again shortly before creating a new one. It changes nothing.
Query parameters
request_keystring required Exact original Idempotency-Key used to accept this wallet funding invoicecurrencystring required Original requested currencyamount_minorinteger required Exact original requested amount in minor currency units
Returns
depositobject or null required The receipt of the original request, or null when no funding invoice was created for that key, currency and amount Child fieldsdeposit_idstring required Id of this funding request; read it back with the deposit read operationinvoice_idinteger required The unpaid funding invoice that was created. Paying it adds amount_minor to the walletcurrencystring required One of USD, EUR, GBP.amount_minorinteger required Amount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/deposits?request_key={request_key}¤cy={currency}&amount_minor={amount_minor}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"deposit": {
"deposit_id": "dep_0123456789abcdef0123456789abcdef",
"invoice_id": 9110,
"currency": "USD",
"amount_minor": 2500
}
}
Create an invoice that adds funds to your wallet
POST /v1/billing/deposits
Operation billing.deposits.create
money billing:paybilling:readIdempotency-Key
Creates one unpaid funding invoice for the amount and currency you state. It does not take a payment and the wallet does not change yet. Next, the invoice (invoice_id) has to be paid in the client area by card, PayPal or crypto; the API cannot take that payment. When it is paid the amount is added to the wallet: check with invoices.get (status paid) or billing.balance. The amount must be within billing.deposits.limits and the account email must be verified. If the reply is lost, or the answer is 502 UPSTREAM_UNAVAILABLE, the outcome is unknown: do not send it again with a new Idempotency-Key. Call billing.deposits.find instead.
Body
currencystring required Currency of the funding invoice and of the wallet credit it adds. Credit only pays invoices in the same currency; nothing is converted. One of USD, EUR, GBP.amount_minorinteger required Amount to add to the wallet, in whole minor units (cents). Must be within the limits for this currency
Returns
deposit_idstring required Id of this funding request; read it back with the deposit read operationinvoice_idinteger required The unpaid funding invoice that was created. Paying it adds amount_minor to the walletcurrencystring required One of USD, EUR, GBP.amount_minorinteger required Amount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: deposit_below_minimum): amount_minor is under the minimum.detailscarries currency, minimum_amount_minor and maximum_amount_minor.400400 VALIDATION_FAILED (reason: deposit_above_maximum): amount_minor is over the maximum.detailscarries currency, minimum_amount_minor and maximum_amount_minor.ACCOUNT_RESTRICTED403 The account email is not verified yet, or the account is restricted.IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.UPSTREAM_UNAVAILABLE502 Billing did not answer. The outcome may be unknown: callbilling.deposits.findwith the original Idempotency-Key before doing anything else.
curl -X POST "https://api.privatebyte.com/v1/billing/deposits" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount_minor": 2500
}'
{
"deposit_id": "dep_0123456789abcdef0123456789abcdef",
"invoice_id": 9110,
"currency": "USD",
"amount_minor": 2500
}
Read the record of a funding invoice you created
GET /v1/billing/deposits/{deposit_id}
Operation billing.deposits.get
read billing:read
Returns the record made by billing.deposits.create: the funding invoice id, currency and amount. The record never changes, so it does not say whether the invoice has been paid; read invoices.get with its invoice_id for that, or billing.balance for the wallet.
Path parameters
deposit_idstring required Id of a funding request, frombilling.deposits.create
Returns
deposit_idstring required Id of this funding request; read it back with the deposit read operationinvoice_idinteger required The unpaid funding invoice that was created. Paying it adds amount_minor to the walletcurrencystring required One of USD, EUR, GBP.amount_minorinteger required Amount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/deposits/{deposit_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"deposit_id": "dep_0123456789abcdef0123456789abcdef",
"invoice_id": 9110,
"currency": "USD",
"amount_minor": 2500
}
List wallet ledger entries in one currency, newest first
GET /v1/billing/transactions
Operation billing.transactions.list
read billing:read
Returns the entries that added to or spent from your wallet in the currency you name: deposits, invoice payments, service credits, rewards and refunds. amount_minor is signed and balance_after_minor is the balance straight after each entry. Filter with direction (credit or debit) and page with limit and cursor; a null next_cursor means there is no older page. It changes nothing.
Query parameters
currencystring required Wallet currency to read; no automatic conversion or profile defaultdirectionstring Filter by signed movement; zero amounts appear only in all (default)limitinteger 1–100 entries, default 20cursorstring next_cursor from the previous page; entries have descending ledger ids
Returns
currencystring required Currency of every amount on this page. One of USD, EUR, GBP.dataarray of objects required Child fieldsidinteger required Ledger entry id. Entries are returned newest first (descending id)created_attimestamp required When the entry was written, ISO 8601 UTCdescriptionstring required What the entry was for, as shown in the client areaamount_minorinteger required Signed change to the wallet in whole minor units (cents): positive adds credit, negative spends itbalance_after_minorinteger required Wallet balance straight after this entry, in whole minor units (cents)typestring required credit when amount_minor is zero or more, debit when it is negative. One of credit, debit.categorystring required Label worked out from the description: deposit, withdrawal, service_credit, reward, invoice_payment, refund or other. A guide for display, not an accounting type. One of deposit, withdrawal, service_credit, reward, invoice_payment, refund, other.
next_cursorstring or null required Pass ascursorto get the next (older) page. null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/billing/transactions?currency={currency}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"currency": "USD",
"data": [
{
"id": 4120,
"created_at": "2026-11-14T10:05:00.000Z",
"description": "Applied to invoice 9101",
"amount_minor": -599,
"balance_after_minor": 1901,
"type": "debit",
"category": "invoice_payment"
},
{
"id": 4119,
"created_at": "2026-11-14T09:58:12.000Z",
"description": "Manual deposit",
"amount_minor": 2500,
"balance_after_minor": 2500,
"type": "credit",
"category": "deposit"
}
],
"next_cursor": null
}
Your invoices, newest first
GET /v1/invoices
Operation invoices.list
read billing:read
Returns your invoices, newest first: id, total, currency, status (paid, unpaid or cancelled), issue date and due date. Page with limit (1 to 100, default 20) and cursor; a null next_cursor means that was the last page. For the amount still owed and the line items, read one invoice with invoices.get. It changes nothing.
Query parameters
limitinteger 1–100, default 20cursorstring next_cursor from previous page; invoices have descending ids
Returns
dataarray of objects required Child fieldsidinteger required Invoice idtotal_minorinteger required Invoice total after credit already applied and tax, in whole minor units (cents) ofcurrencycurrencystring required Currency of this invoice. It can only be paid from wallet credit in the same currency. One of USD, EUR, GBP.statusstring required paid: settled in full. unpaid: open, see balance_minor on the invoice for what is left. cancelled: void, cannot be paid. One of paid, unpaid, cancelled.issued_datestring required UTC calendar date the invoice was issued, YYYY-MM-DDdue_datestring or null required Calendar date payment is due, YYYY-MM-DD. null when the invoice has no due date
next_cursorstring or null required Pass ascursorto get the next page. null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/invoices" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 9101,
"total_minor": 599,
"currency": "USD",
"status": "unpaid",
"issued_date": "2026-11-07",
"due_date": "2026-11-21"
},
{
"id": 9090,
"total_minor": 799,
"currency": "USD",
"status": "paid",
"issued_date": "2026-10-07",
"due_date": "2026-10-21"
}
],
"next_cursor": null
}
Read one invoice
GET /v1/invoices/{invoice_id}
Operation invoices.get
read billing:read
Returns one of your invoices with balance_minor (what is still owed, 0 when paid) and its line items. Read it before paying so the ceiling you send covers balance_minor, and afterwards to see whether it is paid. An invoice that is not yours is answered as not found.
Path parameters
invoice_idinteger required Your invoice id
Returns
idinteger required Invoice idtotal_minorinteger required Invoice total after credit already applied and tax, in whole minor units (cents) ofcurrencycurrencystring required Currency of this invoice. It can only be paid from wallet credit in the same currency. One of USD, EUR, GBP.statusstring required paid: settled in full. unpaid: open, see balance_minor on the invoice for what is left. cancelled: void, cannot be paid. One of paid, unpaid, cancelled.issued_datestring required UTC calendar date the invoice was issued, YYYY-MM-DDdue_datestring or null required Calendar date payment is due, YYYY-MM-DD. null when the invoice has no due datebalance_minorinteger required Amount still to pay, in whole minor units (cents) ofcurrency. 0 when paiditemsarray of objects required Child fieldsdescriptionstring required Line item text as shown on the invoiceamount_minorinteger required Line amount (unit price times quantity), in whole minor units (cents) of the invoice currency
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/invoices/{invoice_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 9101,
"total_minor": 599,
"currency": "USD",
"status": "unpaid",
"issued_date": "2026-11-07",
"due_date": "2026-11-21",
"balance_minor": 599,
"items": [
{
"description": "Cloud server, monthly (07/11/2026 - 06/12/2026)",
"amount_minor": 599
}
]
}
Find a wallet payment by its Idempotency-Key
GET /v1/invoices/{invoice_id}/payments/credit
Operation invoices.credit.find
read billing:read
Use this when the reply to invoices.credit.create was lost or the outcome was unknown. Send the original Idempotency-Key as request_key with the same currency and max_amount_minor. payment is the original receipt, or null when that request did not take a payment. It changes nothing and never pays again.
Path parameters
invoice_idinteger required Your invoice id
Query parameters
request_keystring required The exact Idempotency-Key used for the original payment requestcurrencystring required Original payment currencymax_amount_minorinteger required The exact positive spend cap from the original request, in minor currency units
Returns
paymentobject or null required The receipt of the original request, or null when that request did not take a payment Child fieldspayment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/invoices/{invoice_id}/payments/credit?request_key={request_key}¤cy={currency}&max_amount_minor={max_amount_minor}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"payment": {
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
}
Pay one invoice from your wallet, up to a ceiling you state
POST /v1/invoices/{invoice_id}/payments/credit
Operation invoices.credit.create
money invoices:paybilling:readIdempotency-Key
Spends wallet credit on one unpaid invoice. Use it for a single invoice; for several at once use billing.credit_batches.create. It takes the smallest of: what the invoice still owes, your wallet balance, and max_amount_minor, so it can be a part payment: invoice_paid in the receipt says whether the invoice was settled and invoice_remaining_after_minor what is left. max_amount_minor is the ceiling and your consent to the amount; confirm must repeat the invoice id in the URL. The receipt holds the amount applied and the wallet balance afterwards. A receipt proves the invoice was paid; any service on it is activated or renewed shortly afterwards, not within this call. If the reply is lost, or the answer is 502 UPSTREAM_UNAVAILABLE, the outcome is unknown: do not send it again with a new Idempotency-Key. Call invoices.credit.find instead.
Path parameters
invoice_idinteger required Your invoice id
Body
currencystring required Currency you expect the invoice and the wallet to be in. Refused when the invoice is in another currency. One of USD, EUR, GBP.max_amount_minorinteger required Spending ceiling in whole minor units (cents): at most this much leaves the wallet. This is your consent to the amountconfirminteger required Must equal the invoice id in the URL
Returns
payment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: currency_mismatch): The invoice is not in the currency you sent.detailscarries invoice_id and, when known, the invoice currency.400400 VALIDATION_FAILED (reason: invoice_already_paid): The invoice is paid or has nothing left to pay.detailscarries invoice_id.400400 VALIDATION_FAILED (reason: invoice_cancelled): The invoice was cancelled.detailscarries invoice_id.400400 VALIDATION_FAILED (reason: invoice_not_payable): The invoice stopped being payable while the request ran.detailscarries invoice_id.ACCOUNT_RESTRICTED403 The account email is not verified yet, or the account is restricted.409409 PRECONDITION (reason: gateway_payment_refused): The invoice holds a Gateway that cannot be paid for now: it is on hold, or its location is no longer on sale to your account. Nothing was paid.detailscarries invoice_id and service_ids; contact support.409409 LIMIT_REACHED (reason: no_wallet_balance): The wallet holds no credit in this currency. Nothing was paid; add funds withbilling.deposits.create.detailscarries invoice_id.IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.UPSTREAM_UNAVAILABLE502 Billing did not answer. The outcome may be unknown: callinvoices.credit.findwith the original Idempotency-Key before doing anything else.
curl -X POST "https://api.privatebyte.com/v1/invoices/{invoice_id}/payments/credit" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"max_amount_minor": 599,
"confirm": 9101
}'
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
Read the receipt of one wallet payment on an invoice
GET /v1/invoices/{invoice_id}/payments/credit/{payment_id}
Operation invoices.credit.get
read billing:read
Returns the receipt made by invoices.credit.create: the amount applied, the wallet balance and what the invoice still owed straight afterwards. A receipt never changes, so later payments are not reflected in it; read invoices.get for the current state.
Path parameters
invoice_idinteger required Your invoice idpayment_idstring required Id of a wallet payment, frominvoices.credit.create
Returns
payment_idstring required Id of this wallet payment; read it back with the payment read operationinvoice_idinteger required The invoice that was paidcurrencystring required One of USD, EUR, GBP.applied_minorinteger required Amount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceilingwallet_balance_after_minorinteger required Wallet balance straight after this payment, in whole minor units (cents)invoice_remaining_after_minorinteger required What was still owed on the invoice straight after this payment. 0 when it was paid in fullinvoice_paidboolean required true when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/invoices/{invoice_id}/payments/credit/{payment_id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"payment_id": "crp_11111111111111111111111111111111",
"invoice_id": 9101,
"currency": "USD",
"applied_minor": 599,
"wallet_balance_after_minor": 1901,
"invoice_remaining_after_minor": 0,
"invoice_paid": true
}
Export your recent invoices with product details
GET /v1/invoices/export
Operation invoices.export
read billing:read
Returns up to your 500 most recent invoices in one JSON response, newest first (it is not a CSV file). Each row has the invoice id, dates, total with currency, status and the product details read from its line items. There is no date-range filter and no paging: older invoices beyond the 500 are not included, and for those, or for regular polling, use invoices.list and invoices.get. It reads every invoice in full, so it is slow on accounts with many invoices; do not call it in a loop.
Returns
invoicesarray of objects required Newest first, at most the 500 most recent invoices Child fieldsinvoice_idinteger required Invoice id; use it with the invoice read and payment operationsissued_datestring required UTC calendar date the invoice was issued, YYYY-MM-DDdue_datestring or null required Calendar date payment is due, YYYY-MM-DD. null when the invoice has no due datepaid_attimestamp or null required When the invoice was paid, ISO 8601 UTC. null while unpaid or cancelledtotal_minorinteger required Invoice total after credit already applied and tax, in whole minor units (cents) ofcurrencycurrencystring required Currency of this invoice. One of USD, EUR, GBP.statusstring required paid: settled in full. unpaid: open. cancelled: void, cannot be paid. One of paid, unpaid, cancelled.payment_methodstring or null required Payment method recorded on the invoice. null when none is recorded thereplan_namestring required Product name read from the first line item. Empty text when the invoice has no product linebilling_periodstring required Billing period text as printed on the first line item. Display text, not a parseable date range; empty when the line has nonelocationstring required Server location read from the first line item. Empty text when not statedoperating_systemstring required Operating system read from the first line item. Empty text when not statedspecsstring required Resource summary read from the first line item, comma separated. Empty text when not statedall_itemsstring required Product names of every line item, separated by "; "
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.UPSTREAM_UNAVAILABLE502 The export could not be put together completely. No partial export is returned; try again shortly or useinvoices.list.
curl "https://api.privatebyte.com/v1/invoices/export" \
-H "Authorization: Bearer $PB_API_KEY"
{
"invoices": [
{
"invoice_id": 9090,
"issued_date": "2026-10-07",
"due_date": "2026-10-21",
"paid_at": "2026-10-08T09:14:03.000Z",
"total_minor": 799,
"currency": "USD",
"status": "paid",
"payment_method": null,
"plan_name": "Cloud server",
"billing_period": "07/10/2026 - 06/11/2026",
"location": "Europe",
"operating_system": "Ubuntu 24.04",
"specs": "CPU: 2, RAM: 4 GB",
"all_items": "Cloud server"
}
]
}
List your Gateways
GET /v1/gateways
Operation gateway.list
read gateway:read
Returns every Gateway on the account that has not been cancelled, with its location, speed, IP address and state. A Gateway gives one of your own machines a dedicated public IPv4 address through an encrypted WireGuard tunnel, unmetered at the speed of its tier. The list carries no live tunnel state: call gateway.get or gateway.status with a service_id for that. A Gateway is usable once state is active; setup then starts at gateway.keys.register.
Returns
gatewaysarray of objects required Child fieldsservice_idinteger required Gateway id: the {id} of every Gateway operation, and the value confirm must repeatlocationstring required Location code of the Gatewaylocation_labelstring required Display name of the locationtier25 or 50 or 100 or 250 required Speed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.statestring required setting_up: being provisioned, not usable yet. active: ready to use. needs_support: provisioning failed or the tunnel is missing; open a support ticket. One of setting_up, active, needs_support.ipstring or null required The dedicated public IPv4 address; null until one is assignedsuspendedboolean required True while we have switched the Gateway off;gateway.statussays whether it is for an unpaid invoice or a reviewcancel_blockedboolean required True whengateway.cancelis refused for this Gateway; contact support insteadpending_downgrade_tierobject or null required Lower speed that applies when the next renewal invoice is paid; null when none is scheduledserverobject or null required Our end of the tunnel; null until the Gateway is active Child fieldspublic_keystring required WireGuard public key of our end of the tunnelendpointstring required host:port the device connects tomtuinteger required MTU to set on the tunnel interface; a larger value stalls big transfers
Refusals specific to this operation
NOT_FOUND404 Gateways are not available on this account.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways" \
-H "Authorization: Bearer $PB_API_KEY"
{
"gateways": [
{
"service_id": 4821,
"location": "uk",
"location_label": "London",
"tier": 50,
"state": "active",
"ip": "203.0.113.10",
"suspended": false,
"cancel_blocked": false,
"pending_downgrade_tier": null,
"server": {
"public_key": "ZXhhbXBsZS1zZXJ2ZXItcHVibGljLWtleS0wMDAwMDE=",
"endpoint": "gw.example.com:51820",
"mtu": 1380
}
}
]
}
Read one Gateway with its live tunnel counters
GET /v1/gateways/{id}
Operation gateway.get
read gateway:read
Returns the Gateway plus whether a key is registered, the last handshake and the traffic counters. If the live state cannot be read, the live fields come back as false, null and 0 instead of the call failing; gateway.status says whether a reading is live. After ordering a Gateway, poll this until state is active before starting setup. needs_support means open a support ticket.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Returns
gatewayobject required Child fieldsservice_idinteger required Gateway id: the {id} of every Gateway operation, and the value confirm must repeatlocationstring required Location code of the Gatewaylocation_labelstring required Display name of the locationtier25 or 50 or 100 or 250 required Speed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.statestring required setting_up: being provisioned, not usable yet. active: ready to use. needs_support: provisioning failed or the tunnel is missing; open a support ticket. One of setting_up, active, needs_support.ipstring or null required The dedicated public IPv4 address; null until one is assignedsuspendedboolean required True while we have switched the Gateway off;gateway.statussays whether it is for an unpaid invoice or a reviewcancel_blockedboolean required True whengateway.cancelis refused for this Gateway; contact support insteadpending_downgrade_tierobject or null required Lower speed that applies when the next renewal invoice is paid; null when none is scheduledserverobject or null required Our end of the tunnel; null until the Gateway is active Child fieldspublic_keystring required WireGuard public key of our end of the tunnelendpointstring required host:port the device connects tomtuinteger required MTU to set on the tunnel interface; a larger value stalls big transfers
peer_setboolean required True once a public key is registered. Also false when the live state could not be read;gateway.statustells the two apart.handshake_attimestamp or null required Last WireGuard handshake with the device; null when there has been none or the live state could not be readrx_bytesnumber required Bytes received from the device through the tunnel (its upload)tx_bytesnumber required Bytes sent to the device through the tunnel (its download)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"gateway": {
"service_id": 4821,
"location": "uk",
"location_label": "London",
"tier": 50,
"state": "active",
"ip": "203.0.113.10",
"suspended": false,
"cancel_blocked": false,
"pending_downgrade_tier": null,
"server": {
"public_key": "ZXhhbXBsZS1zZXJ2ZXItcHVibGljLWtleS0wMDAwMDE=",
"endpoint": "gw.example.com:51820",
"mtu": 1380
},
"peer_set": true,
"handshake_at": "2026-11-14T10:04:30.000Z",
"rx_bytes": 1048576,
"tx_bytes": 8388608
}
}
Cancel a Gateway now and release its IP address
POST /v1/gateways/{id}/cancel
Operation gateway.cancel
destructive gateway:writeservices:cancelIdempotency-Key
Destructive and immediate: billing for the Gateway stops and its IP address goes back to the pool, where it may be issued to someone else. It cannot be undone and the same address cannot be recovered. confirm must equal the Gateway id in the URL. released true means the address is already released; false means the cancellation is done and we finish the release ourselves. Once released, the Gateway is no longer listed and its id answers 404.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
confirminteger required Must equal the Gateway id in the URL
Returns
oktrue requiredreleasedboolean required true: the IP address is released. false: billing is cancelled and we finish releasing the address ourselves; nothing more to do.
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.403403 ACCOUNT_RESTRICTED (reason: cancel_blocked): The Gateway is held by our team (cancel_blocked is true ongateway.get) and cannot be cancelled through the API. Open a support ticket.UPSTREAM_UNAVAILABLE502 The outcome is unknown. Readgateway.getbefore trying again: 404 means the Gateway was cancelled.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/cancel" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"confirm": 4821
}'
{
"ok": true,
"released": true
}
Get the WireGuard configuration template for the device
GET /v1/gateways/{id}/config
Operation gateway.config.get
read gateway:read
Setup step 2 of 5. Returns the configuration as text with a placeholder where the private key goes. The private key is generated on the customer's device, never leaves it, is never sent to this API and is not in the response. Choose kind for the machine: device (a phone or computer; all its IPv4 traffic uses the Gateway), linux (a server; only traffic from the Gateway address uses the tunnel) or router. On the device, put the private key in place of the placeholder, load the configuration and switch the tunnel on; then poll gateway.test.tunnel.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Query parameters
kindstring required device: a phone or computer running the WireGuard app; all its IPv4 traffic uses the Gateway. linux: a server; only traffic from the Gateway address uses the tunnel. router: the linux configuration with notes for common routers.
Returns
kindstring required One of device, linux, router.filenamestring required Suggested file name for the configurationtemplatestring required WireGuard configuration text. Its PrivateKey line holds the literal placeholder "<your private key>": replace it on the device. The private key is never sent to this API and never returned by it.placeholdersarray of "PrivateKey"s required Configuration keys whose value you fill in on the deviceserverobject required Child fieldspublic_keystring required WireGuard public key of our end of the tunnelendpointstring required host:port the device connects tomtuinteger required MTU to set on the tunnel interface; a larger value stalls big transfers
addressstring required Tunnel address for the device: the Gateway IP as a /32notesarray of objects required Setup notes for this kind of device, written for a person Child fieldstitlestring requiredtextstring required
full_tunnelboolean required True when the configuration sends all IPv4 traffic of the device through the Gateway (kind device). False when only traffic from the Gateway address uses it.
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: device_not_for_vps): kind is device, but the setup target saved in the client area is one of your own servers, which a full-tunnel configuration would cut off. Use kind linux.ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.NOT_READY409 The Gateway is not active yet. Pollgateway.getuntil state is active; if it is needs_support, open a support ticket.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/config?kind={kind}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"kind": "linux",
"filename": "pb-gateway-linux.conf",
"template": "[Interface]\nPrivateKey = <your private key>\nAddress = 203.0.113.10/32\nMTU = 1380\nTable = off\nPostUp = ip rule add from 203.0.113.10 table 51820; ip route add default dev %i table 51820\nPostDown = ip rule del from 203.0.113.10 table 51820; ip route flush table 51820\n\n[Peer]\nPublicKey = ZXhhbXBsZS1zZXJ2ZXItcHVibGljLWtleS0wMDAwMDE=\nEndpoint = gw.example.com:51820\nAllowedIPs = 0.0.0.0/0\nPersistentKeepalive = 25\n",
"placeholders": [
"PrivateKey"
],
"server": {
"public_key": "ZXhhbXBsZS1zZXJ2ZXItcHVibGljLWtleS0wMDAwMDE=",
"endpoint": "gw.example.com:51820",
"mtu": 1380
},
"address": "203.0.113.10/32",
"notes": [
{
"title": "Only traffic from your address uses the tunnel",
"text": "The rest of the machine keeps its normal route, so SSH and everything else on its own address are unchanged."
}
],
"full_tunnel": false
}
Register your device's public key
POST /v1/gateways/{id}/keys/register
Operation gateway.keys.register
safe gateway:writeIdempotency-Key
Setup step 1 of 5. Generate a WireGuard key pair on the device and send only the public key; the private key stays on the device. This works only while no key is registered, so it can never disconnect a working device, and sending the same key again succeeds. Next: gateway.config.get for the configuration, then gateway.test.tunnel. To change an existing key use gateway.keys.rotate.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
public_keystring required WireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.device_labelstring Your own name for the device, up to 40 characters
Returns
registeredtrue requiredreplacedboolean required True when a different key was registered before; the device using the old key is now disconnected and earlier check results are clearedfingerprintstring required First 8 characters of the registered public keyregistered_attimestamp required When this key was registered
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.409409 ALREADY_EXISTS (reason: peer_set): A different key is already registered. Usegateway.keys.rotateto replace it; that disconnects the device using the current key.409409 ALREADY_EXISTS (reason: key_in_use): That public key is already used by another tunnel. Generate a new key pair on the device and send the new public key.NOT_READY409 The Gateway is not active yet. Pollgateway.getuntil state is active; if it is needs_support, open a support ticket.502502 UPSTREAM_UNAVAILABLE (reason: not_applied): The key may or may not have been saved. Send the same key again with a new Idempotency-Key; setting the same key twice is safe.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/keys/register" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"public_key": "dGhpcy1pcy1hbi1leGFtcGxlLXB1YmxpYy1rZXktMDE=",
"device_label": "Home server"
}'
{
"registered": true,
"replaced": false,
"fingerprint": "dGhpcy1p",
"registered_at": "2026-11-14T10:00:00.000Z"
}
Replace the registered public key of a Gateway
POST /v1/gateways/{id}/keys/rotate
Operation gateway.keys.rotate
destructive gateway:writeIdempotency-Key
Replaces the registered key with a new public key generated on the device. This causes downtime: the device using the old key is disconnected until it loads a configuration with the new private key, and earlier check results are cleared, so run the checks again from gateway.test.tunnel. confirm must equal the Gateway id. A key must already be registered; for the first key use gateway.keys.register.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
public_keystring required WireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.device_labelstring Your own name for the device, up to 40 charactersconfirminteger required Must equal the Gateway id in the URL
Returns
registeredtrue requiredreplacedboolean required True when a different key was registered before; the device using the old key is now disconnected and earlier check results are clearedfingerprintstring required First 8 characters of the registered public keyregistered_attimestamp required When this key was registered
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.400400 VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.409409 PRECONDITION (reason: no_key): No key is registered yet. Usegateway.keys.register.409409 ALREADY_EXISTS (reason: key_in_use): That public key is already used by another tunnel. Generate a new key pair on the device and send the new public key.NOT_READY409 The Gateway is not active yet. Pollgateway.getuntil state is active; if it is needs_support, open a support ticket.502502 UPSTREAM_UNAVAILABLE (reason: not_applied): The key may or may not have been saved. Send the same key again with a new Idempotency-Key; setting the same key twice is safe.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/keys/rotate" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"public_key": "dGhpcy1pcy1hbi1leGFtcGxlLXB1YmxpYy1rZXktMDE=",
"device_label": "Home server",
"confirm": 4821
}'
{
"registered": true,
"replaced": true,
"fingerprint": "dGhpcy1p",
"registered_at": "2026-11-14T10:00:00.000Z"
}
Set the public key of a Gateway, replacing any existing key
PUT /v1/gateways/{id}/peer
Operation gateway.peer.set
destructive gateway:writeIdempotency-Key
Registers the key when none is set and replaces it when one is, in a single repeatable call. Replacing causes downtime: the device that uses the current key is disconnected and earlier check results are cleared. confirm must equal the Gateway id. For a first key prefer gateway.keys.register, which cannot disconnect a working device. Next: gateway.config.get, then gateway.test.tunnel.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
public_keystring required WireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.device_labelstring Your own name for the device, up to 40 charactersconfirminteger required Must equal the Gateway id in the URL
Returns
registeredtrue requiredreplacedboolean required True when a different key was registered before; the device using the old key is now disconnected and earlier check results are clearedfingerprintstring required First 8 characters of the registered public keyregistered_attimestamp required When this key was registered
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.400400 VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.409409 ALREADY_EXISTS (reason: key_in_use): That public key is already used by another tunnel. Generate a new key pair on the device and send the new public key.NOT_READY409 The Gateway is not active yet. Pollgateway.getuntil state is active; if it is needs_support, open a support ticket.502502 UPSTREAM_UNAVAILABLE (reason: not_applied): The key may or may not have been saved. Send the same key again with a new Idempotency-Key; setting the same key twice is safe.
curl -X PUT "https://api.privatebyte.com/v1/gateways/{id}/peer" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"public_key": "dGhpcy1pcy1hbi1leGFtcGxlLXB1YmxpYy1rZXktMDE=",
"confirm": 4821
}'
{
"registered": true,
"replaced": false,
"fingerprint": "dGhpcy1p",
"registered_at": "2026-11-14T10:00:00.000Z"
}
Read recent traffic samples for a Gateway
GET /v1/gateways/{id}/stats
Operation gateway.stats
read gateway:read
Returns throughput samples in Mbps for the last hour (the default) or the last 24 hours, oldest first. The list is empty until the Gateway is active. Changes nothing.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Query parameters
windowstring How far back the samples go; defaults to 1h
Returns
pointsarray of objects required Traffic samples, oldest first; empty until the Gateway is active Child fieldssampled_attimestamp required ISO 8601 UTC timestamp, e.g. 2026-11-14T10:00:00.000Zrx_mbpsnumber required Megabits per second received from the device (its upload)tx_mbpsnumber required Megabits per second sent to the device (its download)
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/stats" \
-H "Authorization: Bearer $PB_API_KEY"
{
"points": [
{
"sampled_at": "2026-11-14T10:00:00.000Z",
"rx_mbps": 1.5,
"tx_mbps": 12.25
},
{
"sampled_at": "2026-11-14T10:01:00.000Z",
"rx_mbps": 0.8,
"tx_mbps": 9.5
}
]
}
Read the live connection state of a Gateway
GET /v1/gateways/{id}/status
Operation gateway.status
read gateway:read
Returns link (whether the device is connected), the last handshake and its age, the traffic counters and, when the Gateway is suspended, whether the cause is billing or a review. It also answers while the Gateway is suspended or still being set up. It is safe to poll every few seconds. During setup use gateway.test.tunnel, which turns this state into a pass, waiting or fail verdict.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Returns
service_idinteger required Gateway id: the {id} of every Gateway operation, and the value confirm must repeatstatestring required setting_up: being provisioned, not usable yet. active: ready to use. needs_support: provisioning failed or the tunnel is missing; open a support ticket. One of setting_up, active, needs_support.suspendedfalse or object required false when in service. billing: switched off for an unpaid invoice; pay it to restore service. review: held by our team; open a support ticket. Child fieldskindstring One of billing, review.
ipstring or null required The dedicated public IPv4 address; null until one is assignedlocationstring required Location code of the Gatewaytier25 or 50 or 100 or 250 required Speed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.peerobject required Child fieldssetboolean required True once a public key is registeredregistered_attimestamp or null required When the current key was registered; null when no key is set
linkstring required no_key: no public key registered. never: key registered, the device has not connected with it yet. up: connected (handshake within the last 3 minutes). idle: last handshake between 3 minutes and 1 hour ago. lost: last handshake over 1 hour ago. unknown: the live state could not be read just now; try again. One of no_key, never, up, idle, lost, unknown.handshake_attimestamp or null required Last WireGuard handshake with the device; null when there has been nonehandshake_age_sinteger or null required Seconds since the last handshake with the current key; null when there has been nonerx_bytesnumber required Bytes received from the device through the tunnel (its upload)tx_bytesnumber required Bytes sent to the device through the tunnel (its download)daemonstring required ok: the values are live. unreachable: the live state could not be read; the values are the last known ones and may be stale. One of ok, unreachable.server_timetimestamp required The clock the handshake age was measured againstcached_age_msinteger required Age of this reading in milliseconds; readings are reused for a moment
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/status" \
-H "Authorization: Bearer $PB_API_KEY"
{
"service_id": 4821,
"state": "active",
"suspended": false,
"ip": "203.0.113.10",
"location": "uk",
"tier": 50,
"peer": {
"set": true,
"registered_at": "2026-11-14T10:00:00.000Z"
},
"link": "up",
"handshake_at": "2026-11-14T10:04:30.000Z",
"handshake_age_s": 42,
"rx_bytes": 1048576,
"tx_bytes": 8388608,
"daemon": "ok",
"server_time": "2026-11-14T10:05:12.000Z",
"cached_age_ms": 0
}
Read the result of the device-IP check
GET /v1/gateways/{id}/test/egress
Operation gateway.test.egress.get
read gateway:read
Returns the state of the check started with gateway.test.egress.start. Poll every few seconds while state is waiting. passed completes setup. not_routed means the device opened the link from another address (given in observed.ip): switch the tunnel on and open the link again. After expired, start a new check.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Query parameters
test_idstring test_id fromgateway.test.egress.start. Omit to read the latest check. An id that is no longer the active check reads as expired.
Returns
statestring required waiting: the link has not been opened yet; poll again. passed: the device reached us from the Gateway IP. not_routed: the device reached us from another address (see observed); switch the tunnel on and open the link again. expired: the link ran out before a pass; start a new check. One of waiting, passed, not_routed, expired.hitsinteger required How many times the link was openedlast_hit_attimestamp or null required When the link was last opened; null when it has not beenobservedobject Only for not_routed: the address the device actually used Child fieldsipstring required
Refusals specific to this operation
409409 PRECONDITION (reason: no_test): No check has been started for this Gateway, or the last one is gone. Callgateway.test.egress.start.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/test/egress" \
-H "Authorization: Bearer $PB_API_KEY"
{
"state": "passed",
"hits": 1,
"last_hit_at": "2026-11-14T10:12:30.000Z"
}
Check that the device goes out with the Gateway IP
POST /v1/gateways/{id}/test/egress
Operation gateway.test.egress.start
safe gateway:writeIdempotency-Key
Setup step 5 of 5. Returns a link that is valid until expires_at (about ten minutes). The link must be opened from the device that uses the Gateway, with the tunnel switched on: in its browser, by scanning qr_payload, or on a server by running command (mode bound). Then poll gateway.test.egress.get with the test_id until state is passed, not_routed or expired. Calling again while a link is active returns the same link with reused true; send fresh true to get a new one.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
modestring browser: open the link in a browser on the device. bound: for a server; the response also carries a command that sends the request from the Gateway address. One of browser, bound.freshboolean true issues a new link even if one is still active; the old link stops working
Returns
test_idstring required Id of this check, forgateway.test.egress.getexpires_attimestamp required The link stops working at this timeurlstring required Open this from the device that uses the Gateway, with the tunnel switched onqr_payloadstring required Text to show as a QR code for a phone; the same linkcommandstring Only for mode bound: a command to run on the server, which sends the request from the Gateway addressreusedboolean True when this is the link that was already active, not a new one
Refusals specific to this operation
ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.NOT_READY409 The Gateway is not active or has no IP address yet. Pollgateway.getuntil state is active.UNAVAILABLE503 This check is not available at the moment. Retry later.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/test/egress" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"mode": "browser"
}'
{
"test_id": "0123456789abcdef",
"expires_at": "2026-11-14T10:20:00.000Z",
"url": "https://check.example.com/c/EXAMPLEexampleTOKEN000",
"qr_payload": "https://check.example.com/c/EXAMPLEexampleTOKEN000"
}
Read the last reachability result for a Gateway
GET /v1/gateways/{id}/test/reachable
Operation gateway.test.reachable.get
read gateway:read
Returns the result of the most recent gateway.test.reachable.run without running a new check. Results are cleared when the key is replaced. Changes nothing.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Returns
verdictstring required pass: the device answered from the internet (a reply to ping, an open port or a refused port). fail: silence, or an answer that did not come from the device. One of pass, fail.codestring required pass: the port is open. pass_no_service: the device answered but nothing listens on that port (also the result of a ping-only pass). partial: reached from one vantage and not the other; we are alerted. device_silent: packets reached the device and nothing came back; check its firewall and tunnel address. not_arriving: packets did not reach the tunnel; our side, we are alerted. no_response: no answer. suspect_local_answer: an answer came, but not from the device; we are alerted. One of pass, pass_no_service, partial, device_silent, not_arriving, no_response, suspect_local_answer.portinteger or null required TCP port that was tried; null for a ping-only runvantagesarray of objects required Child fieldsregionstring required Where this probe ran fromicmpstring or null required Ping result; null when not measured. One of reply, timeout.tcpstring or null required TCP result on the port; null for a ping-only run. One of open, refused, timeout.
forwardedobject or null required null when tunnel traffic could not be measured Child fieldsto_deviceboolean required Traffic went through the tunnel to the device during the probefrom_deviceboolean required Traffic came back from the device during the probe
checked_attimestamp required When this check ran
Refusals specific to this operation
409409 PRECONDITION (reason: no_test): No result is stored for this Gateway. Rungateway.test.reachable.run.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/test/reachable" \
-H "Authorization: Bearer $PB_API_KEY"
{
"verdict": "pass",
"code": "pass",
"port": 443,
"vantages": [
{
"region": "a server in London",
"icmp": "reply",
"tcp": "open"
},
{
"region": "a server in Amsterdam",
"icmp": "reply",
"tcp": "open"
}
],
"forwarded": {
"to_device": true,
"from_device": true
},
"checked_at": "2026-11-14T10:06:00.000Z"
}
Check that the internet can reach the Gateway IP
POST /v1/gateways/{id}/test/reachable
Operation gateway.test.reachable.run
safe gateway:writeIdempotency-Key
Setup step 4 of 5. Probes the Gateway's own IP address from outside (ping, plus one TCP port if you give one) and returns the verdict; allow up to half a minute. The tunnel must be up at that moment (gateway.test.tunnel code up). A reply to ping, an open port or a refused port all pass; only silence fails. The target is always the Gateway IP and cannot be changed. Next: gateway.test.egress.start.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
portinteger TCP port to try as well as ping. Omit for a ping-only check. Mail and Windows file-sharing ports are refused.
Returns
verdictstring required pass: the device answered from the internet (a reply to ping, an open port or a refused port). fail: silence, or an answer that did not come from the device. One of pass, fail.codestring required pass: the port is open. pass_no_service: the device answered but nothing listens on that port (also the result of a ping-only pass). partial: reached from one vantage and not the other; we are alerted. device_silent: packets reached the device and nothing came back; check its firewall and tunnel address. not_arriving: packets did not reach the tunnel; our side, we are alerted. no_response: no answer. suspect_local_answer: an answer came, but not from the device; we are alerted. One of pass, pass_no_service, partial, device_silent, not_arriving, no_response, suspect_local_answer.portinteger or null required TCP port that was tried; null for a ping-only runvantagesarray of objects required Child fieldsregionstring required Where this probe ran fromicmpstring or null required Ping result; null when not measured. One of reply, timeout.tcpstring or null required TCP result on the port; null for a ping-only run. One of open, refused, timeout.
forwardedobject or null required null when tunnel traffic could not be measured Child fieldsto_deviceboolean required Traffic went through the tunnel to the device during the probefrom_deviceboolean required Traffic came back from the device during the probe
checked_attimestamp required When this check ran
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: port_denied): That port is never probed (mail and Windows file-sharing ports). Choose another port, or omit port for a ping-only check.ACCOUNT_RESTRICTED403 The Gateway is suspended. Readgateway.status: billing means pay the open invoice, review means open a support ticket.409409 PRECONDITION (reason: tunnel_not_up): The device is not connected right now. Switch the tunnel on, pollgateway.test.tunneluntil code is up, then run again.409409 PRECONDITION (reason: probe_target_refused): The check cannot be run for this address. Nothing in the request changes that; open a support ticket.IN_PROGRESS409 A check for this Gateway is already running. Wait a few seconds, then readgateway.test.reachable.get.NOT_READY409 The Gateway is not active yet. Pollgateway.getuntil state is active; if it is needs_support, open a support ticket.429429 RATE_LIMITED (reason: cooldown): Runs for one Gateway must be a few seconds apart. Wait for Retry-After.429429 RATE_LIMITED (reason: hourly): Too many runs for this Gateway. Wait for Retry-After.429429 RATE_LIMITED (reason: ports): Too many different ports in a short time. Wait for Retry-After, or reuse a port already checked.UPSTREAM_UNAVAILABLE502 The check could not be run from our side. This is not a verdict on the device; retry shortly.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/test/reachable" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"port": 443
}'
{
"verdict": "pass",
"code": "pass",
"port": 443,
"vantages": [
{
"region": "a server in London",
"icmp": "reply",
"tcp": "open"
},
{
"region": "a server in Amsterdam",
"icmp": "reply",
"tcp": "open"
}
],
"forwarded": {
"to_device": true,
"from_device": true
},
"checked_at": "2026-11-14T10:06:00.000Z"
}
Check whether the device has connected through the tunnel
GET /v1/gateways/{id}/test/tunnel
Operation gateway.test.tunnel
read gateway:read
Setup step 3 of 5. Returns pass, waiting or fail with a code that says why. Once the key is registered and the configuration is loaded on the device, poll this every few seconds while verdict is waiting. pass means the tunnel is up: go on to gateway.test.reachable.run. fail needs action first: no_key means register a key, never_connected or lost means check the configuration on the device and that the tunnel is switched on, suspended means read gateway.status. A pass is remembered, so a device that later goes quiet still reads as pass.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Returns
verdictstring required pass: the device has connected with the current key. waiting: not yet; poll again. fail: it will not pass without action; see code. One of pass, waiting, fail.codestring required up: connected now (pass). connected_earlier: passed before, quiet now (pass). idle: last handshake is over 3 minutes old and no pass is recorded (waiting). never_connected: no handshake with this key; waiting for the first 3 minutes after registration, then fail. no_key: register a key first (fail). lost: no handshake for over an hour (fail). suspended: the Gateway is switched off (fail). not_ready: still being set up (waiting). daemon_unreachable: the live state could not be read; our side (waiting). One of up, idle, connected_earlier, never_connected, no_key, lost, daemon_unreachable, suspended, not_ready.handshake_age_sinteger or null required Seconds since the last handshake with the current key; null when there has been nonekey_registered_attimestamp or null required When the current key was registered; null when no key is set
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/gateways/{id}/test/tunnel" \
-H "Authorization: Bearer $PB_API_KEY"
{
"verdict": "pass",
"code": "up",
"handshake_age_s": 42,
"key_registered_at": "2026-11-14T10:00:00.000Z"
}
Change the speed of a Gateway
POST /v1/gateways/{id}/tier
Operation gateway.tier.change
money gateway:writebilling:payIdempotency-Key
Requests another speed tier (25, 50, 100 or 250 Mbps). The call itself takes no payment and needs no confirm: what can be charged is bounded by the tier you name. A higher tier returns kind invoice, one unpaid invoice (invoice_id, amount_minor in USD) for the prorated price difference up to the next renewal; the new speed applies as soon as that invoice is paid, for example with invoices.credit.create, which takes its own spending cap, and nothing changes while it is unpaid. A lower tier returns kind scheduled: no invoice, the lower price is set for the next renewal and the lower speed applies when that renewal invoice is paid. Repeating the same upgrade request returns the same invoice.
Path parameters
idinteger required Your Gateway id (service_id fromgateway.list)
Body
tier25 or 50 or 100 or 250 required Speed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.
Returns
kind"invoice"invoice_idinteger Unpaid invoice for the prorated difference. The new speed applies when it is paid.amount_minorinteger Whole minor units (cents) of the currency beside itcurrencystring ISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.pay_urlstring Link in the client area where a person can pay this invoiceeffective"renewal" The lower speed applies when the next renewal invoice is paid
Refusals specific to this operation
409409 PRECONDITION (reason: same_tier): The Gateway is already on that speed.409409 PRECONDITION (reason: not_active): The Gateway is not active yet. Pollgateway.getuntil state is active.409409 PRECONDITION (reason: suspended): The Gateway is suspended. Readgateway.status: pay the open invoice (billing) or open a support ticket (review), then retry.409409 PRECONDITION (reason: tier_not_sold_here): That speed is not offered in this location. Choose another tier.409409 PRECONDITION (reason: currency_unsupported): The Gateway is not billed in USD, and speed changes are USD only. Open a support ticket to change speed.409409 PRECONDITION (reason: custom_price): The Gateway has a custom price. Open a support ticket to change speed.409409 PRECONDITION (reason: invoice_open): An unpaid invoice for this Gateway exists. Find it withinvoices.list, pay it, then retry.409409 PRECONDITION (reason: renewal_invoice_open): The renewal invoice is open, so a lower speed cannot be scheduled. Pay it, then retry.409409 PRECONDITION (reason: renewal_due): Renewal is less than a day away. Retry after the Gateway has renewed.409409 PRECONDITION (reason: upgrade_pending): A speed upgrade is already waiting for payment or being applied. Pay its invoice (invoices.list) and let it apply before asking for another change.409409 PRECONDITION (reason: downgrade_pending): A lower speed is already scheduled for the next renewal (pending_downgrade_tier ongateway.get). Wait for the renewal, or open a support ticket.409409 PRECONDITION (reason: nothing_to_prorate): The prorated difference rounds to zero. Retry after the Gateway has renewed.409409 PRECONDITION (reason: bad_expiry): The renewal date of the Gateway could not be read. Open a support ticket.409409 PRECONDITION (reason: changed): The Gateway changed while the request ran. Readgateway.getand retry.409409 PRECONDITION (reason: busy): Another change to this Gateway is in progress. Retry in a few minutes.409409 PRECONDITION (reason: invoice_failed): The invoice could not be raised and nothing was changed. Retry later.UPSTREAM_UNAVAILABLE502 The outcome is unknown. Readgateway.get(pending_downgrade_tier) andinvoices.listbefore trying again.
curl -X POST "https://api.privatebyte.com/v1/gateways/{id}/tier" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"tier": 100
}'
{
"kind": "invoice",
"invoice_id": 90117,
"amount_minor": 237,
"currency": "USD",
"pay_url": "https://portal.example.com/pay/90117"
}
Read your proxy balance, default tier and where to connect
GET /v1/proxy
Operation proxy.get
read proxy:read
Returns your prepaid proxy balance, how much traffic was metered today, your default tier and the host and ports to connect to. It never returns the credential: read that with proxy.credentials.get. The balance is one pool shared by every tier; each connection is charged at the price per gigabyte of the tier it uses.
Returns
balance_minorinteger required Prepaid proxy balance in whole cents, rounded down so it never overstates what can be spentcurrency"USD" required Proxy balance, prices and spend are always in US dollarsused_today_bytesinteger required Proxy traffic metered so far today, in bytestierstring required The account default tier, used when a connection does not name one. One of isp, ipv6, essential, standard, cleanproxy, cleanproxy_geo, sticky_clean, mobile.activeboolean required False when proxy access is switched off for this accounthost"proxy.privatebyte.com" required Hostname to connect toportsobject required TCP ports for HTTP(S) proxying and for SOCKS5 Child fieldshttp3128 requiredsocks51080 required
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy" \
-H "Authorization: Bearer $PB_API_KEY"
{
"balance_minor": 1275,
"currency": "USD",
"used_today_bytes": 48213990,
"tier": "standard",
"active": true,
"host": "proxy.privatebyte.com",
"ports": {
"http": 3128,
"socks5": 1080
}
}
Read whether your proxy accepts whitelisted addresses only
GET /v1/proxy/acl
Operation proxy.acl.get
read proxy:read
Returns whether whitelist enforcement is on. When it is on, a connection is accepted only from an address on your whitelist (proxy.whitelist.list), even with the correct credential. When it is off, the credential works from any address, and whitelisted addresses still work without it.
Returns
acl_enabledboolean required True: only whitelisted addresses may connect, even with the correct credential. False: the credential works from anywhere.
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/acl" \
-H "Authorization: Bearer $PB_API_KEY"
{
"acl_enabled": false
}
Turn whitelist-only access to your proxy on or off
POST /v1/proxy/acl
Operation proxy.acl.set
safe proxy:whitelistIdempotency-Key
Sets whether connections are accepted from whitelisted addresses only. Add your addresses with proxy.whitelist.add before turning it on: with enforcement on and an empty or wrong whitelist, every connection is refused, including ones with the correct credential. Returns the setting as stored. Turning it off again restores access at once.
Body
enabledboolean required True to accept connections from whitelisted addresses only
Returns
acl_enabledboolean required True: only whitelisted addresses may connect, even with the correct credential. False: the credential works from anywhere.
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).UPSTREAM_UNAVAILABLE502 The outcome is unknown. Readproxy.acl.getto see the stored setting before retrying.
curl -X POST "https://api.privatebyte.com/v1/proxy/acl" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"enabled": true
}'
{
"acl_enabled": true
}
Read your proxy credential
GET /v1/proxy/credentials
Operation proxy.credentials.get
read proxy:credentials
Returns the secret key that authenticates you to the proxy. Connect to the host and ports from proxy.get with the key as the username and a tier key as the password; add _country-XX to the password to exit from a country, and _session-<id> to keep the same exit address. The key spends your balance, so treat it like a password and never put it in logs or shared text. If it leaks, replace it with proxy.credentials.rotate.
Returns
api_keystring required Opaque proxy credential. A secret: do not parse, log or share it.
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/credentials" \
-H "Authorization: Bearer $PB_API_KEY"
{
"api_key": "EXAMPLE-PROXY-KEY-DO-NOT-USE"
}
List your dedicated static proxy IPs
GET /v1/proxy/isp-static
Operation proxy.isp_static.get
read proxy:read
Returns each dedicated static IP you rent: its address, country, status, the day it is paid through and the service it is billed under. A row with status setting_up has been paid for and has no address yet; it usually becomes active within minutes. An expired address is past its paid-through day and is refused. The credential for these addresses is separate from the pay-per-gigabyte proxy: read it with proxy.isp_static.credentials.get.
Returns
dataarray of objects required Child fieldsipstring or null required The dedicated address; null while it is being set upcountrystring required Country code of the address (two letters; three letters while it is being set up)renewal_datestring or null required Paid through the end of this UTC day, YYYY-MM-DD; null while it is being set upstatusstring required active: usable. expired: past its paid-through day and refused. setting_up: paid for, not usable yet. One of active, expired, setting_up.service_idinteger or null required The service this address is billed under; null when it is not linked to one
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/isp-static" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"ip": "203.0.113.25",
"country": "GB",
"renewal_date": "2026-12-01",
"status": "active",
"service_id": 4830
},
{
"ip": null,
"country": "USA",
"renewal_date": null,
"status": "setting_up",
"service_id": 4831
}
]
}
Read the credential for your dedicated static proxy IPs
GET /v1/proxy/isp-static/credentials
Operation proxy.isp_static.credentials.get
read proxy:credentials
Returns the secret key that authenticates you to your dedicated static IPs. It is a different key from the one proxy.credentials.get returns and is not changed by proxy.credentials.rotate. api_key is null when you have no dedicated IP in use yet. Treat it like a password.
Returns
api_keystring or null required Opaque credential for your dedicated static IPs. A secret: do not parse, log or share it. Null when you have no usable dedicated IP yet.
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/isp-static/credentials" \
-H "Authorization: Bearer $PB_API_KEY"
{
"api_key": "EXAMPLE-STATIC-KEY-DO-NOT-USE"
}
Replace your proxy credential with a new one
POST /v1/proxy/rotate
Operation proxy.credentials.rotate
safe proxy:credentialsIdempotency-Key
Issues a new proxy key and returns it once. The old key stops working immediately, so every client still using it fails until it is updated; your balance, whitelist and settings are kept. It can be used only once in a while: an earlier repeat answers 429 with Retry-After. Repeating the same request with the same Idempotency-Key does not rotate again and does not repeat the secret (api_key is null): read the current key with proxy.credentials.get.
Returns
api_keystring or null required The new opaque proxy credential. Null only on an idempotent replay, which never repeats the secret.notestring Present on a replay: says where to read the current credential
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).UPSTREAM_UNAVAILABLE502 The outcome is unknown: the key may or may not have changed. Readproxy.credentials.getto see which key is current before retrying.
curl -X POST "https://api.privatebyte.com/v1/proxy/rotate" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"api_key": "EXAMPLE-NEW-PROXY-KEY-DO-NOT-USE"
}
Read what you were charged for proxy traffic, per tier
GET /v1/proxy/spend-breakdown
Operation proxy.spend
read proxy:read
Returns the traffic, request count and amount charged to your proxy balance over the last 1, 7 or 30 days (default 1), in total and for each tier you used, with the published price per gigabyte of each tier. Amounts are whole cents in US dollars, rounded to the nearest cent. Use it to see which tier is consuming the balance.
Query parameters
daysstring 1, 7 or 30 days; default 1
Returns
daysinteger required Length of the period in days, ending todayfirst_data_datestring or null required Earliest day in the period that has per-tier data; null when there is nonecurrency"USD" required Proxy balance, prices and spend are always in US dollarstotalobject required Child fieldsbytesinteger required Traffic in bytesrequestsinteger required Number of proxied requestsspend_minorinteger required Amount charged to the proxy balance, in whole cents rounded to the nearest cent
per_tierarray of objects required One row per tier used in the period, highest spend first. Rows are rounded separately, so they can differ from the total by a cent. Child fieldsbytesinteger required Traffic in bytesrequestsinteger required Number of proxied requestsspend_minorinteger required Amount charged to the proxy balance, in whole cents rounded to the nearest centtierstring required Proxy tier key, as shown on the proxy pricing page and used in the proxy password. One of isp, ipv6, essential, standard, cleanproxy, cleanproxy_geo, sticky_clean, mobile.price_per_gb_minorinteger required Published price of this tier per gigabyte, in whole cents
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/spend-breakdown" \
-H "Authorization: Bearer $PB_API_KEY"
{
"days": 7,
"first_data_date": "2026-11-08",
"currency": "USD",
"total": {
"bytes": 6400000000,
"requests": 91250,
"spend_minor": 1900
},
"per_tier": [
{
"tier": "standard",
"bytes": 5200000000,
"requests": 88100,
"spend_minor": 1300,
"price_per_gb_minor": 250
},
{
"tier": "mobile",
"bytes": 1200000000,
"requests": 3150,
"spend_minor": 600,
"price_per_gb_minor": 500
}
]
}
Send a test request through your proxy
POST /v1/proxy/test
Operation proxy.test
safe proxy:credentialsIdempotency-Key
Makes a single request through your own proxy account, with the tier, country and session settings you give, to a fixed address-echo service, and reports whether it worked, the exit address the target saw, where that address is located and how long it took. You cannot choose the target. The request is real proxy traffic: it is charged to your balance at the tested tier (a few kilobytes), so your account needs a positive balance. It proves one connection only, not session lifetime or access to any particular site, and it can take up to about half a minute. A test that could not connect still answers 200 with success: false and an error.
Body
tierstring Tier key to test, for example standard or mobile. A tier that is not on sale is refused.countrystring Two-letter country code to exit from; empty for any countrysessionstring Sticky-session id (letters, digits, underscore, hyphen); empty for a rotating connectionttl_minutesinteger How long the sticky session should keep its exit address, in minutesstatestring State or region to exit from; needs country and the http protocolcitystring City to exit from; needs country and the http protocolzipstring Postal code to exit from; needs country and the http protocolasnstring Network (AS number) to exit from; needs country and the http protocolprotocolstring Which proxy protocol to test; http when omitted. One of http, socks5.
Returns
successboolean required True when the request went through your proxy and an exit address came backipstring The exit address the target sawerrorstring Plain reason when success is falsecountrystring Country name the exit address is located in; empty when unknowncountry_codestring Two-letter country code of the exit address; empty when unknowncitystring City the exit address is located in; empty when unknowncleanboolean or null Whether the exit address passed a reputation lookup at test time; null when the lookup was unavailable. Not a guarantee of access to any site.latency_msnumber required Milliseconds until the exit address came back or the attempt failedtested_tierstring required Tier key the test ran ontested_countrystring or null required Country code that was requested; null for any countrydiagnosticsobject required Child fieldsprotocolstring required One of HTTP CONNECT, SOCKS5.requestedobject required The targeting that was asked for; null where nothing was asked Child fieldscountrystring or null requiredstatestring or null requiredcitystring or null requiredzipstring or null requiredasnstring or null required
observedobject or null required Where the exit address was located; null when the location lookup was unavailable Child fieldscountrystring requiredstatestring requiredcitystring requiredzipstring required
geo_statusstring required unavailable: no location lookup. country_mismatch: located in a different country than requested. observed: located, and no mismatch with the requested country. One of unavailable, country_mismatch, observed.session_refstring or null required Short reference derived from the session id you sent, for quoting to support; null without a sessionrequested_ttl_minutesnumber or null required Sticky-session lifetime that was requested, in minutestotal_msnumber required Milliseconds for the whole test, including the location lookupnotestring required What this single test does and does not prove
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: tier_not_available): The tier is not on sale.400400 VALIDATION_FAILED (reason: unsupported_settings): The tier does not support the settings: rotating-only tiers take no session, lifetime or state/city/ZIP/ASN and are limited in country; state, city, ZIP and ASN need a country and the http protocol; the session id may hold only letters, digits, underscores and hyphens.403403 ACCOUNT_RESTRICTED (reason: no_proxy_balance): Your proxy balance is zero. Add proxy credit first.403403 ACCOUNT_RESTRICTED (reason: proxy_access_inactive): Proxy access is switched off for your account.404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).UPSTREAM_UNAVAILABLE502 The test could not be run to a result. It may still have used a little balance; do not assume it did not.
curl -X POST "https://api.privatebyte.com/v1/proxy/test" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"tier": "standard",
"country": "US",
"session": "job-42",
"ttl_minutes": 30
}'
{
"success": true,
"ip": "203.0.113.77",
"country": "United States",
"country_code": "US",
"city": "Dallas",
"clean": true,
"latency_ms": 1840,
"tested_tier": "standard",
"tested_country": "US",
"diagnostics": {
"protocol": "HTTP CONNECT",
"requested": {
"country": "US",
"state": null,
"city": null,
"zip": null,
"asn": null
},
"observed": {
"country": "US",
"state": "Texas",
"city": "Dallas",
"zip": "75201"
},
"geo_status": "observed",
"session_ref": "9f2c41d07ab3",
"requested_ttl_minutes": 30,
"total_ms": 2105,
"note": "One connection only; this does not verify session duration."
}
}
Claim the one-time free proxy credit for a new account
POST /v1/proxy/trial
Operation proxy.trial.claim
safe proxy:credentialsIdempotency-Key
Adds a small one-time free credit to your proxy balance and opens proxy access, without a payment. It is for accounts with a verified email address that have never had proxy access, and it can be claimed once. Returns the balance after the credit; next read the credential with proxy.credentials.get and the connection details with proxy.get. It spends nothing.
Returns
balance_minorinteger required Proxy balance after the free credit, in whole cents rounded downcurrency"USD" required Proxy balance, prices and spend are always in US dollars
Refusals specific to this operation
VALIDATION_FAILED400 The request did not carry a usable client address.403403 ACCOUNT_RESTRICTED (reason: email_not_verified): Verify the account email address first, then claim again.ACCOUNT_RESTRICTED403 Without a reason: the account is not eligible for the free trial.404404 NOT_FOUND (reason: trial_not_offered): The free trial is not on offer at the moment.409409 ALREADY_EXISTS (reason: trial_already_claimed): This account has already used its free trial.409409 ALREADY_EXISTS (reason: proxy_access_exists): This account already has proxy access, so the trial does not apply. Add proxy credit instead.LIMIT_REACHED409 No free trial is available to this request right now. Add proxy credit to start instead.
curl -X POST "https://api.privatebyte.com/v1/proxy/trial" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"balance_minor": 50,
"currency": "USD"
}
Read your proxy balance and the traffic metered today
GET /v1/proxy/usage
Operation proxy.usage
read proxy:read
Returns the same balance and usage figures as proxy.get, without the connection details. Use it to check the remaining balance before a large job; when the balance reaches zero, connections are refused until you add proxy credit. For what the traffic was charged call proxy.spend.
Returns
balance_minorinteger required Prepaid proxy balance in whole cents, rounded down so it never overstates what can be spentcurrency"USD" required Proxy balance, prices and spend are always in US dollarsused_today_bytesinteger required Proxy traffic metered so far today, in bytestierstring required The account default tier, used when a connection does not name one. One of isp, ipv6, essential, standard, cleanproxy, cleanproxy_geo, sticky_clean, mobile.activeboolean required False when proxy access is switched off for this account
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/usage" \
-H "Authorization: Bearer $PB_API_KEY"
{
"balance_minor": 1275,
"currency": "USD",
"used_today_bytes": 48213990,
"tier": "standard",
"active": true
}
List the addresses allowed without a password
GET /v1/proxy/whitelist
Operation proxy.whitelist.list
read proxy:whitelist
Returns the IPv4 addresses on your proxy whitelist, how many there are and the most the list can hold. Anyone connecting from a listed address uses your proxy balance with no credential at all. Review the list regularly and remove addresses you no longer control with proxy.whitelist.remove.
Returns
ipsarray of strings required Addresses that may use your proxy balance without a passwordcountinteger How many addresses are on the listmaxinteger The most addresses the list can hold
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/proxy/whitelist" \
-H "Authorization: Bearer $PB_API_KEY"
{
"ips": [
"203.0.113.10",
"203.0.113.11"
],
"count": 2,
"max": 10
}
Allow an address to use your proxy without a password
POST /v1/proxy/whitelist
Operation proxy.whitelist.add
safe proxy:whitelistIdempotency-Key
Adds one address to your proxy whitelist. This is the same as handing out your credential to that address: any connection from it is accepted with no username or password and is charged to your balance. Add only a fixed public address that you alone control, never a shared, office-wide, VPN or dynamic address. Private, loopback, link-local and reserved addresses are refused, IPv6 is not supported, and an address can be on one account's list only. Check the result with proxy.whitelist.list; to accept whitelisted addresses only, also call proxy.acl.set.
Body
ipstring required One public IPv4 address. Private, loopback, link-local, shared, multicast and reserved addresses are refused.
Returns
successtrue required
Refusals specific to this operation
VALIDATION_FAILED400 Fieldip: not an IPv4 address, or not a public one.404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).409409 LIMIT_REACHED (reason: whitelist_full): The list already holds its maximum (details.max). Remove an address first.UPSTREAM_UNAVAILABLE502 The address could not be added, for example because it is already on another account's list, or the outcome is unknown. Readproxy.whitelist.listto see whether it is there before retrying.
curl -X POST "https://api.privatebyte.com/v1/proxy/whitelist" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"ip": "203.0.113.10"
}'
{
"success": true
}
Remove one address from your proxy whitelist
DELETE /v1/proxy/whitelist
Operation proxy.whitelist.remove
safe proxy:whitelistIdempotency-Key
Removes one IPv4 address, given in the ip query parameter, from your whitelist. From then on connections from that address need your credential, and if whitelist enforcement is on (proxy.acl.get) they are refused altogether. Removing an address that is not on the list succeeds and changes nothing.
Query parameters
ipstring required One allow-listed IPv4 address to remove
Returns
successtrue required
Refusals specific to this operation
404404 NOT_FOUND (reason: no_proxy_access): Your account has no proxy access yet. It starts when you buy proxy credit or claim the free trial (proxy.trial.claim).UPSTREAM_UNAVAILABLE502 The outcome is unknown. Readproxy.whitelist.listto see the current list before retrying.
curl -X DELETE "https://api.privatebyte.com/v1/proxy/whitelist?ip={ip}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"success": true
}
Your account profile
GET /v1/account
Operation account.get
read account:read
Returns the profile of the account that owns the API key: name, email, billing address, phone, company, billing currency, and whether the email is verified and two-factor sign-in is on. It contains only details the customer entered themselves. Address fields that were never filled in are null. Use account.update to change the name, company, address or phone.
Returns
idinteger required Your account idemailstring required Sign-in and billing email. Cannot be changed through the APIfirst_namestring requiredlast_namestring requiredcompanystring or null required Company name, null when not setaddress1string or null required Billing address line 1, null when not setaddress2string or null required Billing address line 2, null when not setcitystring or null requiredstatestring or null required State, province or region, null when not setpostcodestring or null requiredphone_numberstring or null required Phone number as you entered it, null when not setcountrystring or null required ISO 3166-1 alpha-2 country code (e.g. GB), null when not setcurrencystring or null required ISO 4217 code of the currency the account is billed in (e.g. USD), null when not setemail_verifiedboolean required Whether the account email has been verified. Some operations, such as adding a contact, need it to be truetwo_factor_enabledboolean required Whether two-factor sign-in is switched on for the client area
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 9041,
"email": "[email protected]",
"first_name": "Sam",
"last_name": "Okafor",
"company": "Example Ltd",
"address1": "1 Example Street",
"address2": null,
"city": "London",
"state": null,
"postcode": "EC1A 1BB",
"phone_number": "+44 20 7946 0123",
"country": "GB",
"currency": "GBP",
"email_verified": true,
"two_factor_enabled": true
}
Change your name, company, address or phone
PATCH /v1/account
Operation account.update
safe account:write
Updates only the fields you send; send at least one. The fields that can be changed are first_name, last_name, company, address1, address2, city, state, postcode, country and phone_number. An empty string clears a field. country must be a two-letter ISO 3166-1 code and is stored in upper case; no tax number or address lookup is performed. The email, password, currency and sign-in settings cannot be changed here and any other field is refused. Returns ok once the saved profile has been read back and matches; call account.get to see the result.
Body
first_namestringlast_namestringcompanystring Company name. An empty string clears itaddress1string Address line 1address2string Address line 2. An empty string clears itcitystringstatestring State, province or regionpostcodestringcountrystring ISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper casephone_numberstring Phone number, free text up to 64 characters
Returns
oktrue required
Refusals specific to this operation
VALIDATION_FAILED400 The body is empty, a value is too long, country is not two letters, or the body names a field that cannot be changed here (such as email).fieldnames the first offending field.
curl -X PATCH "https://api.privatebyte.com/v1/account" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company": "Example Ltd",
"address1": "1 Example Street",
"city": "London",
"postcode": "EC1A 1BB",
"country": "GB"
}'
{
"ok": true
}
List the alerts that need your attention
GET /v1/account/alerts
Operation account.alerts.list
read account:read
Returns the same alert feed the customer sees in the client area, newest first, built fresh on every call. Each alert has a kind and, where it concerns one thing, that thing's id in resource_id. What to do per kind: invoice (unpaid or overdue) means read the invoice and pay it or tell the customer, because unpaid invoices lead to suspension; renewal means a service renews soon, so make sure it can be paid; ticket_reply means support staff answered, so read it with tickets.get and answer with tickets.reply or finish with tickets.close; ticket_new, ticket_pending and ticket_progress mean a ticket is waiting for staff and need no action; ticket_closed is informational; announcement and notice are messages to pass on to the customer. Invoice, renewal and ticket alerts disappear by themselves once their cause is gone; notices stay until the customer dismisses them in the client area. title and message are written for people; do not parse them.
Returns
alertsarray of objects required Newest event first. Not paginated Child fieldsidstring required Stable id of the alertkindstring required invoice: an unpaid invoice (resource_id is the invoice id). renewal: an active service renews soon (service id). ticket_reply: support staff answered a ticket and it waits for you (ticket id). ticket_new: a ticket was opened in the last 48 hours (ticket id). ticket_pending / ticket_progress: a ticket is with support staff (ticket id). ticket_closed: a ticket was closed in the last 48 hours (ticket id). announcement: a published announcement (announcement id). notice: any other account notice, such as a reverse-DNS decision or an API-key review; read the message. One of invoice, renewal, ticket_reply, ticket_new, ticket_pending, ticket_progress, ticket_closed, announcement, notice.resource_idinteger or null required Id of the invoice, service, ticket or announcement the alert is about, as described under kind. null for a noticetitlestring required Short heading, written for a personmessagestring required One-line explanation, written for a person. Do not parse it; use kind and resource_idevent_attimestamp or null required The moment the alert refers to, ISO 8601 UTC: the due date (at 00:00 UTC) for an invoice or renewal, the latest activity for a ticket, the publication time for an announcement or notice. null when unknownreadboolean required false while the alert still needs attention; true for older, informational entrieslinkstring or null required Path of the matching page in the client area (e.g. /invoices/91), null when there is none
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account/alerts" \
-H "Authorization: Bearer $PB_API_KEY"
{
"alerts": [
{
"id": "ticket-reply-1042",
"kind": "ticket_reply",
"resource_id": 1042,
"title": "Staff Reply",
"message": "Support replied to: Server 4821 unreachable after reboot",
"event_at": "2026-11-14T09:41:03.000Z",
"read": false,
"link": "/support/1042"
},
{
"id": "invoice-7731",
"kind": "invoice",
"resource_id": 7731,
"title": "Invoice Due",
"message": "Invoice #7731 is due in 3 days",
"event_at": "2026-11-17T00:00:00.000Z",
"read": false,
"link": "/invoices/7731"
},
{
"id": "renewal-4821",
"kind": "renewal",
"resource_id": 4821,
"title": "Renewal Due Soon",
"message": "web-1.example.com renews in 6 days",
"event_at": "2026-11-20T00:00:00.000Z",
"read": false,
"link": "/services/4821"
}
]
}
List the additional contacts on your account
GET /v1/account/contacts
Operation account.contacts.list
read account:read
A contact is another person or department stored on your account with its own name, email and address, for example an accounts department. Contacts cannot sign in and hold no permissions. Returns every contact in one response (no pagination); an account with none returns an empty list. Text fields that were never filled in are empty strings.
Returns
dataarray of objects required All of your contacts; the list is not paginated Child fieldsidinteger required Contact id, used in the contact URLsfirst_namestring requiredlast_namestring requiredcompanystring requiredaddress1string requiredaddress2string requiredcitystring requiredstatestring required State, province or regionpostcodestring requiredcountrystring required ISO 3166-1 alpha-2 country code, or an empty string when not setphone_numberstring requiredemailstring required Contact email address
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account/contacts" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 318,
"first_name": "Sam",
"last_name": "Okafor",
"company": "Example Ltd",
"address1": "1 Example Street",
"address2": "",
"city": "London",
"state": "",
"postcode": "EC1A 1BB",
"country": "GB",
"phone_number": "+44 20 7946 0123",
"email": "[email protected]"
}
]
}
Add a contact to your account
POST /v1/account/contacts
Operation account.contacts.create
safe account:contacts:writeIdempotency-Key
Adds a contact. first_name and email are required; last_name, company, the address fields, country (two-letter ISO 3166-1 code) and phone_number are optional. The email of your own account must already be verified (see email_verified on account.get). The contact gets no sign-in. Returns the stored contact with its id. Send an Idempotency-Key header: repeating the request with the same key returns the same contact instead of adding a second one.
Body
first_namestring requiredlast_namestringcompanystring Company name. An empty string clears itaddress1string Address line 1address2string Address line 2. An empty string clears itcitystringstatestring State, province or regionpostcodestringcountrystring ISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper casephone_numberstring Phone number, free text up to 64 charactersemailstring required Contact email address
Returns
idinteger required Contact id, used in the contact URLsfirst_namestring requiredlast_namestring requiredcompanystring requiredaddress1string requiredaddress2string requiredcitystring requiredstatestring required State, province or regionpostcodestring requiredcountrystring required ISO 3166-1 alpha-2 country code, or an empty string when not setphone_numberstring requiredemailstring required Contact email address
Refusals specific to this operation
VALIDATION_FAILED400 first_name or email is missing, email is not an email address, country is not two letters, a value is too long, or the body has an unknown field.fieldnames it.403403 ACCOUNT_RESTRICTED (reason: email_not_verified): The email address of your account is not verified yet. The customer must confirm it from the verification email (it can be resent from the client area); then retry.
curl -X POST "https://api.privatebyte.com/v1/account/contacts" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Sam",
"last_name": "Okafor",
"email": "[email protected]",
"company": "Example Ltd",
"address1": "1 Example Street",
"city": "London",
"postcode": "EC1A 1BB",
"country": "GB",
"phone_number": "+44 20 7946 0123"
}'
{
"id": 318,
"first_name": "Sam",
"last_name": "Okafor",
"company": "Example Ltd",
"address1": "1 Example Street",
"address2": "",
"city": "London",
"state": "",
"postcode": "EC1A 1BB",
"country": "GB",
"phone_number": "+44 20 7946 0123",
"email": "[email protected]"
}
Read one contact on your account
GET /v1/account/contacts/{id}
Operation account.contacts.get
read account:read
Returns one contact by the id from account.contacts.list or account.contacts.create. An id that does not exist or belongs to another account is 404.
Path parameters
idinteger required Contact id fromaccount.contacts.listoraccount.contacts.create
Returns
idinteger required Contact id, used in the contact URLsfirst_namestring requiredlast_namestring requiredcompanystring requiredaddress1string requiredaddress2string requiredcitystring requiredstatestring required State, province or regionpostcodestring requiredcountrystring required ISO 3166-1 alpha-2 country code, or an empty string when not setphone_numberstring requiredemailstring required Contact email address
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account/contacts/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 318,
"first_name": "Sam",
"last_name": "Okafor",
"company": "Example Ltd",
"address1": "1 Example Street",
"address2": "",
"city": "London",
"state": "",
"postcode": "EC1A 1BB",
"country": "GB",
"phone_number": "+44 20 7946 0123",
"email": "[email protected]"
}
Change the details of a contact on your account
PATCH /v1/account/contacts/{id}
Operation account.contacts.update
safe account:contacts:write
Updates only the fields you send; send at least one. Any field accepted by account.contacts.create can be changed, including email. An empty string clears an optional field. Returns the contact as stored after the change.
Path parameters
idinteger required Contact id fromaccount.contacts.listoraccount.contacts.create
Body
first_namestringlast_namestringcompanystring Company name. An empty string clears itaddress1string Address line 1address2string Address line 2. An empty string clears itcitystringstatestring State, province or regionpostcodestringcountrystring ISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper casephone_numberstring Phone number, free text up to 64 charactersemailstring Contact email address
Returns
idinteger required Contact id, used in the contact URLsfirst_namestring requiredlast_namestring requiredcompanystring requiredaddress1string requiredaddress2string requiredcitystring requiredstatestring required State, province or regionpostcodestring requiredcountrystring required ISO 3166-1 alpha-2 country code, or an empty string when not setphone_numberstring requiredemailstring required Contact email address
Refusals specific to this operation
VALIDATION_FAILED400 The body is empty, first_name is empty, email is not an email address, country is not two letters, a value is too long, or the body has an unknown field.fieldnames it.
curl -X PATCH "https://api.privatebyte.com/v1/account/contacts/{id}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+44 20 7946 0199",
"email": "[email protected]"
}'
{
"id": 318,
"first_name": "Sam",
"last_name": "Okafor",
"company": "Example Ltd",
"address1": "1 Example Street",
"address2": "",
"city": "London",
"state": "",
"postcode": "EC1A 1BB",
"country": "GB",
"phone_number": "+44 20 7946 0199",
"email": "[email protected]"
}
Delete a contact from your account
DELETE /v1/account/contacts/{id}
Operation account.contacts.delete
destructive account:contacts:write
Permanently removes one contact. It cannot be undone; add the contact again with account.contacts.create if it was removed by mistake. Nothing else on the account changes. Returns ok once the contact is confirmed gone; deleting an id that no longer exists is 404. Send the contact id again as ?confirm=.
Path parameters
idinteger required Contact id fromaccount.contacts.listoraccount.contacts.create
Query parameters
confirminteger required Must equal the contact id in the path ({id}).
Returns
oktrue required
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the contact id in the path.
curl -X DELETE "https://api.privatebyte.com/v1/account/contacts/{id}?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"ok": true
}
Read your Telegram link status
GET /v1/account/telegram
Operation account.telegram.get
read account:read
Says whether a Telegram account is linked to your PrivateByte account, and if so its username and when it was linked. A linked Telegram account receives billing and server notifications and can manage the account through the PrivateByte bot. If linked is false, start linking with account.telegram.link.
Returns
linkedfalseusernamestring or null Telegram username of the linked chat, null when that Telegram account has nonelinked_attimestamp When the Telegram account was linked, ISO 8601 UTC
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account/telegram" \
-H "Authorization: Bearer $PB_API_KEY"
{
"linked": true,
"username": "sam_example",
"linked_at": "2026-11-10T08:30:00.000Z"
}
Get a code to link a Telegram account
POST /v1/account/telegram
Operation account.telegram.link
destructive account:telegram:link
Creates a single-use code that links a Telegram account to yours. The customer must send the code as a message to the PrivateByte bot on Telegram within 15 minutes (expires_in is in seconds); the API cannot complete the link by itself. Each call replaces any earlier unused code, which stops working. Poll account.telegram.get until linked is true to see that the customer has done it. Linking gives that Telegram chat control of the account, so only pass the code to the account owner. This operation needs a key with the Telegram-link permission and takes no Idempotency-Key.
Returns
codestring required Single-use linking code. The customer sends it as a message to @privatebyte_bot on Telegram to complete linking. A new request replaces your earlier code.expires_in900 required Seconds until the code expires (15 minutes)
Refusals specific to this operation
409409 RESOURCE_STATE_CONFLICT (reason: telegram_already_linked): A Telegram account is already linked. Callaccount.telegram.unlinkfirst if the customer wants to link a different one.RATE_LIMITED429 Only a few linking codes can be created per hour. Wait for Retry-After (up to an hour) and reuse the code you have while it is valid.
curl -X POST "https://api.privatebyte.com/v1/account/telegram" \
-H "Authorization: Bearer $PB_API_KEY"
{
"code": "K7M2QX",
"expires_in": 900
}
Unlink your Telegram account
DELETE /v1/account/telegram
Operation account.telegram.unlink
destructive account:writeIdempotency-Key
Removes the link between your account and its Telegram account. This affects the whole account: Telegram notifications stop, the bot can no longer manage the account, the open support conversation in Telegram is closed and the notification preferences are discarded. Pass confirm=true as a query parameter. Returns linked: false; calling it when nothing is linked also returns linked: false. To link again, start over with account.telegram.link.
Query parameters
confirmstring required Must be true to unlink your Telegram account.
Returns
linkedfalseusernamestring or null Telegram username of the linked chat, null when that Telegram account has nonelinked_attimestamp When the Telegram account was linked, ISO 8601 UTC
Refusals specific to this operation
VALIDATION_FAILED400 confirm is missing or is not true (fieldis confirm). Nothing is changed.409409 RESOURCE_STATE_CONFLICT (reason: support_reply_in_delivery): A support reply is being delivered to the Telegram chat right now. Try again in a minute.
curl -X DELETE "https://api.privatebyte.com/v1/account/telegram?confirm={confirm}" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"linked": false
}
Read your linked Telegram notification preferences
GET /v1/account/telegram/preferences
Operation account.telegram.preferences.get
read account:read
Returns which notifications are sent to the linked Telegram account, one true/false switch per event: invoice_generated, invoice_due_soon, payment_received, low_balance, server_started, server_stopped, server_restarted, server_suspended, server_unsuspended, service_activated and service_terminated. Every switch is on until it is turned off. A Telegram account must be linked first.
Returns
preferencesobject required Child fieldsinvoice_generatedboolean required Send a Telegram message when a new invoice is issuedinvoice_due_soonboolean required Send a Telegram message when an unpaid invoice is close to its due datepayment_receivedboolean required Send a Telegram message when a payment is receivedlow_balanceboolean required Send a Telegram message when an account balance runs lowserver_startedboolean required Send a Telegram message when a server is powered onserver_stoppedboolean required Send a Telegram message when a server is powered offserver_restartedboolean required Send a Telegram message when a server is restartedserver_suspendedboolean required Send a Telegram message when a server is suspendedserver_unsuspendedboolean required Send a Telegram message when a suspended server is restoredservice_activatedboolean required Send a Telegram message when a new service becomes activeservice_terminatedboolean required Send a Telegram message when a service is terminated
Refusals specific to this operation
409409 RESOURCE_STATE_CONFLICT (reason: telegram_not_linked): No Telegram account is linked. Callaccount.telegram.linkand have the customer send the code to the bot first.429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/account/telegram/preferences" \
-H "Authorization: Bearer $PB_API_KEY"
{
"preferences": {
"invoice_generated": true,
"invoice_due_soon": true,
"payment_received": true,
"low_balance": true,
"server_started": false,
"server_stopped": true,
"server_restarted": true,
"server_suspended": true,
"server_unsuspended": true,
"service_activated": true,
"service_terminated": true
}
}
Change your Telegram notification settings
PUT /v1/account/telegram/preferences
Operation account.telegram.preferences.update
safe account:writeIdempotency-Key
Turns individual Telegram notifications on or off. Send only the switches you want to change inside preferences; the others keep their value. Returns the full set after the change. The same switches are shown in the client area and in the bot, so a change here appears there too. A Telegram account must be linked first.
Body
preferencesobject required Only the switches you send are changed; the others keep their value Child fieldsinvoice_generatedboolean Send a Telegram message when a new invoice is issuedinvoice_due_soonboolean Send a Telegram message when an unpaid invoice is close to its due datepayment_receivedboolean Send a Telegram message when a payment is receivedlow_balanceboolean Send a Telegram message when an account balance runs lowserver_startedboolean Send a Telegram message when a server is powered onserver_stoppedboolean Send a Telegram message when a server is powered offserver_restartedboolean Send a Telegram message when a server is restartedserver_suspendedboolean Send a Telegram message when a server is suspendedserver_unsuspendedboolean Send a Telegram message when a suspended server is restoredservice_activatedboolean Send a Telegram message when a new service becomes activeservice_terminatedboolean Send a Telegram message when a service is terminated
Returns
preferencesobject required Child fieldsinvoice_generatedboolean required Send a Telegram message when a new invoice is issuedinvoice_due_soonboolean required Send a Telegram message when an unpaid invoice is close to its due datepayment_receivedboolean required Send a Telegram message when a payment is receivedlow_balanceboolean required Send a Telegram message when an account balance runs lowserver_startedboolean required Send a Telegram message when a server is powered onserver_stoppedboolean required Send a Telegram message when a server is powered offserver_restartedboolean required Send a Telegram message when a server is restartedserver_suspendedboolean required Send a Telegram message when a server is suspendedserver_unsuspendedboolean required Send a Telegram message when a suspended server is restoredservice_activatedboolean required Send a Telegram message when a new service becomes activeservice_terminatedboolean required Send a Telegram message when a service is terminated
Refusals specific to this operation
VALIDATION_FAILED400 preferences is missing, names a switch that does not exist, or a value is not true or false.fieldnames it.409409 RESOURCE_STATE_CONFLICT (reason: telegram_not_linked): No Telegram account is linked. Callaccount.telegram.linkand have the customer send the code to the bot first.
curl -X PUT "https://api.privatebyte.com/v1/account/telegram/preferences" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"preferences": {
"server_started": false
}
}'
{
"preferences": {
"invoice_generated": true,
"invoice_due_soon": true,
"payment_received": true,
"low_balance": true,
"server_started": false,
"server_stopped": true,
"server_restarted": true,
"server_suspended": true,
"server_unsuspended": true,
"service_activated": true,
"service_terminated": true
}
}
List your support tickets
GET /v1/tickets
Operation tickets.list
read tickets:read
Lists your support tickets, newest first, without their messages. status is open (waiting for PrivateByte staff), replied (staff have answered and it is waiting for you) or closed. Use limit (1 to 100, default 20) and pass next_cursor back as cursor for the next page; next_cursor is null on the last page. Read a conversation with tickets.get.
Query parameters
limitinteger 1–100, default 20cursorstring next_cursor from the previous page; tickets are listed newest first
Returns
dataarray of objects required Newest ticket first Child fieldsidinteger required Ticket id, a whole number. The same id is returned by create and list and accepted by get, reply and closesubjectstring requiredstatusstring required open: waiting for support staff (new ticket, or your reply was the last message). replied: staff have answered and the ticket is waiting for you. closed: finished; a new reply from you reopens it. One of open, replied, closed.prioritystring required One of low, normal, high.department_idinteger required Department the ticket is filed under; names come from the departments listcreated_attimestamp required When the ticket was opened, ISO 8601 UTCupdated_attimestamp required When the ticket last changed (latest message or status change), ISO 8601 UTC
next_cursorstring or null required Pass as cursor to get the next page; null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/tickets" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 1042,
"subject": "Server 4821 unreachable after reboot",
"status": "replied",
"priority": "high",
"department_id": 2,
"created_at": "2026-11-14T09:12:44.000Z",
"updated_at": "2026-11-14T09:41:03.000Z"
},
{
"id": 1017,
"subject": "Question about my invoice",
"status": "closed",
"priority": "normal",
"department_id": 3,
"created_at": "2026-10-30T15:02:10.000Z",
"updated_at": "2026-10-31T08:20:55.000Z"
}
],
"next_cursor": null
}
Open a support ticket
POST /v1/tickets
Operation tickets.create
safe tickets:writeIdempotency-Key
Opens a support ticket; this is how to ask PrivateByte staff for help. A ticket is read and answered by people, usually within a day, not instantly. Never put passwords, API keys, private keys or other secrets in a ticket. Required: department_id (from tickets.departments), subject (up to 255 characters) and message (plain text, up to 16,000 characters). Optional: priority (low, normal or high; default normal) and service_id, the id of the service the problem is about, which must be yours. Attachments are not supported. Returns the new ticket id, and the customer gets a confirmation email. Send an Idempotency-Key header so a retry does not open a second ticket. Then poll tickets.get until status is replied.
Body
messagestring required Plain text, 1 to 16,000 characters. Read by PrivateByte support staff. Never include passwords, API keys or private keys. Attachments are not supporteddepartment_idinteger required A department id from the departments listsubjectstring required One-line summary, 1 to 255 charactersprioritystring How urgent the request is. Defaults to normal. One of low, normal, high.service_idinteger Id of the service (server, proxy plan or other product) the ticket is about. Must be one of yours. Leave out for account-wide questions
Returns
idinteger required Id of the new ticket
Refusals specific to this operation
400400 VALIDATION_FAILED (reason: department_not_found): department_id is not a department fromtickets.departments.details.department_idrepeats the value sent. List the departments and retry with a valid id.VALIDATION_FAILED400 subject or message is empty or too long, priority is not low, normal or high, or the body has an unknown field (attachments are not supported).fieldnames it.404404 NOT_FOUND (reason: service_not_found): service_id is not a service on your account.details.service_idrepeats the value sent. Leave service_id out or use an id from your services.IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used for a different ticket request. Ticket keys are remembered for good, across create, reply and close: use a new key for every new message.RATE_LIMITED429 Opening, replying to and closing tickets each have an hourly allowance per account. Wait for Retry-After; do not retry sooner.
curl -X POST "https://api.privatebyte.com/v1/tickets" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"department_id": 2,
"subject": "Server 4821 unreachable after reboot",
"message": "Server 4821 has not answered ping or SSH since I rebooted it at 09:05 UTC. The console shows it stuck at the boot loader.",
"priority": "high",
"service_id": 4821
}'
{
"id": 1042
}
Read your support ticket and client-visible replies
GET /v1/tickets/{id}
Operation tickets.get
read tickets:read
Returns one ticket with its whole conversation, oldest message first. Each message says whether it was written by you (client) or by PrivateByte staff (support). The id is the one returned by tickets.create and tickets.list; older letter-and-number ticket references from emails are not accepted. When status is replied, staff are waiting for you: answer with tickets.reply or finish with tickets.close. There is no push notification: poll this operation, or account.alerts.list, to see a staff answer.
Path parameters
idinteger required Ticket id fromtickets.listortickets.create
Returns
idinteger required Ticket id, a whole number. The same id is returned by create and list and accepted by get, reply and closesubjectstring requiredstatusstring required open: waiting for support staff (new ticket, or your reply was the last message). replied: staff have answered and the ticket is waiting for you. closed: finished; a new reply from you reopens it. One of open, replied, closed.prioritystring required One of low, normal, high.department_idinteger required Department the ticket is filed under; names come from the departments listcreated_attimestamp required When the ticket was opened, ISO 8601 UTCupdated_attimestamp required When the ticket last changed (latest message or status change), ISO 8601 UTCservice_idinteger or null required Service the ticket is about, null when it is not tied to onemessagesarray of objects required The whole conversation, oldest message first. Internal staff notes are never included Child fieldsidinteger required Message idauthorstring required client: written by you or through your API key. support: written by PrivateByte staff. One of client, support.messagestring requiredcreated_attimestamp required When the message was posted, ISO 8601 UTC
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/tickets/{id}" \
-H "Authorization: Bearer $PB_API_KEY"
{
"id": 1042,
"subject": "Server 4821 unreachable after reboot",
"status": "replied",
"priority": "high",
"department_id": 2,
"created_at": "2026-11-14T09:12:44.000Z",
"updated_at": "2026-11-14T09:41:03.000Z",
"service_id": 4821,
"messages": [
{
"id": 5120,
"author": "client",
"message": "Server 4821 has not answered ping or SSH since I rebooted it at 09:05 UTC. The console shows it stuck at the boot loader.",
"created_at": "2026-11-14T09:12:44.000Z"
},
{
"id": 5123,
"author": "support",
"message": "Thanks for the details. The boot order was reset by the reboot; we have corrected it and the server is starting now. Please confirm it is reachable.",
"created_at": "2026-11-14T09:41:03.000Z"
}
]
}
Close your support ticket
POST /v1/tickets/{id}/close
Operation tickets.close
safe tickets:writeIdempotency-Key
Marks one of your tickets as closed, telling staff no further answer is needed. No message is added and nothing is deleted: the conversation stays readable with tickets.get, and a later tickets.reply reopens it. Closing a ticket that is already closed succeeds and changes nothing. Takes no body; send an Idempotency-Key header.
Path parameters
idinteger required Ticket id fromtickets.listortickets.create
Returns
oktrue required
Refusals specific to this operation
IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used for a different ticket request. Ticket keys are remembered for good, across create, reply and close: use a new key for every new message.RATE_LIMITED429 Opening, replying to and closing tickets each have an hourly allowance per account. Wait for Retry-After; do not retry sooner.
curl -X POST "https://api.privatebyte.com/v1/tickets/{id}/close" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"ok": true
}
Reply to your support ticket
POST /v1/tickets/{id}/replies
Operation tickets.reply
safe tickets:writeIdempotency-Key
Adds a message from you to one of your tickets. It is read by PrivateByte staff, so never include passwords, API keys or private keys. The message is plain text, up to 16,000 characters; attachments are not supported. A reply sets the ticket to open (waiting for staff), and replying to a closed ticket reopens it. Returns the ticket id and the id of the new message. Send an Idempotency-Key header so a retry does not post the message twice. Then poll tickets.get until status is replied.
Path parameters
idinteger required Ticket id fromtickets.listortickets.create
Body
messagestring required Plain text, 1 to 16,000 characters. Read by PrivateByte support staff. Never include passwords, API keys or private keys. Attachments are not supported
Returns
idinteger required Ticket idmessage_idinteger required Id of the message that was added
Refusals specific to this operation
VALIDATION_FAILED400 message is empty or longer than 16,000 characters, or the body has an unknown field.fieldnames it. Shorten the message or split it into several replies.IDEMPOTENCY_CONFLICT409 This Idempotency-Key was already used for a different ticket request. Ticket keys are remembered for good, across create, reply and close: use a new key for every new message.RATE_LIMITED429 Opening, replying to and closing tickets each have an hourly allowance per account. Wait for Retry-After; do not retry sooner.
curl -X POST "https://api.privatebyte.com/v1/tickets/{id}/replies" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"message": "Confirmed, the server is reachable again. Thank you."
}'
{
"id": 1042,
"message_id": 5127
}
List support departments
GET /v1/tickets/departments
Operation tickets.departments
read tickets:read
Lists the support departments a ticket can be filed under. Call this before tickets.create and pass the id of the department whose name fits the request (for example technical problems, billing questions or abuse reports) as department_id. The list changes rarely, but always take the id from this response and do not guess it.
Returns
dataarray of objects required Child fieldsidinteger required Use as department_id when opening a ticketnamestring required Department name, which says what it handles
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/tickets/departments" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": 1,
"name": "General Enquiries"
},
{
"id": 2,
"name": "Technical Support"
},
{
"id": 3,
"name": "Payments/Billing"
}
]
}
Rewards
Your points balance and history. Redeem points for wallet credit.
3 operations
Endpoints
Read your rewards points balance and tier
GET /v1/rewards
Operation rewards.get
read rewards:read
Returns the points you can redeem now, the totals earned and redeemed, and your tier with its earning multiplier and progress to the next tier. Points are earned on purchases and referrals. Redeem them for wallet credit with rewards.redeem.
Returns
balance_pointsinteger required Points you can redeem nowpending_points0 required Always 0: points are credited at oncetotal_earned_pointsinteger required Points earned over the life of the account; this decides your tiertotal_redeemed_pointsinteger requiredtierobject required Child fieldsidstring requirednamestring requiredmin_pointsinteger requiredmax_pointsinteger or null requiredearning_multipliernumber required Points earned on purchases are multiplied by this in your tierperksarray of strings required
tier_progressnumber required Percent of the way from your tier to the next, 0 to 100next_tier_pointsinteger or null required Total earned points at which the next tier starts. Null in the top tierupdated_attimestamp required When your rewards last changed, ISO 8601 UTC
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/rewards" \
-H "Authorization: Bearer $PB_API_KEY"
{
"balance_points": 1240,
"pending_points": 0,
"total_earned_points": 2240,
"total_redeemed_points": 1000,
"tier": {
"id": "silver",
"name": "Silver",
"min_points": 1000,
"max_points": 4999,
"earning_multiplier": 1.25,
"perks": [
"Priority support"
]
},
"tier_progress": 31,
"next_tier_points": 5000,
"updated_at": "2026-11-12T08:30:00.000Z"
}
List your rewards points transactions, newest first
GET /v1/rewards/history
Operation rewards.history
read rewards:read
Returns the points you earned and redeemed, each with the balance after it. Filter with type and page with cursor. This is the points history only: wallet credit from a redemption appears in billing.transactions.list.
Query parameters
limitinteger 1–100 retained transactions, default 20cursorstring next_cursor from the previous page; bound to this account and transaction typetypestring Filter by exact reward transaction type
Returns
dataarray of objects required Your points transactions, newest first. This is the points history, not the wallet ledger. Child fieldsidstring requiredtypestring required One of purchase, first_purchase, monthly_loyalty, referral_reward, referral_bonus, milestone, redemption, manual, expiration.amount_pointsinteger required Points added (positive) or taken (negative) by this transactionbalance_pointsinteger required Points balance after this transactiondescriptionstring requiredcreated_attimestamp required When the transaction happened, ISO 8601 UTC
next_cursorstring or null required Pass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/rewards/history" \
-H "Authorization: Bearer $PB_API_KEY"
{
"data": [
{
"id": "pt_20261112_a1",
"type": "redemption",
"amount_points": -1000,
"balance_points": 1240,
"description": "Redeemed for wallet credit",
"created_at": "2026-11-12T08:30:00.000Z"
},
{
"id": "pt_20261101_9f",
"type": "purchase",
"amount_points": 12,
"balance_points": 2240,
"description": "Points for a purchase",
"created_at": "2026-11-01T12:00:00.000Z"
}
],
"next_cursor": null
}
Turn rewards points into wallet credit
POST /v1/rewards/redeem
Operation rewards.redeem
money rewards:redeemIdempotency-Key
Takes exactly the number of points you name from your balance and adds wallet credit for them: 100 points are 1.00 in your account currency (USD, EUR or GBP), and the minimum is 100 points. The points amount in the request is your consent; nothing more is taken. The credit is added at once to your wallet in your account currency, and the response names that currency. A redemption cannot be undone. Read rewards.get first for the balance.
Body
pointsinteger required Exactly how many points to redeem, at least 100. 100 points become 1.00 of wallet credit in your account currency
Returns
redeemed_pointsinteger required Points taken from your balancecredit_minorinteger required Wallet credit added, in whole minor units (cents) of currencycurrencystring required Your account currency: the credit is added to your wallet in it. One of USD, EUR, GBP.balance_pointsinteger required Your points balance after the redemption
Refusals specific to this operation
409409 RESOURCE_STATE_CONFLICT (reason: insufficient_points): The balance is lower than the points asked for. Nothing was taken. Readrewards.getand ask for less.IN_PROGRESS409 Another redemption for this account is being applied. Wait for Retry-After and send the same request again.UPSTREAM_UNAVAILABLE502 The redemption may or may not have happened. Retry with the same Idempotency-Key (it cannot redeem twice), or readrewards.history.
curl -X POST "https://api.privatebyte.com/v1/rewards/redeem" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"points": 1000
}'
{
"redeemed_points": 1000,
"credit_minor": 1000,
"currency": "USD",
"balance_points": 1240
}
Referrals
Your referral code and what it has earned.
2 operations
Endpoints
Read your referral code and what it has earned
GET /v1/referrals
Operation referrals.get
read rewards:read
Returns your referral code if one has been issued, the number of people who signed up with it, and the points you and the person you refer each receive. code is null until you call referrals.issue; this read never creates one.
Returns
codestring or null required Existing issued referral code, or null when none has been issued. This read never generates a code.referral_countinteger required How many people have signed up with your codereward_points_per_referralinteger required Points you earn for each person you referreferred_user_bonus_pointsinteger required Points the person you refer receives
Refusals specific to this operation
429429 Read allowance exceeded. Wait for Retry-After before sending more requests.
curl "https://api.privatebyte.com/v1/referrals" \
-H "Authorization: Bearer $PB_API_KEY"
{
"code": "EXAMPLE-7K2M",
"referral_count": 3,
"reward_points_per_referral": 200,
"referred_user_bonus_points": 200
}
Get your referral code, creating it the first time
POST /v1/referrals
Operation referrals.issue
safe account:writeIdempotency-Key
Returns your referral code. The first call creates it; later calls return the same code and never replace it. Share the code: you earn points for each person who signs up with it (see referrals.get).
Returns
codestring required Your referral code. Share it with people you refer
Refusals specific to this operation
IN_PROGRESS409 Another referral code is being issued. Wait for Retry-After and call again.
curl -X POST "https://api.privatebyte.com/v1/referrals" \
-H "Authorization: Bearer $PB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"
{
"code": "EXAMPLE-7K2M"
}