Managing services
Every route on this page takes the service code (SRV-TJUAQ1-1951), given by GET /services. A service outside the key's restriction answers 404 SERVICE_NOT_FOUND.
GET /services
Permissions: services:read
| Parameter | Type | Required | Values |
|---|---|---|---|
limit | integer | no, default 20 | 1 to 100 |
cursor | string | no | pagination.nextCursor from the previous page |
status | string | no | ACTIVE, SUSPENDED, CANCELLED, DELETED. Any other value answers 400 VALIDATION_ERROR:status |
Newest first.
curl -H "Authorization: Bearer $FRESHPERF_KEY" \ "https://api.freshperf.fr/v1/services?limit=2&status=ACTIVE"
{ "data": [ { "code": "SRV-TJUAQ1-1951", "name": "Minecraft 1", "customName": null, "productShortname": "minecraft-1", "productTitle": "Minecraft 1", "category": "minecraft", "status": "ACTIVE", "providerType": "games", "autoRenew": true, "nextBillingAt": 1789437385056, "recurrence": "monthly", "createdAt": 1786845385066, "activatedAt": 1786845385056 } ], "pagination": { "nextCursor": null, "limit": 2 } }
| Field | Type | Notes |
|---|---|---|
code | string | the identifier every service route takes |
name | string | the custom name when set, otherwise the product title |
customName | string or null | the name you gave it |
productShortname | string | pass it back as product in an order |
productTitle | string or null | product label |
category | string or null | category shortname, e.g. vps, minecraft |
status | string | ACTIVE, SUSPENDED, CANCELLED, DELETED |
providerType | string or null | vps, games (game server, see Game servers) or web (web hosting) |
autoRenew | boolean or null | null for a key on a shared account: billing stays the owner's |
nextBillingAt | integer or null | epoch milliseconds; null for a key on a shared account |
recurrence | string or null | billing cycle, e.g. monthly; null for a key on a shared account |
createdAt | integer | epoch milliseconds |
activatedAt | integer or null | epoch milliseconds |
GET /services/{code}
Permissions: services:read
Carries the fields above and adds:
| Field | Type | Notes |
|---|---|---|
provisioned | boolean | false while no infrastructure exists |
priceCents | integer or null | recurring price of one cycle, excluding tax; null for a key on a shared account |
taxCents | integer or null | tax on the same cycle; null for a key on a shared account |
currency | string or null | ISO 4217; null for a key on a shared account |
dunningState | string or null | NONE, RETRY, SUSPENSION_TRIGGERED, DELETION_TRIGGERED; null for a key on a shared account |
restartRequired | boolean | a resource change is waiting for a restart |
restartRequiredReason | string or null | |
configuration | object string → string | the configuration as ordered. Credentials and internal keys are stripped |
cancelledAt | integer or null | epoch milliseconds |
{ "data": { "code": "SRV-TIYMZT-8349", "name": "VPS 1", "status": "ACTIVE", "providerType": "vps", "provisioned": true, "autoRenew": true, "nextBillingAt": 1787960297645, "recurrence": "monthly", "priceCents": 500, "taxCents": 100, "currency": "EUR", "dunningState": "NONE", "restartRequired": false, "restartRequiredReason": null, "configuration": { "os": "debian", "osVersion": "13", "location": "paris", "cpuCores": "2", "ramSize": "2048", "diskSize": "20" }, "cancelledAt": null } }
GET /services/{code}/status
Permissions: services.metrics:read
Asks the infrastructure live. Allow up to two seconds.
Every field can be null: each service type (providerType) reports what it knows.
| Field | Type | Notes |
|---|---|---|
status | string | the machine's state: running, stopped, starting, stopping, restoring... Not a closed enum |
uptimeSeconds | integer | seconds since boot |
cpu | number | a fraction or a percentage depending on the service type |
cpuCount | number | |
memoryBytes, memoryMaxBytes | integer | bytes |
diskBytes | integer | bytes used. Only measured on a running machine. Absent does not mean zero: read diskUsageState |
diskMaxBytes | integer | bytes, the disk space sold |
diskTotalBytes | integer | bytes, the total of the machine's own filesystems. Smaller than diskMaxBytes when the partition does not span the whole disk |
diskUsageState | string | live (measured on the running machine), unsupported (the machine did not answer the measurement), unavailable (machine not running, or not measured yet) |
networkInBytes, networkOutBytes | integer | bytes |
ipv4 | string | on a game server, address:port |
ipv6 | string | |
extraIpv4 | array of string | additional addresses |
hostname | string | |
extra | object | the service type's own figures. Free-form, unversioned |
| Error | Status | When |
|---|---|---|
INSTANCE_NOT_PROVISIONED | 409 | no infrastructure yet |
ACTION_FAILED | 502 | the state could not be read |
PROVIDER_TIMEOUT | 504 | no answer in time |
GET /services/{code}/metrics/history
Permissions: services.metrics:read
{ "data": { "samples": [ { "ts": 1787903520000, "cpu": 0.1364, "mem": 1069400678, "maxmem": 2147483648, "netin": 4550, "netout": 69 } ] } }
samples is an array of free-form objects: the window, the step and the keys depend on the service type. It is empty when no history is available, which is the case on game servers and web hosting. Same errors as /status.
POST /services/{code}/power
Permissions: services.power:write
Rate: 20 a minute, per key and per service.
| Field | Type | Required | Values |
|---|---|---|---|
action | string | yes | start, stop, restart, kill |
stop asks the operating system to shut down cleanly. kill cuts the power at once (a game server's kill signal, a VPS's force stop): keep it for a machine that no longer answers stop, as unwritten data may be lost.
curl -X POST -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" -d '{"action":"restart"}' \ https://api.freshperf.fr/v1/services/SRV-TJUAQ1-1951/power
{ "data": { "status": "SUCCESS", "message": "Power signal accepted" } }
| Field | Values |
|---|---|
status | SUCCESS when done, PENDING when the infrastructure is still working on it |
message | an informative sentence, or null |
On PENDING, read /status again every 5 to 10 seconds.
| Error | Status | When |
|---|---|---|
VALIDATION_ERROR:action | 400 | action absent or outside the list |
ACTION_UNSUPPORTED | 400 | service type without power control |
SERVICE_NOT_ACTIVE | 409 | service suspended or cancelled |
INSTANCE_NOT_PROVISIONED | 409 | no infrastructure yet |
POST /services/{code}/console/command
Permissions: services.console:write
Game servers only.
| Field | Type | Required |
|---|---|---|
command | string | yes, non-blank |
curl -X POST -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" -d '{"command":"say hello"}' \ https://api.freshperf.fr/v1/services/SRV-TJUAQ1-1951/console/command
{ "data": { "status": "SUCCESS", "message": "Command sent" } }
An empty command: 400 VALIDATION_ERROR:command. On a VPS: 400 ACTION_UNSUPPORTED. On a stopped server the command is refused and the answer is 502 ACTION_FAILED.
Backups
The four routes always answer the same shape: {"data": {"status", "message", "result"}}, where result carries the detail of the operation.
GET /services/{code}/backups
Permissions: vps.backups:read
Answers even on a suspended service.
{ "data": { "status": "SUCCESS", "message": "OK", "result": { "customerEnabled": true, "internalEnabled": true, "vpsBusy": false, "limits": { "max": 6, "used": 2 }, "customer": [ { "id": "9b5d3938-cbd9-4946-8357-05badcdf6c33", "source": "CUSTOMER", "note": null, "status": "COMPLETED", "ctime": 1786823445, "sizeBytes": 21474837581, "protected": false, "createdAt": "2026-08-15T19:50:45.282411", "createdAtEpochMs": 1786823445282 } ], "internal": [] } } }
result field | Type | Notes |
|---|---|---|
customerEnabled | boolean | you may create backups on this service |
internalEnabled | boolean | FreshPerf's automatic backups are offered for restore |
vpsBusy | boolean | an operation is already running on the VPS |
limits.max, limits.used | integer | number of customer backups allowed, and taken |
customer[] | array | your backups, newest first, a backup still being created at the top |
internal[] | array | the automatic backups, newest first. Empty when none is available |
| Backup field | Type | Notes |
|---|---|---|
id | string | customer[] only. Opaque identifier, the one delete and restore take |
backupRef | string | internal[] only. Opaque reference, to send back as it is to restore: its shape is not guaranteed |
source | string | CUSTOMER or INTERNAL |
status | string | PENDING while being created, then COMPLETED. Always COMPLETED in internal[] |
note | string or null | customer[] only: the label given at creation |
ctime | integer or null | epoch seconds; null until the backup is finished |
sizeBytes | integer or null | bytes |
protected | boolean | backup marked as protected |
createdAt | string or null | customer[] only: date and time without a time zone. Prefer createdAtEpochMs |
createdAtEpochMs | integer or null | customer[] only: epoch milliseconds |
POST /services/{code}/backups
Permissions: vps.backups:write
| Field | Type | Required | Values |
|---|---|---|---|
note | string or null | no | 200 characters at most |
{ "data": { "status": "PENDING", "message": "VPS backup in progress", "result": { "taskId": "d3b780a2-308f-40bf-95a2-0316d8872721", "status": "PENDING" } } }
| Error | Status | When |
|---|---|---|
NOTE_TOO_LONG | 400 | note beyond 200 characters |
SERVICE_NOT_ACTIVE | 400 | service suspended or cancelled |
SERVICE_IN_DUNNING | 400 | service in dunning |
INSTANCE_NOT_PROVISIONED | 400 | no infrastructure yet |
BACKUP_DISABLED | 400 | customer backups are not available on this service |
LIMIT_REACHED | 400 | backup quota reached |
BACKUP_IN_PROGRESS, VPS_BUSY | 400 | a backup, a restore or another operation is already running on the VPS |
API_RATE_LIMITED | 429 | too many backup operations in a short time. Retry-After gives the wait in seconds |
BACKUP_FAILED, BACKUP_TIMEOUT | 502 | the backup could not be started |
DELETE /services/{code}/backups/{backupId}
Permissions: vps.backups:write
backupId comes from result.customer[].id. The backups in internal[] cannot be deleted.
| Error | Status | When |
|---|---|---|
BACKUP_NOT_FOUND | 400 | unknown identifier |
SERVICE_NOT_ACTIVE | 400 | service suspended or cancelled |
BACKUP_BUSY, BACKUP_IN_PROGRESS, VPS_BUSY | 400 | an operation is already running on this backup or on the VPS |
INSTANCE_NOT_PROVISIONED | 400 | no infrastructure yet |
BACKUP_DELETE_FAILED, BACKUP_FAILED, BACKUP_TIMEOUT | 502 | the deletion could not be done |
POST /services/{code}/backups/restore
Permissions: vps.backups:write
Overwrites the disk.
| Field | Type | Required | Values | Where it comes from |
|---|---|---|---|---|
source | string | yes | CUSTOMER or INTERNAL | - |
backupId | string | yes when source is CUSTOMER | - | result.customer[].id |
backupRef | string | yes when source is INTERNAL | - | result.internal[].backupRef |
Same refusals as creation, except NOTE_TOO_LONG, LIMIT_REACHED and BACKUP_FAILED, plus:
| Error | Status | When |
|---|---|---|
MISSING_FIELDS | 400 | source absent or outside the list, or its matching identifier is missing |
BACKUP_NOT_FOUND | 400 | unknown backupId or backupRef |
BACKUP_DISABLED | 400 | that source is not available on this service |
RESTORE_BUSY | 400 | a restore could not start. Retry later |
RESTORE_FAILED | 502 | the restore could not be started |
POST /services/{code}/reinstall
Permissions: vps.reinstall:write on a VPS, games.reinstall:write on a game server
Rate: 2 a minute, per key and per service. Refused calls count.
Destroys the disk. On a game server it resets the server and the body may be empty.
| Field | Type | Required | Values | Where it comes from |
|---|---|---|---|---|
os | string | yes on a VPS | the composite <family>-<version> value | GET /catalog/products/{shortname} → the kind: "os-picker" characteristic, options field |
authType | string | yes on a VPS | PASSWORD or SSH_KEY | - |
authValue | string | yes on a VPS | the password, or an OpenSSH public key line | - |
authValue is stored encrypted, never returned, and this call is never logged with its body.
curl -X POST -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" \ -d '{"os":"debian-13","authType":"SSH_KEY","authValue":"ssh-ed25519 AAAAC3Nza... admin@laptop"}' \ https://api.freshperf.fr/v1/services/SRV-TIYMZT-8349/reinstall
{ "data": { "status": "PENDING", "message": "reinstalling" } }
| Error | Status | When |
|---|---|---|
MISSING_FIELDS | 400 | one of the three fields is missing on a VPS |
INVALID_OS | 400 | os is not a well-formed image name |
OS_FAMILY_MISMATCH | 400 | switching between Windows and Linux: a reinstall keeps the family installed |
WINDOWS_SSH_UNSUPPORTED | 400 | authType: SSH_KEY on a Windows image, which only takes a password |
UNKNOWN_OS | 400 | an image this service's range does not offer |
UNKNOWN_OS | 502 | the range offers it, but the image is not available yet |
INVALID_AUTH_TYPE | 400 | authType outside the list |
SERVICE_NOT_ACTIVE, SERVICE_IN_DUNNING, INSTANCE_NOT_PROVISIONED | 400 | state of the service |
API_RATE_LIMITED | 429 | more than 2 calls in the minute |
REINSTALL_FAILED, REINSTALL_TIMEOUT | 502 | the reinstall could not be started |
GET /services/{code}/addons
Permissions: services.addons:read
{ "data": { "addons": [ { "shortname": "extra-saves", "title": "Additional saves", "kind": "BACKUP_SLOTS", "status": "ACTIVE", "quantity": 1, "unitPriceCents": 399, "unitTaxCents": 80, "linePriceCents": 399, "lineTaxCents": 80, "nextCycleLinePriceCents": 399, "nextCycleLineTaxCents": 80, "pendingRemovalQuantity": 0 } ], "available": [ { "shortname": "extra-ram-1gb", "title": { "fr-fr": "+1 Go RAM", "en-us": "+1 Gb RAM" }, "kind": "RESOURCE_DELTA", "resourceKey": "ramSize", "unitDelta": 1024, "unitPriceCents": 200, "maxQuantity": 10 } ], "recurringTotalCents": 479 } }
| Field | Contents |
|---|---|
addons | the add-ons the service already carries |
available | those it may still take. maxQuantity of 0 means unlimited |
recurringTotalCents | the service's recurring total including add-ons, excluding tax |
Adding or removing an add-on happens in the dashboard.
PATCH /services/{code}
Permissions: services:write
| Field | Type | Required | Values |
|---|---|---|---|
customName | string or null | no | 32 characters at most. An empty string clears the name |
autoRenew | boolean | no | true only |
curl -X PATCH -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" -d '{"customName":"prod-eu-1"}' \ https://api.freshperf.fr/v1/services/SRV-TJUAQ1-1951
Answers the whole service, like GET /services/{code}.
| Error | Status | When |
|---|---|---|
CUSTOM_NAME_TOO_LONG | 400 | beyond 32 characters |
RENEWAL_CANCELLATION_NOT_AVAILABLE_VIA_API | 400 | autoRenew: false. Stopping a renewal happens in the dashboard |
RENEWAL_NOT_AVAILABLE_ON_TRIAL | 400 | autoRenew: true on a trial. A trial continues by paying its continuation invoice |
SERVICE_NOT_ACTIVE | 400 | autoRenew: true on a service that is not ACTIVE |
POST /services/{code}/renew
Permissions: services:write and billing.invoices:pay, plus billing.saved_methods:charge as soon as the funding touches a card.
Required header: Idempotency-Key.
Charges the next cycle now and moves the billing date forward.
| Field | Type | Required | Values | Where it comes from |
|---|---|---|---|---|
method | string | no, default account_default | account_default, balance, saved_method | - |
paymentMethodId | integer | yes when saved_method | > 0 | GET /payment-methods → id |
method | Effect |
|---|---|
account_default | applies the account's rule: the balance when opted in and sufficient, otherwise the default payment method. Going through the card needs billing.saved_methods:charge |
balance | the prepaid balance alone. No fallback to a card |
saved_method | charges the named method |
curl -X POST -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: renew-SRV-TJUAQ1-1951-2026-08" \ -d '{"method":"balance"}' \ https://api.freshperf.fr/v1/services/SRV-TJUAQ1-1951/renew
{ "data": { "status": "CHARGED", "serviceCode": "SRV-TJUAQ1-1951", "nextBillingAt": 1793091315189, "amountCents": 360 } }
status is only ever CHARGED: any other outcome is an error. amountCents is what was charged, tax included.
| Error | Status | When |
|---|---|---|
VALIDATION_ERROR:method | 400 | method outside the list |
PAYMENT_METHOD_ID_REQUIRED | 400 | saved_method without paymentMethodId |
PAYMENT_METHOD_NOT_FOUND | 404 | that method is not on the account |
INSUFFICIENT_BALANCE | 402 | balance too short |
NO_PAYMENT_METHOD | 402 | account_default with no usable method |
PAYMENT_METHOD_NOT_ACTIVE | 400, 402 | method expired or blocked: 400 when the named method already is, 402 when it is refused at charge time |
RENEWAL_FAILED | 402 | the charge failed for another reason |
API_KEY_SPENDING_CAP_EXCEEDED | 403 | the key's cap does not cover the cycle |
SERVICE_NOT_ACTIVE | 409 | service neither active nor reactivatable |
RENEWAL_IN_PROGRESS | 409 | a renewal of the same service is already running |
RENEWAL_TOO_FREQUENT | 429 | less than a minute since the previous one |
POST /services/{code}/actions/{action}
Permissions: they depend on the action sent.
The raw gateway for service actions. It is how the firewall and reverse DNS are reached, since neither has a dedicated route.
| Action | Permission |
|---|---|
power, start_vps, stop_vps, force_stop_vps, reboot_vps | services.power:write |
send_console_command | services.console:write |
backup_list | vps.backups:read |
backup_create, backup_delete, backup_restore | vps.backups:write |
firewall_list | vps.firewall:read |
firewall_create, firewall_update, firewall_move, firewall_delete | vps.firewall:write |
rdns | vps.rdns:write, including for op: "get" |
features | services:read |
web_overview | services:read (web hosting) |
web_backups | web.backups:write (web hosting) |
No other action is reachable. There is no firewall_add, firewall_set or firewall_remove: a rule is created, edited and deleted with firewall_create, firewall_update and firewall_delete.
Every other action answers 403 API_ACTION_NOT_ALLOWED whatever the key holds. Game servers have their routes under /services/{code}/games (see Game servers), web hosting under /services/{code}/web.
| Field | Type | Required |
|---|---|---|
arguments | object | no. Contents specific to each action |
curl -X POST -H "Authorization: Bearer $FRESHPERF_KEY" \ -H "Content-Type: application/json" \ -d '{"arguments":{"op":"set","address":"203.0.113.224","hostname":"vps.example.com"}}' \ https://api.freshperf.fr/v1/services/SRV-TIYMZT-8349/actions/rdns
{ "data": { "status": "SUCCESS", "message": "Action completed", "result": { "configured": true, "entries": [ { "family": "ipv4", "address": "203.0.113.224", "hostname": "vps.example.com", "zoneConfigured": true } ] } } }
rdns takes op as get, set or delete, plus address (one of the addresses /status returns) and, for set, hostname. The arguments of the firewall_* actions have their own shape: read firewall_list to see the shape of a rule before writing one.
| Error | Status | When |
|---|---|---|
INVALID_ACTION | 400 | action empty or starting with _ |
ACTION_UNSUPPORTED | 400 | the action does not exist on this type of service (features or send_console_command on a VPS) |
API_ACTION_NOT_ALLOWED:<action> | 403 | action the platform does not classify, or one with no public permission |
SERVICE_NOT_ACTIVE | 409 | service suspended or cancelled |
SERVICE_IN_DUNNING | 409 | backup_create or backup_restore while an invoice is in dunning |
INSTANCE_NOT_PROVISIONED | 409 | no infrastructure yet |
a business marker, e.g. FIREWALL_INVALID_ARGUMENT | 409 | the action was refused |
API_RATE_LIMITED | 429 | too many actions in a short time. Retry-After gives the wait in seconds |
ACTION_FAILED | 502 | the action failed |
PROVIDER_TIMEOUT | 504 | no answer in time |
Prefer the typed routes (/power, /backups, /reinstall, /console/command) wherever they exist: their contract is stable and fully documented.