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 specVersion 1.0.0134 operations
https://api.privatebyte.comAuthentication
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.
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_productsreadsList what can be ordered, with monthly price and whether it is in stock.
get_productreadsRead one product: its prices per billing cycle and the operating systems and extras it can be ordered with.
create_serverchangesOrder a new server AND pay for it from the account wallet.
order_productchangesOrder something that is not a server (a Gateway, a static proxy address, proxy credit) AND pay for it from the account wallet.
list_serversreadsList the servers on the account with their id, name, plan, IP address and billing status..
get_serverreadsRead one server: power state, addresses, size, operating system and current resource use..
server_powerchangesStart, stop or restart a server.
get_operationreadsFollow work started by another tool (power, backup, reinstall).
create_snapshotchangesTake a snapshot of a server's disk as it is now, to roll back to later.
create_backupchangesStart a full backup of a server.
list_snapshotsreadsList a server's snapshots with id, name, status and size.
restore_snapshotasks firstROLLS THE SERVER'S DISK BACK to a snapshot.
delete_snapshotasks firstDelete one snapshot for good; it cannot be restored afterwards.
list_backupsreadsList a server's backups with id, status, type (manual or auto), size and time.
restore_backupasks firstOVERWRITES THE SERVER'S WHOLE DISK with a backup.
delete_backupasks firstDelete one backup for good; it cannot be restored afterwards.
firewallasks firstA server's firewall.
server_usagereadsA server's resource use: CPU, memory, disk and network now, plus up to 24 past samples over range (1h, 6h, 24h or 7d).
ticketschangesFollow up on support tickets.
set_rdnschangesRequest 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_serverchangesChange a server's hostname (the name the machine calls itself), its display name in the account, or both.
scheduleschangesA server's automatic backup and power schedules.
isoasks firstBoot a server from an ISO image, for a custom install or a rescue disk.
top_upchangesAdd 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 firstLet SSH keys log in to a server as its administrator (root).
reinstall_serverasks firstERASES THE WHOLE DISK of a server and installs a fresh operating system.
reset_server_passwordasks firstSet a new administrator (root) password on a server and return it ONCE.
open_consoleasks firstGet a short-lived console (VNC over WebSocket) connection to a server.
cancel_serviceasks firstCancel a service (a server's id is also its service id).
get_balancereadsRead the account wallet balance, in whole minor units with its currency.
list_invoicesreadsList recent invoices with their total and status.
pay_invoicechangesPay one unpaid invoice from the account wallet.
proxy_statusreadsRead the proxy balance, today's traffic, the default tier and where to connect.
proxy_spendreadsRead the proxy traffic, request count and amount charged over the last 1, 7 or 30 days, in total and for each tier used..
list_static_proxy_ipsreadsList the dedicated static proxy IPs on the account: address, country, status and the day each is paid through.
list_proxy_whitelistreadsList the IPv4 addresses allowed to use the proxy without a username and password, how many there are and the most the list can hold.
add_proxy_whitelist_ipasks firstAdd one public IPv4 address to the proxy whitelist.
remove_proxy_whitelist_ipasks firstRemove one IPv4 address from the proxy whitelist.
get_proxy_whitelist_onlyreadsRead whether the proxy accepts connections from whitelisted addresses only..
set_proxy_whitelist_onlyasks firstSet whether the proxy accepts connections from whitelisted addresses only.
test_proxyasks firstSend one request through the account's proxy to a fixed address-echo service and report whether it worked, the exit address, its location and how long it took.
open_ticketchangesOpen a support ticket read by PrivateByte staff.
find_operationreadsSearch every operation of the PrivateByte API by words (for example "firewall rule", "reverse dns", "gateway key", "proxy whitelist").
call_operationasks firstRun 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 2026First release. 134 operations across servers, ssh keys, orders, catalog, services, billing, invoices, gateways, proxies, account, support tickets, rewards, referrals.
Servers
Power, reinstall, console, backups, snapshots, firewall, addresses and schedules for your servers. Work that takes time answers 202 with an operation you poll until it finishes.
47 operations
- GET
/v1/vms - GET
/v1/vms/{id} - GET
/v1/vms/{id}/activity - GET
/v1/vms/{id}/backup-schedule - POST
/v1/vms/{id}/backup-schedule - GET
/v1/vms/{id}/backups - POST
/v1/vms/{id}/backups - DELETE
/v1/vms/{id}/backups/{backup_id} - POST
/v1/vms/{id}/backups/{backup_id}/restore - POST
/v1/vms/{id}/boot-mode - POST
/v1/vms/{id}/console - GET
/v1/vms/{id}/firewall - POST
/v1/vms/{id}/firewall - POST
/v1/vms/{id}/firewall/{rule_id}/delete - POST
/v1/vms/{id}/firewall/{rule_id}/move - POST
/v1/vms/{id}/firewall/reset - POST
/v1/vms/{id}/force-stop - POST
/v1/vms/{id}/hostname - GET
/v1/vms/{id}/ips - PUT
/v1/vms/{id}/ips/{ip}/rdns - DELETE
/v1/vms/{id}/ips/{ip}/rdns - POST
/v1/vms/{id}/iso - GET
/v1/vms/{id}/iso-images - POST
/v1/vms/{id}/iso/unmount - GET
/v1/vms/{id}/metrics/history - POST
/v1/vms/{id}/name - GET
/v1/vms/{id}/operations/{op_id} - GET
/v1/vms/{id}/os-images - POST
/v1/vms/{id}/password-reset - POST
/v1/vms/{id}/ping - GET
/v1/vms/{id}/power-schedule - PUT
/v1/vms/{id}/power-schedule - DELETE
/v1/vms/{id}/power-schedule - POST
/v1/vms/{id}/reinstall - POST
/v1/vms/{id}/restart - GET
/v1/vms/{id}/snapshots - POST
/v1/vms/{id}/snapshots - DELETE
/v1/vms/{id}/snapshots/{snapshot_id} - POST
/v1/vms/{id}/snapshots/{snapshot_id}/restore - POST
/v1/vms/{id}/ssh-keys - POST
/v1/vms/{id}/start - POST
/v1/vms/{id}/stop - GET
/v1/vms/{id}/tasks - GET
/v1/vms/{id}/tasks/{task_ref} - POST
/v1/vms/{id}/tasks/{task_ref}/cancel - POST
/v1/vms/{id}/tasks/{task_ref}/retry - GET
/v1/vms/{id}/usage
List your servers
GET/v1/vms
Operation vm.list
readvm: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
limitinteger1–100, default 20
cursorstringnext_cursor from the previous page
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredServer id. Use it as {id} in every /v1/vms/{id} path and as
confirmwhere an operation asks for the server idnamestringrequiredHostname or display name of the server
planstringrequiredName of the plan the server is on
statusstringrequiredBilling 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 nullrequiredPrimary IP address, null when none is recorded yet
next_due_datestring or nullrequiredDate the next renewal is due (YYYY-MM-DD), null when unknown
next_cursorstring or nullrequiredPass as
cursorto get the next page; null on the last page
Refusals specific to this operation
429429Read 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
idintegerrequiredServer id. Use it as {id} in every /v1/vms/{id} path and as
confirmwhere an operation asks for the server idnamestringrequiredHostname or display name of the server
planstringrequiredName of the plan the server is on
statusstringrequiredBilling 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 nullrequiredPrimary IP address, null when none is recorded yet
next_due_datestring or nullrequiredDate the next renewal is due (YYYY-MM-DD), null when unknown
power_statestringrequiredLive 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 nullrequiredVirtual CPU cores, null when the live state is unknown
memory_mbinteger or nullrequiredMemory in MB, null when the live state is unknown
disk_gbnumber or nullrequiredPrimary disk size in GB, null when the live state is unknown
osstring or nullrequiredInstalled operating system, null when unknown
locationstring or nullrequiredData centre location, null when unknown
ipsarray of stringsrequiredEvery IPv4 and IPv6 address on the server
ipv6_allocationsarray of objectsrequiredIPv6 addresses with the subnet and gateway needed to configure them inside the server; empty when the server has none
Child fields
addressstringrequiredsubnetstringgatewaystring
usernamestring or nullrequiredLogin name of the administrator account inside the server (for example root), null when unknown
cpu_usage_percentnumber or nullrequiredmemory_usage_percentnumber or nullrequiredmemory_used_mbnumber or nullrequireddisk_usage_percentnumber or nullrequireddisk_used_gbnumber or nullrequiredbandwidthobject or nullrequiredNetwork transfer counters in GB, null when the live state is unknown
Child fields
used_gbnumber or nullrequiredtotal_gbnumber or nullrequiredinbound_gbnumber or nullrequiredoutbound_gbnumber or nullrequired
extra_disksarray of objects or nullrequiredAdditional disks seen from inside a running server; null when the server is not running or the figures cannot be read
Child fields
devicestringrequiredtotal_gbnumberrequiredused_gbnumber or nullrequired
uptime_secondsnumber or nullrequiredSeconds since the server last booted, null when not running or unknown
Refusals specific to this operation
429429Read 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredNewest first
Child fields
actionstringrequiredWhat 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.statusstringrequiredpending means still running. One of success, failed, pending.
occurred_attimestamprequiredWhen it finished, or when it started if it is still running
Refusals specific to this operation
429429Read 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
enabledbooleanrequiredWhether scheduled backups run.
scheduleobject or nullrequiredNull when no schedule has been set.
Child fields
typestringrequiredOne of daily, weekly, monthly.
timeobjectrequiredChild fields
hourintegerrequiredminutesintegerrequired
daysarray of integersrequired
limitinteger or nullrequiredHow many scheduled backups are kept: 3, 5, 7, 14 or 30. Null when not set.
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.list
Body
enabledbooleanrequiredscheduleobject or nullrequiredChild fields
typestringrequiredOne of daily, weekly, monthly.
timeobjectrequiredChild fields
hourintegerrequiredminutesintegerrequired
daysarray of integersrequired
limit3 or 5 or 7 or 14 or 30
Returns
enabledbooleanrequiredWhether scheduled backups run.
scheduleobject or nullrequiredNull when no schedule has been set.
Child fields
typestringrequiredOne of daily, weekly, monthly.
timeobjectrequiredChild fields
hourintegerrequiredminutesintegerrequired
daysarray of integersrequired
limitinteger or nullrequiredHow many scheduled backups are kept: 3, 5, 7, 14 or 30. Null when not set.
Refusals specific to this operation
VALIDATION_FAILED400The 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
UPSTREAM_UNAVAILABLE502The 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 with
vm.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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredBackup id. Use it as {backup_id} and as
confirmwhen restoring or deleting this backupstatusstringrequiredcreated: finished and usable. pending or creating: still being taken. restoring: being restored onto the server right now. One of pending, creating, created, failed, restoring.
typestringrequiredmanual: started by you. auto: taken by the backup schedule. One of manual, auto.
size_bytesintegerrequiredSize in bytes; 0 until the backup has finished
created_attimestamp or nullrequiredWhen the backup was taken, null when not recorded
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.list
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403Your account is restricted. Nothing was started. A suspended server alone does not cause this refusal.
MAINTENANCE423We 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
destructivevm: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
idintegerrequiredServer id from
vm.listbackup_idintegerrequiredBackup id from the backups list
Query parameters
confirmintegerrequiredMust equal the backup id in the path ({backup_id}).
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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_RESTRICTED403The 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_FOUND404The backup is not one of this server's backups, or is already deleted.
MAINTENANCE423We 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
destructivevm: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
idintegerrequiredServer id from
vm.listbackup_idintegerrequiredBackup id from the backups list
Body
confirmintegerrequiredMust equal the backup id in the path ({backup_id}), as an integer
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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_RESTRICTED403The 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_FOUND404The backup is not one of this server's backups. Nothing was changed. Read
vm.backups.list.MAINTENANCE423We 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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
boot_modestringrequireddisk boots the installed operating system. rescue boots a temporary recovery system used to repair the disk or recover files. One of disk, rescue.
confirmintegerrequiredMust equal the server id in the URL.
Returns
boot_modestringrequireddisk boots the installed operating system. rescue boots a temporary recovery system used to repair the disk or recover files. One of disk, rescue.
restart_requiredtruerequiredAlways 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
409409IN_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_UNAVAILABLE502The 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 with
vm.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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
confirmintegerrequiredMust equal the server id in the path ({id}), as an integer
Returns
access_tokenstringrequiredSingle-purpose credential for this console connection. Treat it as a secret: whoever holds it controls the server until it expires
expires_attimestamprequiredThe connection must be opened before this time (about five minutes after the request). Ask for a new one afterwards
websocket_urlstringrequiredWebSocket 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
enabledbooleanrequiredFalse when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.
versionintegerrequiredGoes up by one with every change to the rules.
rulesarray of objectsrequiredIn the order they are checked: the first matching rule decides, and traffic no rule matches is allowed.
Child fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringrequiredDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringrequiredIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringrequiredYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
idintegerrequiredRule id, used to remove or move the rule. Ids are not reused.
Refusals specific to this operation
429429Read 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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
ruleobjectrequiredChild fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
confirmintegerrequiredMust equal the server id in the URL.
Returns
enabledbooleanrequiredFalse when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.
versionintegerrequiredGoes up by one with every change to the rules.
rulesarray of objectsrequiredIn the order they are checked: the first matching rule decides, and traffic no rule matches is allowed.
Child fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringrequiredDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringrequiredIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringrequiredYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
idintegerrequiredRule 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.400400VALIDATION_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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
409409LIMIT_REACHED (reason: firewall_rule_limit): The server already has the most rules it can have (details.max_rules). Remove one with
vm.firewall.removefirst.UPSTREAM_UNAVAILABLE502The 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 with
vm.firewall.list, and send the change again with a new key only if it did not apply.503503UNAVAILABLE (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
destructivevm: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
idintegerrequiredServer id from
vm.listrule_idintegerrequiredFirewall rule id from
vm.firewall.list
Body
confirmintegerrequiredMust equal the rule id in the URL.
Returns
enabledbooleanrequiredFalse when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.
versionintegerrequiredGoes up by one with every change to the rules.
rulesarray of objectsrequiredIn the order they are checked: the first matching rule decides, and traffic no rule matches is allowed.
Child fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringrequiredDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringrequiredIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringrequiredYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
idintegerrequiredRule 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: firewall_rule_not_found): The server has no rule with this id. Read the rule ids with
vm.firewall.list.UPSTREAM_UNAVAILABLE502The 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 with
vm.firewall.list, and send the change again with a new key only if it did not apply.503503UNAVAILABLE (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
destructivevm: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
idintegerrequiredServer id from
vm.listrule_idintegerrequiredFirewall rule id from
vm.firewall.list
Body
directionstringrequiredup moves the rule one place earlier (checked sooner); down one place later. One of up, down.
confirmintegerrequiredMust equal the rule id in the URL.
Returns
enabledbooleanrequiredFalse when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.
versionintegerrequiredGoes up by one with every change to the rules.
rulesarray of objectsrequiredIn the order they are checked: the first matching rule decides, and traffic no rule matches is allowed.
Child fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringrequiredDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringrequiredIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringrequiredYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
idintegerrequiredRule 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.400400VALIDATION_FAILED (reason: rule_already_first): The rule is already at the top, so it cannot move up.
400400VALIDATION_FAILED (reason: rule_already_last): The rule is already at the bottom, so it cannot move down.
ACCOUNT_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: firewall_rule_not_found): The server has no rule with this id. Read the rule ids with
vm.firewall.list.UPSTREAM_UNAVAILABLE502The 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 with
vm.firewall.list, and send the change again with a new key only if it did not apply.503503UNAVAILABLE (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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
confirmintegerrequiredMust equal the server id in the URL.
Returns
enabledbooleanrequiredFalse when firewall changes are switched off for this server: rules already in force keep working, but add, remove, move and reset are refused.
versionintegerrequiredGoes up by one with every change to the rules.
rulesarray of objectsrequiredIn the order they are checked: the first matching rule decides, and traffic no rule matches is allowed.
Child fields
directionstringrequiredin: traffic arriving at the server. out: traffic leaving it. One of in, out.
protocolstringrequiredany covers TCP and UDP, and ping as well when no port is given. One of tcp, udp, icmp, any.
portstringrequiredDestination port: empty for every port, one port ("443") or a range ("8000-9000"). Must be empty for icmp.
ipstringrequiredIPv4 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.
actionstringrequiredaccept lets matching traffic through. drop discards it without a reply. One of accept, drop.
commentstringrequiredYour own note, up to 80 characters: letters, digits, spaces and . _ : / @ ( ) + , -
idintegerrequiredRule 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
UPSTREAM_UNAVAILABLE502The 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 with
vm.firewall.list, and send the change again with a new key only if it did not apply.503503UNAVAILABLE (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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
confirmintegerrequiredMust equal the server id in the path ({id}), as an integer
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
safevm: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
idintegerrequiredServer id from
vm.list
Body
hostnamestringrequiredA host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Returns
hostnamestringrequiredA 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
UPSTREAM_UNAVAILABLE502The 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 with
vm.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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredChild fields
ipstringrequiredThe address
version4 or 6required4 for IPv4, 6 for IPv6
subnetstringIPv6 only: the subnet this address belongs to, needed to configure the address on the server
gatewaystringIPv6 only: the gateway for that subnet
rdnsobjectrequiredChild fields
hostnamestring or nullrequiredThe PTR host name requested or in force; null when status is none
statusstringrequirednone: 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 nullrequiredWhen the request last changed (made, reviewed or withdrawn); null when there has never been one
created_attimestamp or nullrequiredWhen the request was made or withdrawn by you; null when there has never been one
review_notestring or nullrequiredThe reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.listipstringrequiredOne of this server's own IPv4 or IPv6 addresses, from
vm.ips.list
Body
hostnamestringrequiredFully 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
ipobjectrequiredChild fields
ipstringrequiredThe address
version4 or 6required4 for IPv4, 6 for IPv6
rdnsobjectrequiredChild fields
hostnamestring or nullrequiredThe PTR host name requested or in force; null when status is none
statusstringrequirednone: 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 nullrequiredWhen the request last changed (made, reviewed or withdrawn); null when there has never been one
created_attimestamp or nullrequiredWhen the request was made or withdrawn by you; null when there has never been one
review_notestring or nullrequiredThe reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
VALIDATION_FAILED400The host name is not a fully qualified name such as mail.example.com (field: hostname).
ACCOUNT_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: ip_not_on_server): The address is not one of this server's own addresses. Read them with
vm.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
safevm: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
idintegerrequiredServer id from
vm.listipstringrequiredOne of this server's own IPv4 or IPv6 addresses, from
vm.ips.list
Returns
ipobjectrequiredChild fields
ipstringrequiredThe address
version4 or 6required4 for IPv4, 6 for IPv6
rdnsobjectrequiredChild fields
hostnamestring or nullrequiredThe PTR host name requested or in force; null when status is none
statusstringrequirednone: 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 nullrequiredWhen the request last changed (made, reviewed or withdrawn); null when there has never been one
created_attimestamp or nullrequiredWhen the request was made or withdrawn by you; null when there has never been one
review_notestring or nullrequiredThe reviewer's note to you, for example why a request was rejected; null when there is none
Refusals specific to this operation
ACCOUNT_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: ip_not_on_server): The address is not one of this server's own addresses. Read them with
vm.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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
iso_image_idintegerrequiredAn image id from the ISO image list of this server.
confirmintegerrequiredMust equal the server id in the URL.
Returns
mountedstring or nullrequiredName of the mounted image, or null when none is mounted.
restart_requiredtruerequiredAlways 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.400400VALIDATION_FAILED (reason: iso_already_mounted): An image is already mounted. Remove it with
vm.iso.unmountfirst.400400VALIDATION_FAILED (reason: boot_mode_is_rescue): The server is set to boot the rescue system. Set it back with
vm.boot_mode.set(disk) first.ACCOUNT_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: iso_image_not_found): The image id is not one of this server's images. Read the ids with
vm.iso.list.409409IN_PROGRESS (reason: server_not_stopped): The server is not stopped. Stop it with
vm.stop, wait untilvm.getshows power_state stopped, then send the request again.409409IN_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_UNAVAILABLE502The 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 with
vm.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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
imagesarray of objectsrequiredISO images this server can boot from.
Child fields
idintegerrequirednamestringrequiredsize_mbnumberrequiredImage size in megabytes.
mountedstring or nullrequiredName of the image the server is set to boot from, or null when none is mounted.
Refusals specific to this operation
429429Read 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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
confirmintegerrequiredMust equal the server id in the URL.
Returns
mountedstring or nullrequiredName of the mounted image, or null when none is mounted.
restart_requiredtruerequiredAlways 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.400400VALIDATION_FAILED (reason: boot_mode_is_rescue): The server is set to boot the rescue system, not an image. Use
vm.boot_mode.set(disk) instead.ACCOUNT_RESTRICTED403The server is suspended, or the account is restricted from making changes.
409409IN_PROGRESS (reason: server_not_stopped): The server is not stopped. Stop it with
vm.stop, wait untilvm.getshows power_state stopped, then send the request again.409409IN_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_UNAVAILABLE502The 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 with
vm.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
readvm: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
idintegerrequiredServer id from
vm.list
Query parameters
rangestringHistory period; defaults to 1h.
Returns
historyarray of objectsrequiredOldest first. A gap means no sample was collected, not zero usage.
Child fields
sampled_attimestamprequiredWhen the sample was taken.
cpu_usage_percentnumber or nullrequiredCPU in use, 0 to 100, averaged across the server's vCPUs. Null when it could not be measured.
memory_usage_percentnumber or nullrequiredMemory in use, 0 to 100. Null when it could not be measured.
disk_usage_percentnumber or nullrequiredSpace used on the main disk, 0 to 100. Null when it could not be measured.
disk_read_kb_per_secnumber or nullrequiredDisk 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 nullrequiredDisk 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 nullrequiredTraffic 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 nullrequiredTraffic 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 nullrequiredTraffic counted so far, in gigabytes: a running total, not a rate. Null on samples that do not carry it.
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.list
Body
namestringrequiredA host name of 1 to 253 characters: letters, digits and hyphens in dot-separated labels, e.g. web-1.example.com.
Returns
namestringrequiredA 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
UPSTREAM_UNAVAILABLE502The 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 with
vm.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
readvm: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
idintegerrequiredServer id from
vm.listop_idstringrequiredOperation id from a 202 response
Returns
operationobjectrequiredChild fields
idstringrequiredThe operation id you asked about
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
statusstringrequiredpending: 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 nullrequiredPercent complete, 0 to 100; null when no progress figure is available
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen the operation was accepted
updated_attimestamp or nullrequiredWhen the status last changed, null when not known
Refusals specific to this operation
NOT_FOUND404The operation id is older than 24 hours, was started on a different server, or is not yours.
429429Read 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredImage id. Pass it as
os_image_idto POST /v1/vms/{id}/reinstallnamestringrequiredFamily and version together, e.g. Ubuntu 24.04
familystringrequiredversionstringrequired
Refusals specific to this operation
429429Read 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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
confirmintegerrequiredMust equal the server id in the path ({id}), as an integer
Returns
passwordstring or nullrequiredThe 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-Key
notestringPresent 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409PRECONDITION (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 with
vm.boot_mode.set, restart, then try again.MAINTENANCE423We are doing maintenance on this server. Nothing was changed. Retry later.
UPSTREAM_UNAVAILABLE502The 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
safevm: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
idintegerrequiredServer id from
vm.list
Returns
latencynumber or nullrequiredAverage round-trip time in whole milliseconds; null when unreachable or not measured
statusstringrequiredunreachable 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409NOT_READY (reason: no_ip_address): The server has no IP address yet, usually because it is still being set up. Retry once
vm.getlists an address inips.MAINTENANCE423We 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
scheduleobject or nullrequiredNull when the server has no schedule.
Child fields
enabledbooleanrequiredWhen false the schedule is kept but nothing runs.
timezonestringrequiredIANA time zone the start and stop times are in, e.g. Europe/London.
daysarray of integersrequiredWeekdays the schedule runs on: 0 is Sunday, 6 is Saturday.
startstring or nullrequiredLocal time the server is started, HH:MM (24-hour). Null when the schedule does not start it.
stopstring or nullrequiredLocal time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.
updated_attimestamprequiredWhen the schedule was last saved.
nextobjectrequiredChild fields
start_attimestamp or nullrequiredThe next scheduled start. Null when none falls in the next 8 days.
stop_attimestamp or nullrequiredThe next scheduled stop. Null when none falls in the next 8 days.
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.list
Body
enabledbooleanrequiredtimezonestringrequireddaysarray of integersrequiredstartstring or nullrequiredstopstring or nullrequired
Returns
scheduleobject or nullrequiredNull when the server has no schedule.
Child fields
enabledbooleanrequiredWhen false the schedule is kept but nothing runs.
timezonestringrequiredIANA time zone the start and stop times are in, e.g. Europe/London.
daysarray of integersrequiredWeekdays the schedule runs on: 0 is Sunday, 6 is Saturday.
startstring or nullrequiredLocal time the server is started, HH:MM (24-hour). Null when the schedule does not start it.
stopstring or nullrequiredLocal time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.
updated_attimestamprequiredWhen the schedule was last saved.
nextobjectrequiredChild fields
start_attimestamp or nullrequiredThe next scheduled start. Null when none falls in the next 8 days.
stop_attimestamp or nullrequiredThe next scheduled stop. Null when none falls in the next 8 days.
Refusals specific to this operation
VALIDATION_FAILED400The 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_UNAVAILABLE502The 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 with
vm.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
destructivevm: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
idintegerrequiredServer id from
vm.list
Query parameters
confirmintegerrequiredMust equal the server id in the path ({id}).
Returns
scheduleobject or nullrequiredNull when the server has no schedule.
Child fields
enabledbooleanrequiredWhen false the schedule is kept but nothing runs.
timezonestringrequiredIANA time zone the start and stop times are in, e.g. Europe/London.
daysarray of integersrequiredWeekdays the schedule runs on: 0 is Sunday, 6 is Saturday.
startstring or nullrequiredLocal time the server is started, HH:MM (24-hour). Null when the schedule does not start it.
stopstring or nullrequiredLocal time the server is shut down, HH:MM (24-hour). Null when the schedule does not stop it.
updated_attimestamprequiredWhen the schedule was last saved.
nextobjectrequiredChild fields
start_attimestamp or nullrequiredThe next scheduled start. Null when none falls in the next 8 days.
stop_attimestamp or nullrequiredThe 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_UNAVAILABLE502The 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 with
vm.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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
os_image_idintegerrequiredAn image id from GET /v1/vms/{id}/os-images for this server
confirmintegerrequiredMust equal the server id in the path ({id}), as an integer
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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.400400VALIDATION_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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
safevm: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
idintegerrequiredServer id from
vm.list
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredSnapshot id. Use it as {snapshot_id} and as
confirmwhen restoring or deleting this snapshotnamestringrequiredstatusstringrequiredavailablewhen the snapshot is ready to restore or delete; any other value means it is still being processedsize_gbnumberrequiredSize in GB; 0 when not known yet
created_attimestamp or nullrequiredWhen the snapshot was taken, null when not recorded
Refusals specific to this operation
429429Read 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
safevm: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
idintegerrequiredServer id from
vm.list
Body
namestring1 to 40 characters: letters, numbers, spaces and . _ : / @ ( ) + -. Defaults to a name built from the current UTC time
Returns
snapshotobjectrequiredChild fields
idintegerrequiredSnapshot id. Use it as {snapshot_id} and as
confirmwhen restoring or deleting this snapshotnamestringrequiredstatusstringrequiredavailablewhen the snapshot is ready to restore or delete; any other value means it is still being processedsize_gbnumberrequiredSize in GB; 0 when not known yet
created_attimestamp or nullrequiredWhen 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409LIMIT_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.409409IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait until
vm.snapshots.listshows every snapshot asavailable, then retry.409409IN_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.MAINTENANCE423We are doing maintenance on this server. Nothing was changed. Retry later.
UPSTREAM_UNAVAILABLE502The 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
destructivevm: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
idintegerrequiredServer id from
vm.listsnapshot_idintegerrequiredSnapshot id from the snapshots list
Query parameters
confirmintegerrequiredMust equal the snapshot id in the path ({snapshot_id}).
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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_RESTRICTED403The 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_FOUND404The snapshot is not one of this server's snapshots, or is already deleted.
409409IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait until
vm.snapshots.listshows every snapshot asavailable, then retry.MAINTENANCE423We are doing maintenance on this server. Nothing was changed. Retry later.
UPSTREAM_UNAVAILABLE502The deletion was sent but could not be confirmed in time. Read
vm.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
destructivevm: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
idintegerrequiredServer id from
vm.listsnapshot_idintegerrequiredSnapshot id from the snapshots list
Body
confirmintegerrequiredMust equal the snapshot id in the path ({snapshot_id}), as an integer
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen 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_RESTRICTED403The 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_FOUND404The snapshot is not one of this server's snapshots. Nothing was changed. Read
vm.snapshots.list.409409IN_PROGRESS (reason: snapshot_in_progress): A snapshot of this server is still being created. Wait until
vm.snapshots.listshows every snapshot asavailable, then retry.409409IN_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.MAINTENANCE423We 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
destructivevm: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
idintegerrequiredServer id from
vm.list
Body
key_idsarray of stringsrequired1 to 10 key ids from your SSH key library
confirmintegerrequiredMust equal the server id in the URL
Returns
attachedintegerrequiredHow 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_RESTRICTED403The server is suspended, or the account is restricted from making changes.
404404NOT_FOUND (reason: ssh_key_not_found): One or more of the key ids are not in your library. Read the ids with
ssh_keys.list. Nothing was added.409409RESOURCE_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_UNAVAILABLE502The keys could not be put on the server, or only some of them were. Check with
vm.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
safevm: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
idintegerrequiredServer id from
vm.list
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen the operation was accepted
green_creditobject or nullrequiredA credit for time the server was switched off, already added to your account balance by this start. null when no credit applies
Child fields
amount_minorintegerrequiredCredit added to your account balance, in minor units of
currencycurrencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
off_secondsintegerrequiredHow long the server was switched off, in seconds, for which this credit was given
Refusals specific to this operation
ACCOUNT_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
safevm: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
idintegerrequiredServer id from
vm.list
Returns
operationobjectrequiredChild fields
idstringrequiredOperation id. Pass it as {op_id} to GET /v1/vms/{id}/operations/{op_id} to follow the work. Kept for 24 hours
actionstringrequiredWhat was started. One of force_stop, start, stop, restart, backup, backup_restore, backup_delete, reinstall, snapshot_restore, snapshot_delete.
status"pending"requiredAlways pending here: the work has been accepted, not finished
vm_idintegerrequiredServer id the operation runs on
created_attimestamprequiredWhen the operation was accepted
Refusals specific to this operation
ACCOUNT_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
dataarray of objectsrequiredChild fields
idstringrequiredTask id. Use it as {task_ref} and as
confirmwhen cancelling or retrying this taskactionstringrequiredKind of work, as a short machine name such as vm-start or backup-create
statusstringrequiredsucceeded and failed are final; a cancelled task reports failed. One of pending, running, succeeded, failed.
progressnumberrequiredPercent complete, 0 to 100
created_attimestamp or nullrequiredWhen the task was queued, null when not recorded
updated_attimestamp or nullrequiredWhen the task last changed, null when not recorded
cancelablebooleanrequiredWhether POST …/cancel can stop this task now
retryablebooleanrequiredWhether POST …/retry may run this task again. Always false for work that erases or overwrites a disk
Refusals specific to this operation
429429Read 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
readvm: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
idintegerrequiredServer id from
vm.listtask_refstringrequiredTask id from
vm.tasks.list
Returns
idstringrequiredTask id. Use it as {task_ref} and as
confirmwhen cancelling or retrying this taskactionstringrequiredKind of work, as a short machine name such as vm-start or backup-create
statusstringrequiredsucceeded and failed are final; a cancelled task reports failed. One of pending, running, succeeded, failed.
progressnumberrequiredPercent complete, 0 to 100
created_attimestamp or nullrequiredWhen the task was queued, null when not recorded
updated_attimestamp or nullrequiredWhen the task last changed, null when not recorded
cancelablebooleanrequiredWhether POST …/cancel can stop this task now
retryablebooleanrequiredWhether POST …/retry may run this task again. Always false for work that erases or overwrites a disk
Refusals specific to this operation
429429Read 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
destructivevm: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
idintegerrequiredServer id from
vm.listtask_refstringrequiredTask id from
vm.tasks.list
Body
confirmstringrequiredMust equal the task id in the path ({task_ref})
Returns
acceptedtruerequiredThe request was passed on; read the task again to see its new status
task_refstringrequiredThe 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.MAINTENANCE423We are doing maintenance on this server. Nothing was changed. Retry later.
UPSTREAM_UNAVAILABLE502The 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
destructivevm: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
idintegerrequiredServer id from
vm.listtask_refstringrequiredTask id from
vm.tasks.list
Body
confirmstringrequiredMust equal the task id in the path ({task_ref})
Returns
acceptedtruerequiredThe request was passed on; read the task again to see its new status
task_refstringrequiredThe 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_RESTRICTED403The server is suspended (
vm.getstatusis suspended) or your account is restricted. Nothing was changed. Pay the overdue invoice, or contact support about the restriction.409409PRECONDITION (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 example
vm.reinstallorvm.backups.restore.MAINTENANCE423We 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
readvm: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
idintegerrequiredServer id from
vm.list
Returns
cpu_usage_percentnumberrequiredCPU in use, 0 to 100, averaged across the server's vCPUs. Latest sample.
memory_used_mbnumberrequiredMemory 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_mbnumberrequiredMemory the server has, in megabytes.
memory_usage_percentnumber or nullrequiredmemory_used_mb as a share of memory_total_mb, 0 to 100, rounded. Null when the reading is not reliable.
disk_read_kb_per_secnumberrequiredDisk reads. A rate in kilobytes per second from the latest sample, not a running total.
disk_write_kb_per_secnumberrequiredDisk writes. A rate in kilobytes per second from the latest sample, not a running total.
network_in_kb_per_secnumberrequiredTraffic received. A rate in kilobytes per second from the latest sample, not a running total.
network_out_kb_per_secnumberrequiredTraffic sent. A rate in kilobytes per second from the latest sample, not a running total.
uptime_secondsnumberSeconds since the server last booted. 0 when not known.
Refusals specific to this operation
429429Read 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
List the SSH public keys in your library
GET/v1/ssh-keys
Operation ssh_keys.list
readvm: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 objectsrequiredChild fields
idstringrequiredKey id, used to attach or delete the key
namestringrequiredYour label for the key
typestringrequiredKey algorithm, e.g. ssh-ed25519
fingerprintstringrequiredSHA-256 of the public key, as 64 hex characters
created_attimestamprequiredWhen the key was added to the library
Refusals specific to this operation
429429Read 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
safevm: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
namestringYour label for the key, up to 64 characters. Defaults to "SSH key"
public_keystringrequiredOne 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_keyobjectrequiredChild fields
idstringrequiredKey id, used to attach or delete the key
namestringrequiredYour label for the key
typestringrequiredKey algorithm, e.g. ssh-ed25519
fingerprintstringrequiredSHA-256 of the public key, as 64 hex characters
created_attimestamprequiredWhen the key was added to the library
Refusals specific to this operation
400400VALIDATION_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_RESTRICTED403The account is restricted from making changes.
409409ALREADY_EXISTS (reason: ssh_key_already_in_library): This key is already in your library. Find its id with
ssh_keys.list.409409LIMIT_REACHED (reason: ssh_key_limit): The library is full. Remove a key with
ssh_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
destructivevm: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_idstringrequiredSSH key id from the library
Query parameters
confirmstringrequiredMust equal the key id in the path ({key_id}).
Returns
oktruerequired
Refusals specific to this operation
VALIDATION_FAILED400confirmis missing or is not the key id in the path.ACCOUNT_RESTRICTED403The 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
}Orders
Preview a price, place an order and follow it. An unpaid order can be cancelled, and an interrupted one recovered.
7 operations
List your orders, newest first
GET/v1/orders
Operation orders.list
readbilling: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
limitinteger1–100 orders, default 20
cursorstringnext_cursor from the previous page; descending order IDs
currencystringExact order currency
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredcurrencystringrequiredCurrency of every amount in this order. One of USD, EUR, GBP.
created_attimestamp or nullrequiredWhen the order was placed, ISO 8601 UTC. Null when not recorded
reservationobject or nullrequiredNull when the order has no stock reservation, for example an order placed outside the API.
Child fields
created_attimestamprequiredWhen the stock was reserved, ISO 8601 UTC
expires_attimestamprequiredWhen the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returned
statestringrequiredheld: 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 objectsrequiredChild fields
idintegerrequiredService id. Read it with the services operations; it is also the server id once the server exists
product_idinteger or nullrequiredstatusstringrequiredBilling status of the service: pending (order not yet paid), active, suspended or cancelled
quantityintegerrequiredrecurring_amount_minorintegerrequiredRecurring price per unit and billing cycle, in whole minor units of the order currency
next_cursorstring or nullrequiredPass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429Read 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
moneyorders: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
currencystringrequiredCurrency of every amount in this request. Must be your account currency, as returned by the order preview. One of USD, EUR, GBP.
max_invoice_minorintegerrequiredSpending 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 more
coupon_codestringcoupon_code from the order preview, unchanged
reservation_termsobjectreservation_terms from the order preview, unchanged. Required for a new order
Child fields
duration_seconds900requiredHow long stock is held for an unpaid order, in seconds
credit_partial_payments_to_wallettruerequiredIf the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currency
credit_late_payments_to_wallettruerequiredA payment that arrives after the order was released becomes wallet credit; it does not revive the order
itemsarray of objectsrequiredChild fields
product_idintegerrequiredProduct id from the catalogue
billing_cyclestringrequiredOne of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
quantityintegerHow many identical units. Each unit becomes its own service
configurationarray of objectsOne entry per option chosen. An operating_system option must be chosen where the product has one; other options are optional
Child fields
option_idintegerrequiredOption id from the product
value_idintegerrequiredId of the chosen value of that option
hostnamestringHostname for the server, lower case, for example web1.example.com
unit_price_minorintegerrequiredunit_price_minor of this item from the order preview, unchanged
unit_setup_fee_minorintegerrequiredunit_setup_fee_minor of this item from the order preview, unchanged
unit_invoice_price_minorintegerunit_invoice_price_minor of this item from the order preview, unchanged. Required when coupon_code is sent
Returns
kind"order_acceptance"requiredcoupon_codestringThe coupon applied, when one was requested
order_idintegerrequiredinvoice_idinteger or nullrequiredThe unpaid invoice to pay for this order. Null only when nothing is due
service_idsarray of integersrequiredOne service per unit ordered. A service id is also the server id once the server exists
currencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
amount_minorintegerrequiredTotal of the first invoice, in whole minor units of currency
reservationobjectrequiredThe 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 fields
created_attimestamprequiredWhen the stock was reserved, ISO 8601 UTC
expires_attimestamprequiredWhen 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
400400VALIDATION_FAILED (reason: price_changed): A unit amount in the request no longer matches the current price. Nothing was created. Call
orders.previewagain and send the new amounts.400400VALIDATION_FAILED (reason: reservation_terms_required): reservation_terms is missing. Copy it from
orders.preview.400400VALIDATION_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.
400400VALIDATION_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. Read
catalog.products.getagain.400400VALIDATION_FAILED (reason: operating_system_required): The item at details.item_index has no choice for an operating_system option. Add one to its configuration.
400400VALIDATION_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.400400VALIDATION_FAILED (reason: coupon_invalid): coupon_code cannot be used by this account. Remove it, or check it with
catalog.coupons.preview.403403ACCOUNT_RESTRICTED (reason: email_not_verified): The account email address is not verified. The customer must verify it in the client area before ordering.
NOT_FOUND404A product_id in the request is not on sale. Read
catalog.products.listfor the products you can order.409409LIMIT_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_UNAVAILABLE502The order may or may not have been created. Do not order again with a new key: retry with the same Idempotency-Key, or call
orders.recover.503503UNAVAILABLE (reason: out_of_stock): An item is sold out in the quantity asked. Nothing was created. Order fewer units, another product, or try later.
503503UNAVAILABLE (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
readbilling: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_idintegerrequiredYour order id, from
orders.listororders.create
Returns
idintegerrequiredcurrencystringrequiredCurrency of every amount in this order. One of USD, EUR, GBP.
created_attimestamp or nullrequiredWhen the order was placed, ISO 8601 UTC. Null when not recorded
reservationobject or nullrequiredNull when the order has no stock reservation, for example an order placed outside the API.
Child fields
created_attimestamprequiredWhen the stock was reserved, ISO 8601 UTC
expires_attimestamprequiredWhen the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returned
statestringrequiredheld: 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 objectsrequiredChild fields
idintegerrequiredService id. Read it with the services operations; it is also the server id once the server exists
product_idinteger or nullrequiredstatusstringrequiredBilling status of the service: pending (order not yet paid), active, suspended or cancelled
quantityintegerrequiredrecurring_amount_minorintegerrequiredRecurring price per unit and billing cycle, in whole minor units of the order currency
Refusals specific to this operation
429429Read 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
readbilling: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_idintegerrequiredYour order id, from
orders.listororders.create
Returns
releaseobject or nullrequiredThe record of an order being released. It is fixed at release time: it is not your current wallet balance.
Child fields
kind"order_release"requiredorder_idintegerrequiredinvoice_idinteger or nullrequiredservice_idsarray of integersrequiredcurrencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
state"released"requiredreasonstringrequiredcustomer_cancelled: you cancelled it. expired: the reservation ran out unpaid first. One of customer_cancelled, expired.
released_attimestamprequiredWhen the order was released, ISO 8601 UTC
wallet_credit_minorintegerrequiredPart 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
429429Read 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
destructiveorders: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_idintegerrequiredYour order id, from
orders.listororders.create
Body
confirmintegerrequiredMust equal the order id in the URL
credit_partial_payments_to_wallettruerequiredMust 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_idintegerrequiredinvoice_idinteger or nullrequiredservice_idsarray of integersrequiredcurrencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
state"released"requiredreasonstringrequiredcustomer_cancelled: you cancelled it. expired: the reservation ran out unpaid first. One of customer_cancelled, expired.
released_attimestamprequiredWhen the order was released, ISO 8601 UTC
wallet_credit_minorintegerrequiredPart 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_FAILED400confirm 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.
409409RESOURCE_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_UNAVAILABLE502The cancellation may or may not have happened. Read
orders.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
readbilling: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 objectsrequiredChild fields
product_idintegerrequiredProduct id from the catalogue
billing_cyclestringrequiredOne of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
quantityintegerHow many identical units. Each unit becomes its own service
configurationarray of objectsOne entry per option chosen. An operating_system option must be chosen where the product has one; other options are optional
Child fields
option_idintegerrequiredOption id from the product
value_idintegerrequiredId of the chosen value of that option
coupon_codestring
Returns
reservation_termsobjectrequiredCopy unchanged into the order. By sending it back you accept these terms
Child fields
duration_seconds900requiredHow long stock is held for an unpaid order, in seconds
credit_partial_payments_to_wallettruerequiredIf the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currency
credit_late_payments_to_wallettruerequiredA payment that arrives after the order was released becomes wallet credit; it does not revive the order
kind"estimate"requiredcoupon_codestringThe coupon as stored. Copy it unchanged into the order
currencystringrequiredYour account currency. Every amount in this response is in it. One of USD, EUR, GBP.
subtotal_minorintegerrequiredTotal of the first invoice for all items, in whole minor units of currency: recurring price plus setup fees, less discounts
tax_includedfalserequiredAlways false: no tax is added
discounts_includedbooleanrequiredTrue when a volume discount or the requested coupon lowered any price
quantityintegerrequiredTotal units across all items
availabilitystringrequiredavailable: 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 objectsrequiredChild fields
item_indexintegerrequiredPosition of this item in the request, from 0
product_idintegerrequirednamestringrequiredcategorystringrequiredOne of vps, hosting, dedicated, proxies, gateway.
billing_cyclestringrequiredOne of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
quantityintegerrequiredunit_price_minorintegerrequiredRecurring price per unit and billing cycle, with the chosen options, after any volume discount and recurring coupon
unit_setup_fee_minorintegerrequiredOne-off fee per unit on the first invoice
unit_invoice_price_minorintegerFirst-invoice amount per unit, including setup and coupon. Present only when a coupon was requested; copy it into the order
subtotal_minorintegerrequiredFirst-invoice amount for this item: per-unit amount times quantity
availabilitystringrequiredOne of available, unavailable, unknown.
configurationarray of objectsrequiredChild fields
option_idintegerrequiredvalue_idintegerrequirednamestringrequiredName of the chosen value
Refusals specific to this operation
400400VALIDATION_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.
400400VALIDATION_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. Read
catalog.products.getagain.400400VALIDATION_FAILED (reason: operating_system_required): The item at details.item_index has no choice for an operating_system option. Add one to its configuration.
400400VALIDATION_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.400400VALIDATION_FAILED (reason: coupon_invalid): coupon_code cannot be used by this account. Remove it, or check it with
catalog.coupons.preview.NOT_FOUND404A product_id in the request is not on sale. Read
catalog.products.listfor the products you can order.429429Read allowance exceeded. Wait for Retry-After before sending more requests.
503503UNAVAILABLE (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
readbilling: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_keystringrequiredThe Idempotency-Key header value you sent with the original order request
orderobjectrequiredThe original order request body, unchanged
Child fields
currencystringrequiredCurrency of every amount in this request. Must be your account currency, as returned by the order preview. One of USD, EUR, GBP.
max_invoice_minorintegerrequiredSpending 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 more
coupon_codestringcoupon_code from the order preview, unchanged
reservation_termsobjectreservation_terms from the order preview, unchanged. Required for a new order
Child fields
duration_seconds900requiredHow long stock is held for an unpaid order, in seconds
credit_partial_payments_to_wallettruerequiredIf the order is released unpaid, anything already paid towards it is returned as wallet credit in the same currency
credit_late_payments_to_wallettruerequiredA payment that arrives after the order was released becomes wallet credit; it does not revive the order
itemsarray of objectsrequiredChild fields
product_idintegerrequiredProduct id from the catalogue
billing_cyclestringrequiredOne of the cycles listed in the product prices. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
quantityintegerHow many identical units. Each unit becomes its own service
configurationarray of objectsOne entry per option chosen. An operating_system option must be chosen where the product has one; other options are optional
hostnamestringHostname for the server, lower case, for example web1.example.com
unit_price_minorintegerrequiredunit_price_minor of this item from the order preview, unchanged
unit_setup_fee_minorintegerrequiredunit_setup_fee_minor of this item from the order preview, unchanged
unit_invoice_price_minorintegerunit_invoice_price_minor of this item from the order preview, unchanged. Required when coupon_code is sent
Returns
orderobject or nullrequiredThe accepted order, or null when none was found for this request key
Child fields
kind"order_acceptance"requiredcoupon_codestringThe coupon applied, when one was requested
order_idintegerrequiredinvoice_idinteger or nullrequiredThe unpaid invoice to pay for this order. Null only when nothing is due
service_idsarray of integersrequiredOne service per unit ordered. A service id is also the server id once the server exists
currencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
amount_minorintegerrequiredTotal of the first invoice, in whole minor units of currency
reservationobjectrequiredThe 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 fields
created_attimestamprequiredWhen the stock was reserved, ISO 8601 UTC
expires_attimestamprequiredWhen the reservation ends, ISO 8601 UTC. Pay before this; an order still unpaid after it can be released and its stock returned
observationstringrequiredaccepted: 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_CONFLICT409The request key belongs to an order with a different body. Send the original body unchanged.
429429Read 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
Check a coupon code and what it takes off
POST/v1/catalog/coupons/preview
Operation catalog.coupons.preview
readbilling: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
codestringrequiredThe coupon code as the customer typed it
product_idintegerProduct id from the catalogue. Send it to learn whether the coupon applies to that product
amount_minorintegerPer-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
validfalseThe code does not exist, is not active, has run out, or you have already used it
codestringThe code exactly as stored. Copy this form into coupon_code when ordering
typestringpercentage: percent_off is set. fixed: amount_off_minor is set. One of percentage, fixed.
percent_offnumberPercent taken off. Present only when type is percentage
amount_off_minorintegerAmount taken off, in whole minor units of currency. Present only when type is fixed
currencystringYour account currency. Every amount in this response is in it. One of USD, EUR, GBP.
recurringbooleanTrue when the discount also applies to renewals; false when it applies to the first invoice only
applies_to_all_productsbooleanproduct_idsarray of integersProducts the coupon is limited to. Empty when applies_to_all_products is true
applies_to_productbooleanWhether the coupon applies to the product_id you sent. Present only when you sent one
discount_minorintegerWhat the coupon takes off the amount_minor you sent. Present only when you sent an amount and the coupon applies
amount_after_discount_minorintegeramount_minor less discount_minor, never below zero
expires_attimestamp or nullWhen the coupon stops working, ISO 8601 UTC. Null when it has no end date
per_user_checkedtrueAlways true: your own past use of the code was checked
Refusals specific to this operation
429429Read 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
readaccount: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
limitinteger1–100, default 20
cursorstringnext_cursor from the previous page; ascending product ids
categorystringStore category
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredProduct id. Use it as product_id when previewing and creating an order
namestringrequiredcategorystringrequiredOne of vps, hosting, dedicated, proxies, gateway.
regionstring or nullrequiredCountry code of the region the product is hosted in (for example us, nl, uk). Null when the product is not tied to one region
currencystringrequiredYour account currency. Every amount in this product, its prices and its options is in this currency. One of USD, EUR, GBP.
pricesarray of objectsrequiredOne entry per billing cycle the product is sold on
Child fields
cyclestringrequiredBilling cycle this price is for. Use it as billing_cycle when ordering. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
amount_minorintegerrequiredRecurring price per cycle, in whole minor units (cents) of the product currency. Tax is not included
setup_fee_minorintegerrequiredOne-off fee added to the first invoice, in whole minor units of the product currency
stock_statusstringrequiredavailable: 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 nullrequiredPass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429Read 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
readaccount: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
idintegerrequiredProduct id from
catalog.products.list
Returns
idintegerrequiredProduct id. Use it as product_id when previewing and creating an order
namestringrequiredcategorystringrequiredOne of vps, hosting, dedicated, proxies, gateway.
regionstring or nullrequiredCountry code of the region the product is hosted in (for example us, nl, uk). Null when the product is not tied to one region
currencystringrequiredYour account currency. Every amount in this product, its prices and its options is in this currency. One of USD, EUR, GBP.
pricesarray of objectsrequiredOne entry per billing cycle the product is sold on
Child fields
cyclestringrequiredBilling cycle this price is for. Use it as billing_cycle when ordering. One of free, onetime, monthly, quarterly, semiannually, annually, biennially, triennially.
amount_minorintegerrequiredRecurring price per cycle, in whole minor units (cents) of the product currency. Tax is not included
setup_fee_minorintegerrequiredOne-off fee added to the first invoice, in whole minor units of the product currency
stock_statusstringrequiredavailable: 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_statusstringrequiredready: 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 objectsrequiredChild fields
idintegerrequiredOption id. Use it as option_id in an order item configuration
namestringrequiredkindstringrequiredoperating_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 objectsrequiredChild fields
idintegerrequiredChoice id. Use it as value_id in an order item configuration
namestringrequiredincludedbooleanrequiredTrue when the choice is free of charge; prices is then empty
pricesarray of objectsrequiredExtra price of this choice per billing cycle, added to the product price
Refusals specific to this operation
429429Read 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
}
]
}
]
}
]
}Services
Everything you pay for on a recurring basis. Read a service, ask for its renewal invoice early, or cancel it.
4 operations
List your services
GET/v1/services
Operation services.list
readbilling: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
limitinteger1–100, default 20
cursorstringnext_cursor from the previous page; ascending service ids
statusstringBilling status to filter by: pending, active, suspended or cancelled
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredService id. For a server product it is also the server id used by the server operations
product_idintegerrequiredproduct_namestring or nullrequiredName of the product. Null when it could not be read
labelstring or nullrequiredThe name you gave the service, usually the server hostname. Null when none was set
statusstringrequiredBilling status in lower case: pending (its order is not yet paid), active, suspended or cancelled
recurring_amount_minorintegerrequiredPrice charged each billing cycle, in whole minor units of currency
currencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
renewal_datestring or nullrequiredDay 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 nullrequiredPass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429Read 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
readbilling: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
idintegerrequiredYour service id, from
services.list
Returns
idintegerrequiredService id. For a server product it is also the server id used by the server operations
product_idintegerrequiredproduct_namestring or nullrequiredName of the product. Null when it could not be read
labelstring or nullrequiredThe name you gave the service, usually the server hostname. Null when none was set
statusstringrequiredBilling status in lower case: pending (its order is not yet paid), active, suspended or cancelled
recurring_amount_minorintegerrequiredPrice charged each billing cycle, in whole minor units of currency
currencystringrequiredISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
renewal_datestring or nullrequiredDay 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
429429Read 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
destructiveservices: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
idintegerrequiredYour service id, from
services.list
Body
when"immediate"requiredAlways immediate: billing stops now. The server still runs to the end of the period already paid for
confirmintegerrequiredMust equal the service id in the URL
reasonstringWhy you are cancelling, in your own words
Returns
idintegerrequiredstatus"cancelled"requiredThe billing status of the service after this request
effective"immediate"requiredBilling stopped at once: no further renewal invoice is issued
infrastructure_changedbooleanrequiredTrue only when this request suspended the server and the suspension was confirmed
serverstringrequiredsuspended: 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 nullrequiredEnd 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_FAILED400confirm 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_RESTRICTED403The service is in a state that cannot be cancelled through the API, or it is on hold. Contact support.
409409RESOURCE_STATE_CONFLICT (reason: order_unpaid): The service is pending: it belongs to an order that has not been paid. Cancel the order with
orders.cancelinstead.IN_PROGRESS409Another change to this service is being applied. Try again shortly.
UPSTREAM_UNAVAILABLE502The cancellation may or may not have been recorded. Read
services.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
moneybilling: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
idintegerrequiredYour service id, from
services.list
Body
confirmintegerrequiredMust equal the service id in the URL
Returns
invoice_idintegerrequiredThe unpaid renewal invoice for this service: newly issued, or the one that was already open
Refusals specific to this operation
VALIDATION_FAILED400confirm is missing or does not equal the service id in the URL (the refusal carries field: confirm). Nothing is issued.
403403ACCOUNT_RESTRICTED (reason: email_not_verified): The account email address is not verified. The customer must verify it in the client area first.
NOT_FOUND404Also returned for a service of yours that is overdue or has no renewal (cancelled, one-off or free). Check renewal_date with
services.get.409409PRECONDITION (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.409409PRECONDITION (reason: service_not_active): The service is suspended, so its renewal cannot be issued early.
409409PRECONDITION (reason: service_change_in_progress): A plan change for this service is not finished. Wait until it completes, then ask again.
409409PRECONDITION (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
}Billing
Your wallet: balance, transactions and deposits, and paying several invoices from it in one request.
11 operations
- GET
/v1/billing/balance - GET
/v1/billing/credit-batches - POST
/v1/billing/credit-batches - GET
/v1/billing/credit-batches/{batch_id} - GET
/v1/billing/credit-batches/cancellation - POST
/v1/billing/credit-batches/cancellation - GET
/v1/billing/deposit-limits - GET
/v1/billing/deposits - POST
/v1/billing/deposits - GET
/v1/billing/deposits/{deposit_id} - GET
/v1/billing/transactions
Read your wallet balance
GET/v1/billing/balance
Operation billing.balance
readbilling: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_minorintegerrequiredWallet credit available to spend, in whole minor units (cents) of
currencycurrencystringrequiredThe 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
429429Read 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
readbilling: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_keystringrequiredExact original Idempotency-Key used for this batch
currencystringrequiredOriginal confirmed currency
invoicesstringrequiredJSON 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 nullrequiredThe receipt of the original request, or null when that request did not pay anything
Child fields
batch_idstringrequiredcurrencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objectsrequiredOne payment per invoice, in the same order as
invoices. Every invoice in a batch is paid in fullChild fields
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorintegerrequiredWallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
moneyinvoices: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
currencystringrequiredCurrency of the wallet and of every listed invoice. One of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
confirmtruerequiredMust 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_idstringrequiredcurrencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objectsrequiredOne payment per invoice, in the same order as
invoices. Every invoice in a batch is paid in fullChild fields
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorintegerrequiredWallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
400400VALIDATION_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.
400400VALIDATION_FAILED (reason: currency_mismatch): An invoice is not in the currency you sent. Nothing was paid.
400400VALIDATION_FAILED (reason: invoice_not_payable): An invoice in the selection is already paid, cancelled or has nothing left to pay. Nothing was paid.
400400VALIDATION_FAILED (reason: request_cancelled): This Idempotency-Key was cancelled with
billing.credit_batches.canceland can never pay.ACCOUNT_RESTRICTED403The account email is not verified yet, or the account is restricted.
409409PRECONDITION (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.409409LIMIT_REACHED (reason: insufficient_wallet_balance): The wallet does not cover the whole selection. Nothing was paid; check
billing.balance, then add funds or pay fewer invoices.IDEMPOTENCY_CONFLICT409This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.
UPSTREAM_UNAVAILABLE502Billing did not answer. The outcome may be unknown: call
billing.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
readbilling: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_idstringrequiredId of a batch wallet payment, from
billing.credit_batches.create
Returns
batch_idstringrequiredcurrencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objectsrequiredOne payment per invoice, in the same order as
invoices. Every invoice in a batch is paid in fullChild fields
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorintegerrequiredWallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
readbilling: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_keystringrequiredExact original payment Idempotency-Key
currencystringrequiredExact original confirmed currency
invoicesstringrequiredJSON array of the original ordered invoice_id and max_amount_minor objects, 1 to 25 unique invoices
Returns
resolutionobject or nullrequirednull when the original request neither paid nor was cancelled: its outcome is still open
Child fields
state"cancelled"requiredcancellationobjectrequiredChild fields
cancellation_idstringrequiredId of the cancellation record
currencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
cancelledtruerequiredAlways true: the original request can never take a payment now
batchobjectrequiredChild fields
batch_idstringrequiredcurrencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
paymentsarray of objectsrequiredOne payment per invoice, in the same order as
invoices. Every invoice in a batch is paid in fullwallet_balance_after_minorintegerrequiredWallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
safeinvoices: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
currencystringrequiredCurrency of the wallet and of every listed invoice. One of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
confirmtruerequiredMust 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
request_keystringrequiredThe Idempotency-Key of the original batch payment request you want stopped
Returns
state"cancelled"cancellationobjectChild fields
cancellation_idstringrequiredId of the cancellation record
currencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
cancelledtruerequiredAlways true: the original request can never take a payment now
batchobjectChild fields
batch_idstringrequiredcurrencystringrequiredOne of USD, EUR, GBP.
invoicesarray of objectsrequired1 to 25 different invoices, in the order they are to be paid
Child fields
invoice_idintegerrequiredOne of your invoices
max_amount_minorintegerrequiredSpending ceiling for this invoice in whole minor units (cents). The batch is refused if the invoice needs more than this
paymentsarray of objectsrequiredOne payment per invoice, in the same order as
invoices. Every invoice in a batch is paid in fullChild fields
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
wallet_balance_after_minorintegerrequiredWallet balance after the whole batch, in whole minor units (cents)
Refusals specific to this operation
UPSTREAM_UNAVAILABLE502Billing did not answer. The outcome may be unknown: call
billing.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
readbilling: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
currencystringrequiredCurrency in which these numeric funding limits apply; no FX conversion
Returns
currencystringrequiredOne of USD, EUR, GBP.
minimum_amount_minorintegerrequiredSmallest amount one funding request may ask for, in whole minor units (cents)
maximum_amount_minorintegerrequiredLargest amount one funding request may ask for, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
readbilling: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_keystringrequiredExact original Idempotency-Key used to accept this wallet funding invoice
currencystringrequiredOriginal requested currency
amount_minorintegerrequiredExact original requested amount in minor currency units
Returns
depositobject or nullrequiredThe receipt of the original request, or null when no funding invoice was created for that key, currency and amount
Child fields
deposit_idstringrequiredId of this funding request; read it back with the deposit read operation
invoice_idintegerrequiredThe unpaid funding invoice that was created. Paying it adds amount_minor to the wallet
currencystringrequiredOne of USD, EUR, GBP.
amount_minorintegerrequiredAmount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
moneybilling: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
currencystringrequiredCurrency 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_minorintegerrequiredAmount to add to the wallet, in whole minor units (cents). Must be within the limits for this currency
Returns
deposit_idstringrequiredId of this funding request; read it back with the deposit read operation
invoice_idintegerrequiredThe unpaid funding invoice that was created. Paying it adds amount_minor to the wallet
currencystringrequiredOne of USD, EUR, GBP.
amount_minorintegerrequiredAmount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
400400VALIDATION_FAILED (reason: deposit_below_minimum): amount_minor is under the minimum.
detailscarries currency, minimum_amount_minor and maximum_amount_minor.400400VALIDATION_FAILED (reason: deposit_above_maximum): amount_minor is over the maximum.
detailscarries currency, minimum_amount_minor and maximum_amount_minor.ACCOUNT_RESTRICTED403The account email is not verified yet, or the account is restricted.
IDEMPOTENCY_CONFLICT409This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.
UPSTREAM_UNAVAILABLE502Billing did not answer. The outcome may be unknown: call
billing.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
readbilling: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_idstringrequiredId of a funding request, from
billing.deposits.create
Returns
deposit_idstringrequiredId of this funding request; read it back with the deposit read operation
invoice_idintegerrequiredThe unpaid funding invoice that was created. Paying it adds amount_minor to the wallet
currencystringrequiredOne of USD, EUR, GBP.
amount_minorintegerrequiredAmount the invoice is for and the wallet will receive, in whole minor units (cents)
Refusals specific to this operation
429429Read 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
readbilling: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
currencystringrequiredWallet currency to read; no automatic conversion or profile default
directionstringFilter by signed movement; zero amounts appear only in all (default)
limitinteger1–100 entries, default 20
cursorstringnext_cursor from the previous page; entries have descending ledger ids
Returns
currencystringrequiredCurrency of every amount on this page. One of USD, EUR, GBP.
dataarray of objectsrequiredChild fields
idintegerrequiredLedger entry id. Entries are returned newest first (descending id)
created_attimestamprequiredWhen the entry was written, ISO 8601 UTC
descriptionstringrequiredWhat the entry was for, as shown in the client area
amount_minorintegerrequiredSigned change to the wallet in whole minor units (cents): positive adds credit, negative spends it
balance_after_minorintegerrequiredWallet balance straight after this entry, in whole minor units (cents)
typestringrequiredcredit when amount_minor is zero or more, debit when it is negative. One of credit, debit.
categorystringrequiredLabel 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 nullrequiredPass as
cursorto get the next (older) page. null on the last page
Refusals specific to this operation
429429Read 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
}Invoices
List, read and export invoices, and pay one from your wallet.
6 operations
Your invoices, newest first
GET/v1/invoices
Operation invoices.list
readbilling: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
limitinteger1–100, default 20
cursorstringnext_cursor from previous page; invoices have descending ids
Returns
dataarray of objectsrequiredChild fields
idintegerrequiredInvoice id
total_minorintegerrequiredInvoice total after credit already applied and tax, in whole minor units (cents) of
currencycurrencystringrequiredCurrency of this invoice. It can only be paid from wallet credit in the same currency. One of USD, EUR, GBP.
statusstringrequiredpaid: 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_datestringrequiredUTC calendar date the invoice was issued, YYYY-MM-DD
due_datestring or nullrequiredCalendar date payment is due, YYYY-MM-DD. null when the invoice has no due date
next_cursorstring or nullrequiredPass as
cursorto get the next page. null on the last page
Refusals specific to this operation
429429Read 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
readbilling: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_idintegerrequiredYour invoice id
Returns
idintegerrequiredInvoice id
total_minorintegerrequiredInvoice total after credit already applied and tax, in whole minor units (cents) of
currencycurrencystringrequiredCurrency of this invoice. It can only be paid from wallet credit in the same currency. One of USD, EUR, GBP.
statusstringrequiredpaid: 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_datestringrequiredUTC calendar date the invoice was issued, YYYY-MM-DD
due_datestring or nullrequiredCalendar date payment is due, YYYY-MM-DD. null when the invoice has no due date
balance_minorintegerrequiredAmount still to pay, in whole minor units (cents) of
currency. 0 when paiditemsarray of objectsrequiredChild fields
descriptionstringrequiredLine item text as shown on the invoice
amount_minorintegerrequiredLine amount (unit price times quantity), in whole minor units (cents) of the invoice currency
Refusals specific to this operation
429429Read 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
readbilling: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_idintegerrequiredYour invoice id
Query parameters
request_keystringrequiredThe exact Idempotency-Key used for the original payment request
currencystringrequiredOriginal payment currency
max_amount_minorintegerrequiredThe exact positive spend cap from the original request, in minor currency units
Returns
paymentobject or nullrequiredThe receipt of the original request, or null when that request did not take a payment
Child fields
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
429429Read 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
moneyinvoices: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_idintegerrequiredYour invoice id
Body
currencystringrequiredCurrency 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_minorintegerrequiredSpending ceiling in whole minor units (cents): at most this much leaves the wallet. This is your consent to the amount
confirmintegerrequiredMust equal the invoice id in the URL
Returns
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
400400VALIDATION_FAILED (reason: currency_mismatch): The invoice is not in the currency you sent.
detailscarries invoice_id and, when known, the invoice currency.400400VALIDATION_FAILED (reason: invoice_already_paid): The invoice is paid or has nothing left to pay.
detailscarries invoice_id.400400VALIDATION_FAILED (reason: invoice_cancelled): The invoice was cancelled.
detailscarries invoice_id.400400VALIDATION_FAILED (reason: invoice_not_payable): The invoice stopped being payable while the request ran.
detailscarries invoice_id.ACCOUNT_RESTRICTED403The account email is not verified yet, or the account is restricted.
409409PRECONDITION (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.409409LIMIT_REACHED (reason: no_wallet_balance): The wallet holds no credit in this currency. Nothing was paid; add funds with
billing.deposits.create.detailscarries invoice_id.IDEMPOTENCY_CONFLICT409This Idempotency-Key was already used with a different currency, amount or selection. Nothing was done.
UPSTREAM_UNAVAILABLE502Billing did not answer. The outcome may be unknown: call
invoices.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
readbilling: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_idintegerrequiredYour invoice id
payment_idstringrequiredId of a wallet payment, from
invoices.credit.create
Returns
payment_idstringrequiredId of this wallet payment; read it back with the payment read operation
invoice_idintegerrequiredThe invoice that was paid
currencystringrequiredOne of USD, EUR, GBP.
applied_minorintegerrequiredAmount taken from the wallet and applied to the invoice, in whole minor units (cents). Never more than the ceiling
wallet_balance_after_minorintegerrequiredWallet balance straight after this payment, in whole minor units (cents)
invoice_remaining_after_minorintegerrequiredWhat was still owed on the invoice straight after this payment. 0 when it was paid in full
invoice_paidbooleanrequiredtrue when this payment settled the invoice in full; false when it was a part payment and a balance remains
Refusals specific to this operation
429429Read 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
readbilling: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 objectsrequiredNewest first, at most the 500 most recent invoices
Child fields
invoice_idintegerrequiredInvoice id; use it with the invoice read and payment operations
issued_datestringrequiredUTC calendar date the invoice was issued, YYYY-MM-DD
due_datestring or nullrequiredCalendar date payment is due, YYYY-MM-DD. null when the invoice has no due date
paid_attimestamp or nullrequiredWhen the invoice was paid, ISO 8601 UTC. null while unpaid or cancelled
total_minorintegerrequiredInvoice total after credit already applied and tax, in whole minor units (cents) of
currencycurrencystringrequiredCurrency of this invoice. One of USD, EUR, GBP.
statusstringrequiredpaid: settled in full. unpaid: open. cancelled: void, cannot be paid. One of paid, unpaid, cancelled.
payment_methodstring or nullrequiredPayment method recorded on the invoice. null when none is recorded there
plan_namestringrequiredProduct name read from the first line item. Empty text when the invoice has no product line
billing_periodstringrequiredBilling period text as printed on the first line item. Display text, not a parseable date range; empty when the line has none
locationstringrequiredServer location read from the first line item. Empty text when not stated
operating_systemstringrequiredOperating system read from the first line item. Empty text when not stated
specsstringrequiredResource summary read from the first line item, comma separated. Empty text when not stated
all_itemsstringrequiredProduct names of every line item, separated by "; "
Refusals specific to this operation
429429Read allowance exceeded. Wait for Retry-After before sending more requests.
UPSTREAM_UNAVAILABLE502The export could not be put together completely. No partial export is returned; try again shortly or use
invoices.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"
}
]
}Gateways
A Gateway gives one of your own machines a dedicated public IPv4 address through an encrypted tunnel. Register the device key, load the configuration, then run the three checks.
15 operations
- GET
/v1/gateways - GET
/v1/gateways/{id} - POST
/v1/gateways/{id}/cancel - GET
/v1/gateways/{id}/config - POST
/v1/gateways/{id}/keys/register - POST
/v1/gateways/{id}/keys/rotate - PUT
/v1/gateways/{id}/peer - GET
/v1/gateways/{id}/stats - GET
/v1/gateways/{id}/status - GET
/v1/gateways/{id}/test/egress - POST
/v1/gateways/{id}/test/egress - GET
/v1/gateways/{id}/test/reachable - POST
/v1/gateways/{id}/test/reachable - GET
/v1/gateways/{id}/test/tunnel - POST
/v1/gateways/{id}/tier
List your Gateways
GET/v1/gateways
Operation gateway.list
readgateway: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 objectsrequiredChild fields
service_idintegerrequiredGateway id: the {id} of every Gateway operation, and the value confirm must repeat
locationstringrequiredLocation code of the Gateway
location_labelstringrequiredDisplay name of the location
tier25 or 50 or 100 or 250requiredSpeed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.
statestringrequiredsetting_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 nullrequiredThe dedicated public IPv4 address; null until one is assigned
suspendedbooleanrequiredTrue while we have switched the Gateway off;
gateway.statussays whether it is for an unpaid invoice or a reviewcancel_blockedbooleanrequiredTrue when
gateway.cancelis refused for this Gateway; contact support insteadpending_downgrade_tierobject or nullrequiredLower speed that applies when the next renewal invoice is paid; null when none is scheduled
serverobject or nullrequiredOur end of the tunnel; null until the Gateway is active
Child fields
public_keystringrequiredWireGuard public key of our end of the tunnel
endpointstringrequiredhost:port the device connects to
mtuintegerrequiredMTU to set on the tunnel interface; a larger value stalls big transfers
Refusals specific to this operation
NOT_FOUND404Gateways are not available on this account.
429429Read 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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Returns
gatewayobjectrequiredChild fields
service_idintegerrequiredGateway id: the {id} of every Gateway operation, and the value confirm must repeat
locationstringrequiredLocation code of the Gateway
location_labelstringrequiredDisplay name of the location
tier25 or 50 or 100 or 250requiredSpeed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.
statestringrequiredsetting_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 nullrequiredThe dedicated public IPv4 address; null until one is assigned
suspendedbooleanrequiredTrue while we have switched the Gateway off;
gateway.statussays whether it is for an unpaid invoice or a reviewcancel_blockedbooleanrequiredTrue when
gateway.cancelis refused for this Gateway; contact support insteadpending_downgrade_tierobject or nullrequiredLower speed that applies when the next renewal invoice is paid; null when none is scheduled
serverobject or nullrequiredOur end of the tunnel; null until the Gateway is active
Child fields
public_keystringrequiredWireGuard public key of our end of the tunnel
endpointstringrequiredhost:port the device connects to
mtuintegerrequiredMTU to set on the tunnel interface; a larger value stalls big transfers
peer_setbooleanrequiredTrue once a public key is registered. Also false when the live state could not be read;
gateway.statustells the two apart.handshake_attimestamp or nullrequiredLast WireGuard handshake with the device; null when there has been none or the live state could not be read
rx_bytesnumberrequiredBytes received from the device through the tunnel (its upload)
tx_bytesnumberrequiredBytes sent to the device through the tunnel (its download)
Refusals specific to this operation
429429Read 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
destructivegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
confirmintegerrequiredMust equal the Gateway id in the URL
Returns
oktruerequiredreleasedbooleanrequiredtrue: 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_FAILED400confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.
403403ACCOUNT_RESTRICTED (reason: cancel_blocked): The Gateway is held by our team (cancel_blocked is true on
gateway.get) and cannot be cancelled through the API. Open a support ticket.UPSTREAM_UNAVAILABLE502The outcome is unknown. Read
gateway.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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Query parameters
kindstringrequireddevice: 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
kindstringrequiredOne of device, linux, router.
filenamestringrequiredSuggested file name for the configuration
templatestringrequiredWireGuard 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"srequiredConfiguration keys whose value you fill in on the device
serverobjectrequiredChild fields
public_keystringrequiredWireGuard public key of our end of the tunnel
endpointstringrequiredhost:port the device connects to
mtuintegerrequiredMTU to set on the tunnel interface; a larger value stalls big transfers
addressstringrequiredTunnel address for the device: the Gateway IP as a /32
notesarray of objectsrequiredSetup notes for this kind of device, written for a person
Child fields
titlestringrequiredtextstringrequired
full_tunnelbooleanrequiredTrue 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
400400VALIDATION_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_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.NOT_READY409The Gateway is not active yet. Poll
gateway.getuntil state is active; if it is needs_support, open a support ticket.429429Read 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
safegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
public_keystringrequiredWireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.
device_labelstringYour own name for the device, up to 40 characters
Returns
registeredtruerequiredreplacedbooleanrequiredTrue when a different key was registered before; the device using the old key is now disconnected and earlier check results are cleared
fingerprintstringrequiredFirst 8 characters of the registered public key
registered_attimestamprequiredWhen this key was registered
Refusals specific to this operation
400400VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.
ACCOUNT_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.409409ALREADY_EXISTS (reason: peer_set): A different key is already registered. Use
gateway.keys.rotateto replace it; that disconnects the device using the current key.409409ALREADY_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_READY409The Gateway is not active yet. Poll
gateway.getuntil state is active; if it is needs_support, open a support ticket.502502UPSTREAM_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
destructivegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
public_keystringrequiredWireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.
device_labelstringYour own name for the device, up to 40 characters
confirmintegerrequiredMust equal the Gateway id in the URL
Returns
registeredtruerequiredreplacedbooleanrequiredTrue when a different key was registered before; the device using the old key is now disconnected and earlier check results are cleared
fingerprintstringrequiredFirst 8 characters of the registered public key
registered_attimestamprequiredWhen this key was registered
Refusals specific to this operation
VALIDATION_FAILED400confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.
400400VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.
ACCOUNT_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.409409PRECONDITION (reason: no_key): No key is registered yet. Use
gateway.keys.register.409409ALREADY_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_READY409The Gateway is not active yet. Poll
gateway.getuntil state is active; if it is needs_support, open a support ticket.502502UPSTREAM_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
destructivegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
public_keystringrequiredWireGuard PUBLIC key of the device (base64, 44 characters). Never send the private key: any other field is refused.
device_labelstringYour own name for the device, up to 40 characters
confirmintegerrequiredMust equal the Gateway id in the URL
Returns
registeredtruerequiredreplacedbooleanrequiredTrue when a different key was registered before; the device using the old key is now disconnected and earlier check results are cleared
fingerprintstringrequiredFirst 8 characters of the registered public key
registered_attimestamprequiredWhen this key was registered
Refusals specific to this operation
VALIDATION_FAILED400confirm is missing or does not equal the Gateway id in the URL (the refusal carries field: confirm). Nothing is changed.
400400VALIDATION_FAILED (reason: public_key): The value is not a WireGuard public key.
ACCOUNT_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.409409ALREADY_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_READY409The Gateway is not active yet. Poll
gateway.getuntil state is active; if it is needs_support, open a support ticket.502502UPSTREAM_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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Query parameters
windowstringHow far back the samples go; defaults to 1h
Returns
pointsarray of objectsrequiredTraffic samples, oldest first; empty until the Gateway is active
Child fields
sampled_attimestamprequiredISO 8601 UTC timestamp, e.g. 2026-11-14T10:00:00.000Z
rx_mbpsnumberrequiredMegabits per second received from the device (its upload)
tx_mbpsnumberrequiredMegabits per second sent to the device (its download)
Refusals specific to this operation
429429Read 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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Returns
service_idintegerrequiredGateway id: the {id} of every Gateway operation, and the value confirm must repeat
statestringrequiredsetting_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 objectrequiredfalse 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 fields
kindstringOne of billing, review.
ipstring or nullrequiredThe dedicated public IPv4 address; null until one is assigned
locationstringrequiredLocation code of the Gateway
tier25 or 50 or 100 or 250requiredSpeed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.
peerobjectrequiredChild fields
setbooleanrequiredTrue once a public key is registered
registered_attimestamp or nullrequiredWhen the current key was registered; null when no key is set
linkstringrequiredno_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 nullrequiredLast WireGuard handshake with the device; null when there has been none
handshake_age_sinteger or nullrequiredSeconds since the last handshake with the current key; null when there has been none
rx_bytesnumberrequiredBytes received from the device through the tunnel (its upload)
tx_bytesnumberrequiredBytes sent to the device through the tunnel (its download)
daemonstringrequiredok: 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_timetimestamprequiredThe clock the handshake age was measured against
cached_age_msintegerrequiredAge of this reading in milliseconds; readings are reused for a moment
Refusals specific to this operation
429429Read 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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Query parameters
test_idstringtest_id from
gateway.test.egress.start. Omit to read the latest check. An id that is no longer the active check reads as expired.
Returns
statestringrequiredwaiting: 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.
hitsintegerrequiredHow many times the link was opened
last_hit_attimestamp or nullrequiredWhen the link was last opened; null when it has not been
observedobjectOnly for not_routed: the address the device actually used
Child fields
ipstringrequired
Refusals specific to this operation
409409PRECONDITION (reason: no_test): No check has been started for this Gateway, or the last one is gone. Call
gateway.test.egress.start.429429Read 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
safegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
modestringbrowser: 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.
freshbooleantrue issues a new link even if one is still active; the old link stops working
Returns
test_idstringrequiredId of this check, for
gateway.test.egress.getexpires_attimestamprequiredThe link stops working at this time
urlstringrequiredOpen this from the device that uses the Gateway, with the tunnel switched on
qr_payloadstringrequiredText to show as a QR code for a phone; the same link
commandstringOnly for mode bound: a command to run on the server, which sends the request from the Gateway address
reusedbooleanTrue when this is the link that was already active, not a new one
Refusals specific to this operation
ACCOUNT_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.NOT_READY409The Gateway is not active or has no IP address yet. Poll
gateway.getuntil state is active.UNAVAILABLE503This 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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Returns
verdictstringrequiredpass: 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.
codestringrequiredpass: 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 nullrequiredTCP port that was tried; null for a ping-only run
vantagesarray of objectsrequiredChild fields
regionstringrequiredWhere this probe ran from
icmpstring or nullrequiredPing result; null when not measured. One of reply, timeout.
tcpstring or nullrequiredTCP result on the port; null for a ping-only run. One of open, refused, timeout.
forwardedobject or nullrequirednull when tunnel traffic could not be measured
Child fields
to_devicebooleanrequiredTraffic went through the tunnel to the device during the probe
from_devicebooleanrequiredTraffic came back from the device during the probe
checked_attimestamprequiredWhen this check ran
Refusals specific to this operation
409409PRECONDITION (reason: no_test): No result is stored for this Gateway. Run
gateway.test.reachable.run.429429Read 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
safegateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
portintegerTCP port to try as well as ping. Omit for a ping-only check. Mail and Windows file-sharing ports are refused.
Returns
verdictstringrequiredpass: 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.
codestringrequiredpass: 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 nullrequiredTCP port that was tried; null for a ping-only run
vantagesarray of objectsrequiredChild fields
regionstringrequiredWhere this probe ran from
icmpstring or nullrequiredPing result; null when not measured. One of reply, timeout.
tcpstring or nullrequiredTCP result on the port; null for a ping-only run. One of open, refused, timeout.
forwardedobject or nullrequirednull when tunnel traffic could not be measured
Child fields
to_devicebooleanrequiredTraffic went through the tunnel to the device during the probe
from_devicebooleanrequiredTraffic came back from the device during the probe
checked_attimestamprequiredWhen this check ran
Refusals specific to this operation
400400VALIDATION_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_RESTRICTED403The Gateway is suspended. Read
gateway.status: billing means pay the open invoice, review means open a support ticket.409409PRECONDITION (reason: tunnel_not_up): The device is not connected right now. Switch the tunnel on, poll
gateway.test.tunneluntil code is up, then run again.409409PRECONDITION (reason: probe_target_refused): The check cannot be run for this address. Nothing in the request changes that; open a support ticket.
IN_PROGRESS409A check for this Gateway is already running. Wait a few seconds, then read
gateway.test.reachable.get.NOT_READY409The Gateway is not active yet. Poll
gateway.getuntil state is active; if it is needs_support, open a support ticket.429429RATE_LIMITED (reason: cooldown): Runs for one Gateway must be a few seconds apart. Wait for Retry-After.
429429RATE_LIMITED (reason: hourly): Too many runs for this Gateway. Wait for Retry-After.
429429RATE_LIMITED (reason: ports): Too many different ports in a short time. Wait for Retry-After, or reuse a port already checked.
UPSTREAM_UNAVAILABLE502The 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
readgateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Returns
verdictstringrequiredpass: 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.
codestringrequiredup: 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 nullrequiredSeconds since the last handshake with the current key; null when there has been none
key_registered_attimestamp or nullrequiredWhen the current key was registered; null when no key is set
Refusals specific to this operation
429429Read 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
moneygateway: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
idintegerrequiredYour Gateway id (service_id from
gateway.list)
Body
tier25 or 50 or 100 or 250requiredSpeed in Mbps: 25, 50, 100 or 250. Traffic is unmetered at that speed.
Returns
kind"invoice"invoice_idintegerUnpaid invoice for the prorated difference. The new speed applies when it is paid.
amount_minorintegerWhole minor units (cents) of the currency beside it
currencystringISO 4217 currency of the amounts beside it. One of USD, EUR, GBP.
pay_urlstringLink in the client area where a person can pay this invoice
effective"renewal"The lower speed applies when the next renewal invoice is paid
Refusals specific to this operation
409409PRECONDITION (reason: same_tier): The Gateway is already on that speed.
409409PRECONDITION (reason: not_active): The Gateway is not active yet. Poll
gateway.getuntil state is active.409409PRECONDITION (reason: suspended): The Gateway is suspended. Read
gateway.status: pay the open invoice (billing) or open a support ticket (review), then retry.409409PRECONDITION (reason: tier_not_sold_here): That speed is not offered in this location. Choose another tier.
409409PRECONDITION (reason: currency_unsupported): The Gateway is not billed in USD, and speed changes are USD only. Open a support ticket to change speed.
409409PRECONDITION (reason: custom_price): The Gateway has a custom price. Open a support ticket to change speed.
409409PRECONDITION (reason: invoice_open): An unpaid invoice for this Gateway exists. Find it with
invoices.list, pay it, then retry.409409PRECONDITION (reason: renewal_invoice_open): The renewal invoice is open, so a lower speed cannot be scheduled. Pay it, then retry.
409409PRECONDITION (reason: renewal_due): Renewal is less than a day away. Retry after the Gateway has renewed.
409409PRECONDITION (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.409409PRECONDITION (reason: downgrade_pending): A lower speed is already scheduled for the next renewal (pending_downgrade_tier on
gateway.get). Wait for the renewal, or open a support ticket.409409PRECONDITION (reason: nothing_to_prorate): The prorated difference rounds to zero. Retry after the Gateway has renewed.
409409PRECONDITION (reason: bad_expiry): The renewal date of the Gateway could not be read. Open a support ticket.
409409PRECONDITION (reason: changed): The Gateway changed while the request ran. Read
gateway.getand retry.409409PRECONDITION (reason: busy): Another change to this Gateway is in progress. Retry in a few minutes.
409409PRECONDITION (reason: invoice_failed): The invoice could not be raised and nothing was changed. Retry later.
UPSTREAM_UNAVAILABLE502The outcome is unknown. Read
gateway.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"
}Proxies
Your proxy balance, usage and spend, the credentials to connect with, and the addresses allowed to use them.
14 operations
- GET
/v1/proxy - GET
/v1/proxy/acl - POST
/v1/proxy/acl - GET
/v1/proxy/credentials - GET
/v1/proxy/isp-static - GET
/v1/proxy/isp-static/credentials - POST
/v1/proxy/rotate - GET
/v1/proxy/spend-breakdown - POST
/v1/proxy/test - POST
/v1/proxy/trial - GET
/v1/proxy/usage - GET
/v1/proxy/whitelist - POST
/v1/proxy/whitelist - DELETE
/v1/proxy/whitelist
Read your proxy balance, default tier and where to connect
GET/v1/proxy
Operation proxy.get
readproxy: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_minorintegerrequiredPrepaid proxy balance in whole cents, rounded down so it never overstates what can be spent
currency"USD"requiredProxy balance, prices and spend are always in US dollars
used_today_bytesintegerrequiredProxy traffic metered so far today, in bytes
tierstringrequiredThe account default tier, used when a connection does not name one. One of isp, ipv6, essential, standard, cleanproxy, cleanproxy_geo, sticky_clean, mobile.
activebooleanrequiredFalse when proxy access is switched off for this account
host"proxy.privatebyte.com"requiredHostname to connect to
portsobjectrequiredTCP ports for HTTP(S) proxying and for SOCKS5
Child fields
http3128requiredsocks51080required
Refusals specific to this operation
404404NOT_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).429429Read 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
readproxy: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_enabledbooleanrequiredTrue: only whitelisted addresses may connect, even with the correct credential. False: the credential works from anywhere.
Refusals specific to this operation
404404NOT_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).429429Read 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
safeproxy: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
enabledbooleanrequiredTrue to accept connections from whitelisted addresses only
Returns
acl_enabledbooleanrequiredTrue: only whitelisted addresses may connect, even with the correct credential. False: the credential works from anywhere.
Refusals specific to this operation
404404NOT_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_UNAVAILABLE502The outcome is unknown. Read
proxy.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
readproxy: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_keystringrequiredOpaque proxy credential. A secret: do not parse, log or share it.
Refusals specific to this operation
404404NOT_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).429429Read 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
readproxy: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 objectsrequiredChild fields
ipstring or nullrequiredThe dedicated address; null while it is being set up
countrystringrequiredCountry code of the address (two letters; three letters while it is being set up)
renewal_datestring or nullrequiredPaid through the end of this UTC day, YYYY-MM-DD; null while it is being set up
statusstringrequiredactive: 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 nullrequiredThe service this address is billed under; null when it is not linked to one
Refusals specific to this operation
429429Read 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
readproxy: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 nullrequiredOpaque 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
429429Read 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
safeproxy: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 nullrequiredThe new opaque proxy credential. Null only on an idempotent replay, which never repeats the secret.
notestringPresent on a replay: says where to read the current credential
Refusals specific to this operation
404404NOT_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_UNAVAILABLE502The outcome is unknown: the key may or may not have changed. Read
proxy.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
readproxy: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
daysstring1, 7 or 30 days; default 1
Returns
daysintegerrequiredLength of the period in days, ending today
first_data_datestring or nullrequiredEarliest day in the period that has per-tier data; null when there is none
currency"USD"requiredProxy balance, prices and spend are always in US dollars
totalobjectrequiredChild fields
bytesintegerrequiredTraffic in bytes
requestsintegerrequiredNumber of proxied requests
spend_minorintegerrequiredAmount charged to the proxy balance, in whole cents rounded to the nearest cent
per_tierarray of objectsrequiredOne 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 fields
bytesintegerrequiredTraffic in bytes
requestsintegerrequiredNumber of proxied requests
spend_minorintegerrequiredAmount charged to the proxy balance, in whole cents rounded to the nearest cent
tierstringrequiredProxy 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_minorintegerrequiredPublished price of this tier per gigabyte, in whole cents
Refusals specific to this operation
404404NOT_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).429429Read 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
safeproxy: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
tierstringTier key to test, for example standard or mobile. A tier that is not on sale is refused.
countrystringTwo-letter country code to exit from; empty for any country
sessionstringSticky-session id (letters, digits, underscore, hyphen); empty for a rotating connection
ttl_minutesintegerHow long the sticky session should keep its exit address, in minutes
statestringState or region to exit from; needs country and the http protocol
citystringCity to exit from; needs country and the http protocol
zipstringPostal code to exit from; needs country and the http protocol
asnstringNetwork (AS number) to exit from; needs country and the http protocol
protocolstringWhich proxy protocol to test; http when omitted. One of http, socks5.
Returns
successbooleanrequiredTrue when the request went through your proxy and an exit address came back
ipstringThe exit address the target saw
errorstringPlain reason when success is false
countrystringCountry name the exit address is located in; empty when unknown
country_codestringTwo-letter country code of the exit address; empty when unknown
citystringCity the exit address is located in; empty when unknown
cleanboolean or nullWhether 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_msnumberrequiredMilliseconds until the exit address came back or the attempt failed
tested_tierstringrequiredTier key the test ran on
tested_countrystring or nullrequiredCountry code that was requested; null for any country
diagnosticsobjectrequiredChild fields
protocolstringrequiredOne of HTTP CONNECT, SOCKS5.
requestedobjectrequiredThe targeting that was asked for; null where nothing was asked
Child fields
countrystring or nullrequiredstatestring or nullrequiredcitystring or nullrequiredzipstring or nullrequiredasnstring or nullrequired
observedobject or nullrequiredWhere the exit address was located; null when the location lookup was unavailable
Child fields
countrystringrequiredstatestringrequiredcitystringrequiredzipstringrequired
geo_statusstringrequiredunavailable: 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 nullrequiredShort reference derived from the session id you sent, for quoting to support; null without a session
requested_ttl_minutesnumber or nullrequiredSticky-session lifetime that was requested, in minutes
total_msnumberrequiredMilliseconds for the whole test, including the location lookup
notestringrequiredWhat this single test does and does not prove
Refusals specific to this operation
400400VALIDATION_FAILED (reason: tier_not_available): The tier is not on sale.
400400VALIDATION_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.
403403ACCOUNT_RESTRICTED (reason: no_proxy_balance): Your proxy balance is zero. Add proxy credit first.
403403ACCOUNT_RESTRICTED (reason: proxy_access_inactive): Proxy access is switched off for your account.
404404NOT_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_UNAVAILABLE502The 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
safeproxy: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_minorintegerrequiredProxy balance after the free credit, in whole cents rounded down
currency"USD"requiredProxy balance, prices and spend are always in US dollars
Refusals specific to this operation
VALIDATION_FAILED400The request did not carry a usable client address.
403403ACCOUNT_RESTRICTED (reason: email_not_verified): Verify the account email address first, then claim again.
ACCOUNT_RESTRICTED403Without a reason: the account is not eligible for the free trial.
404404NOT_FOUND (reason: trial_not_offered): The free trial is not on offer at the moment.
409409ALREADY_EXISTS (reason: trial_already_claimed): This account has already used its free trial.
409409ALREADY_EXISTS (reason: proxy_access_exists): This account already has proxy access, so the trial does not apply. Add proxy credit instead.
LIMIT_REACHED409No 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
readproxy: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_minorintegerrequiredPrepaid proxy balance in whole cents, rounded down so it never overstates what can be spent
currency"USD"requiredProxy balance, prices and spend are always in US dollars
used_today_bytesintegerrequiredProxy traffic metered so far today, in bytes
tierstringrequiredThe account default tier, used when a connection does not name one. One of isp, ipv6, essential, standard, cleanproxy, cleanproxy_geo, sticky_clean, mobile.
activebooleanrequiredFalse when proxy access is switched off for this account
Refusals specific to this operation
404404NOT_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).429429Read 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
readproxy: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 stringsrequiredAddresses that may use your proxy balance without a password
countintegerHow many addresses are on the list
maxintegerThe most addresses the list can hold
Refusals specific to this operation
404404NOT_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).429429Read 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
safeproxy: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
ipstringrequiredOne public IPv4 address. Private, loopback, link-local, shared, multicast and reserved addresses are refused.
Returns
successtruerequired
Refusals specific to this operation
VALIDATION_FAILED400Field
ip: not an IPv4 address, or not a public one.404404NOT_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).409409LIMIT_REACHED (reason: whitelist_full): The list already holds its maximum (
details.max). Remove an address first.UPSTREAM_UNAVAILABLE502The address could not be added, for example because it is already on another account's list, or the outcome is unknown. Read
proxy.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
safeproxy: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
ipstringrequiredOne allow-listed IPv4 address to remove
Returns
successtruerequired
Refusals specific to this operation
404404NOT_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_UNAVAILABLE502The outcome is unknown. Read
proxy.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
}Account
Your profile, the extra contacts on the account, account alerts, and the Telegram link with its notification settings.
13 operations
- GET
/v1/account - PATCH
/v1/account - GET
/v1/account/alerts - GET
/v1/account/contacts - POST
/v1/account/contacts - GET
/v1/account/contacts/{id} - PATCH
/v1/account/contacts/{id} - DELETE
/v1/account/contacts/{id} - GET
/v1/account/telegram - POST
/v1/account/telegram - DELETE
/v1/account/telegram - GET
/v1/account/telegram/preferences - PUT
/v1/account/telegram/preferences
Your account profile
GET/v1/account
Operation account.get
readaccount: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
idintegerrequiredYour account id
emailstringrequiredSign-in and billing email. Cannot be changed through the API
first_namestringrequiredlast_namestringrequiredcompanystring or nullrequiredCompany name, null when not set
address1string or nullrequiredBilling address line 1, null when not set
address2string or nullrequiredBilling address line 2, null when not set
citystring or nullrequiredstatestring or nullrequiredState, province or region, null when not set
postcodestring or nullrequiredphone_numberstring or nullrequiredPhone number as you entered it, null when not set
countrystring or nullrequiredISO 3166-1 alpha-2 country code (e.g. GB), null when not set
currencystring or nullrequiredISO 4217 code of the currency the account is billed in (e.g. USD), null when not set
email_verifiedbooleanrequiredWhether the account email has been verified. Some operations, such as adding a contact, need it to be true
two_factor_enabledbooleanrequiredWhether two-factor sign-in is switched on for the client area
Refusals specific to this operation
429429Read 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
safeaccount: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_namestringcompanystringCompany name. An empty string clears it
address1stringAddress line 1
address2stringAddress line 2. An empty string clears it
citystringstatestringState, province or region
postcodestringcountrystringISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper case
phone_numberstringPhone number, free text up to 64 characters
Returns
oktruerequired
Refusals specific to this operation
VALIDATION_FAILED400The 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
readaccount: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 objectsrequiredNewest event first. Not paginated
Child fields
idstringrequiredStable id of the alert
kindstringrequiredinvoice: 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 nullrequiredId of the invoice, service, ticket or announcement the alert is about, as described under kind. null for a notice
titlestringrequiredShort heading, written for a person
messagestringrequiredOne-line explanation, written for a person. Do not parse it; use kind and resource_id
event_attimestamp or nullrequiredThe 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 unknown
readbooleanrequiredfalse while the alert still needs attention; true for older, informational entries
linkstring or nullrequiredPath of the matching page in the client area (e.g. /invoices/91), null when there is none
Refusals specific to this operation
429429Read 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
readaccount: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 objectsrequiredAll of your contacts; the list is not paginated
Child fields
idintegerrequiredContact id, used in the contact URLs
first_namestringrequiredlast_namestringrequiredcompanystringrequiredaddress1stringrequiredaddress2stringrequiredcitystringrequiredstatestringrequiredState, province or region
postcodestringrequiredcountrystringrequiredISO 3166-1 alpha-2 country code, or an empty string when not set
phone_numberstringrequiredemailstringrequiredContact email address
Refusals specific to this operation
429429Read 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
safeaccount: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_namestringrequiredlast_namestringcompanystringCompany name. An empty string clears it
address1stringAddress line 1
address2stringAddress line 2. An empty string clears it
citystringstatestringState, province or region
postcodestringcountrystringISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper case
phone_numberstringPhone number, free text up to 64 characters
emailstringrequiredContact email address
Returns
idintegerrequiredContact id, used in the contact URLs
first_namestringrequiredlast_namestringrequiredcompanystringrequiredaddress1stringrequiredaddress2stringrequiredcitystringrequiredstatestringrequiredState, province or region
postcodestringrequiredcountrystringrequiredISO 3166-1 alpha-2 country code, or an empty string when not set
phone_numberstringrequiredemailstringrequiredContact email address
Refusals specific to this operation
VALIDATION_FAILED400first_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.403403ACCOUNT_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
readaccount: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
idintegerrequiredContact id from
account.contacts.listoraccount.contacts.create
Returns
idintegerrequiredContact id, used in the contact URLs
first_namestringrequiredlast_namestringrequiredcompanystringrequiredaddress1stringrequiredaddress2stringrequiredcitystringrequiredstatestringrequiredState, province or region
postcodestringrequiredcountrystringrequiredISO 3166-1 alpha-2 country code, or an empty string when not set
phone_numberstringrequiredemailstringrequiredContact email address
Refusals specific to this operation
429429Read 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
safeaccount: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
idintegerrequiredContact id from
account.contacts.listoraccount.contacts.create
Body
first_namestringlast_namestringcompanystringCompany name. An empty string clears it
address1stringAddress line 1
address2stringAddress line 2. An empty string clears it
citystringstatestringState, province or region
postcodestringcountrystringISO 3166-1 alpha-2 country code, two letters (e.g. GB). Stored in upper case
phone_numberstringPhone number, free text up to 64 characters
emailstringContact email address
Returns
idintegerrequiredContact id, used in the contact URLs
first_namestringrequiredlast_namestringrequiredcompanystringrequiredaddress1stringrequiredaddress2stringrequiredcitystringrequiredstatestringrequiredState, province or region
postcodestringrequiredcountrystringrequiredISO 3166-1 alpha-2 country code, or an empty string when not set
phone_numberstringrequiredemailstringrequiredContact email address
Refusals specific to this operation
VALIDATION_FAILED400The 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
destructiveaccount: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
idintegerrequiredContact id from
account.contacts.listoraccount.contacts.create
Query parameters
confirmintegerrequiredMust equal the contact id in the path ({id}).
Returns
oktruerequired
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
readaccount: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 nullTelegram username of the linked chat, null when that Telegram account has none
linked_attimestampWhen the Telegram account was linked, ISO 8601 UTC
Refusals specific to this operation
429429Read 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
destructiveaccount: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
codestringrequiredSingle-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_in900requiredSeconds until the code expires (15 minutes)
Refusals specific to this operation
409409RESOURCE_STATE_CONFLICT (reason: telegram_already_linked): A Telegram account is already linked. Call
account.telegram.unlinkfirst if the customer wants to link a different one.RATE_LIMITED429Only 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
destructiveaccount: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
confirmstringrequiredMust be true to unlink your Telegram account.
Returns
linkedfalseusernamestring or nullTelegram username of the linked chat, null when that Telegram account has none
linked_attimestampWhen the Telegram account was linked, ISO 8601 UTC
Refusals specific to this operation
VALIDATION_FAILED400confirm is missing or is not true (
fieldis confirm). Nothing is changed.409409RESOURCE_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
readaccount: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
preferencesobjectrequiredChild fields
invoice_generatedbooleanrequiredSend a Telegram message when a new invoice is issued
invoice_due_soonbooleanrequiredSend a Telegram message when an unpaid invoice is close to its due date
payment_receivedbooleanrequiredSend a Telegram message when a payment is received
low_balancebooleanrequiredSend a Telegram message when an account balance runs low
server_startedbooleanrequiredSend a Telegram message when a server is powered on
server_stoppedbooleanrequiredSend a Telegram message when a server is powered off
server_restartedbooleanrequiredSend a Telegram message when a server is restarted
server_suspendedbooleanrequiredSend a Telegram message when a server is suspended
server_unsuspendedbooleanrequiredSend a Telegram message when a suspended server is restored
service_activatedbooleanrequiredSend a Telegram message when a new service becomes active
service_terminatedbooleanrequiredSend a Telegram message when a service is terminated
Refusals specific to this operation
409409RESOURCE_STATE_CONFLICT (reason: telegram_not_linked): No Telegram account is linked. Call
account.telegram.linkand have the customer send the code to the bot first.429429Read 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
safeaccount: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
preferencesobjectrequiredOnly the switches you send are changed; the others keep their value
Child fields
invoice_generatedbooleanSend a Telegram message when a new invoice is issued
invoice_due_soonbooleanSend a Telegram message when an unpaid invoice is close to its due date
payment_receivedbooleanSend a Telegram message when a payment is received
low_balancebooleanSend a Telegram message when an account balance runs low
server_startedbooleanSend a Telegram message when a server is powered on
server_stoppedbooleanSend a Telegram message when a server is powered off
server_restartedbooleanSend a Telegram message when a server is restarted
server_suspendedbooleanSend a Telegram message when a server is suspended
server_unsuspendedbooleanSend a Telegram message when a suspended server is restored
service_activatedbooleanSend a Telegram message when a new service becomes active
service_terminatedbooleanSend a Telegram message when a service is terminated
Returns
preferencesobjectrequiredChild fields
invoice_generatedbooleanrequiredSend a Telegram message when a new invoice is issued
invoice_due_soonbooleanrequiredSend a Telegram message when an unpaid invoice is close to its due date
payment_receivedbooleanrequiredSend a Telegram message when a payment is received
low_balancebooleanrequiredSend a Telegram message when an account balance runs low
server_startedbooleanrequiredSend a Telegram message when a server is powered on
server_stoppedbooleanrequiredSend a Telegram message when a server is powered off
server_restartedbooleanrequiredSend a Telegram message when a server is restarted
server_suspendedbooleanrequiredSend a Telegram message when a server is suspended
server_unsuspendedbooleanrequiredSend a Telegram message when a suspended server is restored
service_activatedbooleanrequiredSend a Telegram message when a new service becomes active
service_terminatedbooleanrequiredSend a Telegram message when a service is terminated
Refusals specific to this operation
VALIDATION_FAILED400preferences is missing, names a switch that does not exist, or a value is not true or false.
fieldnames it.409409RESOURCE_STATE_CONFLICT (reason: telegram_not_linked): No Telegram account is linked. Call
account.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
}
}Support tickets
Open a ticket, read the conversation, reply and close it.
6 operations
List your support tickets
GET/v1/tickets
Operation tickets.list
readtickets: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
limitinteger1–100, default 20
cursorstringnext_cursor from the previous page; tickets are listed newest first
Returns
dataarray of objectsrequiredNewest ticket first
Child fields
idintegerrequiredTicket id, a whole number. The same id is returned by create and list and accepted by get, reply and close
subjectstringrequiredstatusstringrequiredopen: 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.
prioritystringrequiredOne of low, normal, high.
department_idintegerrequiredDepartment the ticket is filed under; names come from the departments list
created_attimestamprequiredWhen the ticket was opened, ISO 8601 UTC
updated_attimestamprequiredWhen the ticket last changed (latest message or status change), ISO 8601 UTC
next_cursorstring or nullrequiredPass as cursor to get the next page; null on the last page
Refusals specific to this operation
429429Read 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
safetickets: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
messagestringrequiredPlain text, 1 to 16,000 characters. Read by PrivateByte support staff. Never include passwords, API keys or private keys. Attachments are not supported
department_idintegerrequiredA department id from the departments list
subjectstringrequiredOne-line summary, 1 to 255 characters
prioritystringHow urgent the request is. Defaults to normal. One of low, normal, high.
service_idintegerId 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
idintegerrequiredId of the new ticket
Refusals specific to this operation
400400VALIDATION_FAILED (reason: department_not_found): department_id is not a department from
tickets.departments.details.department_idrepeats the value sent. List the departments and retry with a valid id.VALIDATION_FAILED400subject 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.404404NOT_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_CONFLICT409This 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_LIMITED429Opening, 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
readtickets: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
idintegerrequiredTicket id from
tickets.listortickets.create
Returns
idintegerrequiredTicket id, a whole number. The same id is returned by create and list and accepted by get, reply and close
subjectstringrequiredstatusstringrequiredopen: 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.
prioritystringrequiredOne of low, normal, high.
department_idintegerrequiredDepartment the ticket is filed under; names come from the departments list
created_attimestamprequiredWhen the ticket was opened, ISO 8601 UTC
updated_attimestamprequiredWhen the ticket last changed (latest message or status change), ISO 8601 UTC
service_idinteger or nullrequiredService the ticket is about, null when it is not tied to one
messagesarray of objectsrequiredThe whole conversation, oldest message first. Internal staff notes are never included
Child fields
idintegerrequiredMessage id
authorstringrequiredclient: written by you or through your API key. support: written by PrivateByte staff. One of client, support.
messagestringrequiredcreated_attimestamprequiredWhen the message was posted, ISO 8601 UTC
Refusals specific to this operation
429429Read 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
safetickets: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
idintegerrequiredTicket id from
tickets.listortickets.create
Returns
oktruerequired
Refusals specific to this operation
IDEMPOTENCY_CONFLICT409This 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_LIMITED429Opening, 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
safetickets: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
idintegerrequiredTicket id from
tickets.listortickets.create
Body
messagestringrequiredPlain text, 1 to 16,000 characters. Read by PrivateByte support staff. Never include passwords, API keys or private keys. Attachments are not supported
Returns
idintegerrequiredTicket id
message_idintegerrequiredId of the message that was added
Refusals specific to this operation
VALIDATION_FAILED400message 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_CONFLICT409This 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_LIMITED429Opening, 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
readtickets: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 objectsrequiredChild fields
idintegerrequiredUse as department_id when opening a ticket
namestringrequiredDepartment name, which says what it handles
Refusals specific to this operation
429429Read 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
Read your rewards points balance and tier
GET/v1/rewards
Operation rewards.get
readrewards: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_pointsintegerrequiredPoints you can redeem now
pending_points0requiredAlways 0: points are credited at once
total_earned_pointsintegerrequiredPoints earned over the life of the account; this decides your tier
total_redeemed_pointsintegerrequiredtierobjectrequiredChild fields
idstringrequirednamestringrequiredmin_pointsintegerrequiredmax_pointsinteger or nullrequiredearning_multipliernumberrequiredPoints earned on purchases are multiplied by this in your tier
perksarray of stringsrequired
tier_progressnumberrequiredPercent of the way from your tier to the next, 0 to 100
next_tier_pointsinteger or nullrequiredTotal earned points at which the next tier starts. Null in the top tier
updated_attimestamprequiredWhen your rewards last changed, ISO 8601 UTC
Refusals specific to this operation
429429Read 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
readrewards: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
limitinteger1–100 retained transactions, default 20
cursorstringnext_cursor from the previous page; bound to this account and transaction type
typestringFilter by exact reward transaction type
Returns
dataarray of objectsrequiredYour points transactions, newest first. This is the points history, not the wallet ledger.
Child fields
idstringrequiredtypestringrequiredOne of purchase, first_purchase, monthly_loyalty, referral_reward, referral_bonus, milestone, redemption, manual, expiration.
amount_pointsintegerrequiredPoints added (positive) or taken (negative) by this transaction
balance_pointsintegerrequiredPoints balance after this transaction
descriptionstringrequiredcreated_attimestamprequiredWhen the transaction happened, ISO 8601 UTC
next_cursorstring or nullrequiredPass as cursor to read the next page. Null on the last page
Refusals specific to this operation
429429Read 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
moneyrewards: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
pointsintegerrequiredExactly how many points to redeem, at least 100. 100 points become 1.00 of wallet credit in your account currency
Returns
redeemed_pointsintegerrequiredPoints taken from your balance
credit_minorintegerrequiredWallet credit added, in whole minor units (cents) of currency
currencystringrequiredYour account currency: the credit is added to your wallet in it. One of USD, EUR, GBP.
balance_pointsintegerrequiredYour points balance after the redemption
Refusals specific to this operation
409409RESOURCE_STATE_CONFLICT (reason: insufficient_points): The balance is lower than the points asked for. Nothing was taken. Read
rewards.getand ask for less.IN_PROGRESS409Another redemption for this account is being applied. Wait for Retry-After and send the same request again.
UPSTREAM_UNAVAILABLE502The redemption may or may not have happened. Retry with the same Idempotency-Key (it cannot redeem twice), or read
rewards.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
Read your referral code and what it has earned
GET/v1/referrals
Operation referrals.get
readrewards: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 nullrequiredExisting issued referral code, or null when none has been issued. This read never generates a code.
referral_countintegerrequiredHow many people have signed up with your code
reward_points_per_referralintegerrequiredPoints you earn for each person you refer
referred_user_bonus_pointsintegerrequiredPoints the person you refer receives
Refusals specific to this operation
429429Read 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
safeaccount: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
codestringrequiredYour referral code. Share it with people you refer
Refusals specific to this operation
IN_PROGRESS409Another 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"
}