API / Method reference / Backups and schedules
Backups and schedules
Backups and scheduled tasks.
Base URL:
https://sourhost.net/api/v1·Auth: Authorization: Bearer sh_live_…GET
/projects/:id/services/:serviceId/backups— List backupsPOST/projects/:id/services/:serviceId/backups— Create a backupPOST/projects/:id/services/:serviceId/backups/:backupId/restore— Restore a backupGET/projects/:id/services/:serviceId/backups/:backupId/download— Download linkPOST/projects/:id/services/:serviceId/backups/:backupId/lock— Lock / unlockPUT/projects/:id/services/:serviceId/backups/:backupId/rename— Rename a backupDELETE/projects/:id/services/:serviceId/backups/:backupId— Delete a backupGET/projects/:id/services/:serviceId/cron— Scheduled tasksPOST/projects/:id/services/:serviceId/cron— Create a taskPATCH/projects/:id/services/:serviceId/cron/:cronId— Change a taskDELETE/projects/:id/services/:serviceId/cron/:cronId— Delete a taskGET
/projects/:id/services/:serviceId/backupsList backups
Scope:
servers:readParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
Example request
curl "https://sourhost.net/api/v1/projects/12/services/34/backups" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
HTTP
HTTP/2 200 OK
{
"items": [
{
"id": "2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c",
"name": "Перед турниром",
"isSuccessful": true,
"isLocked": true,
"bytes": 734003200,
"createdAt": "2026-11-10T02:00:00Z",
"completedAt": "2026-11-10T02:03:12Z"
}
]
}POST
/projects/:id/services/:serviceId/backupsCreate a backup
Made in the background. At the limit, the oldest unlocked one is replaced.
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/backups" \
-H "Authorization: Bearer $SOURHOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Перед обновлением","isLocked":false}'Response
204 Empty response
POST
/projects/:id/services/:serviceId/backups/:backupId/restoreRestore a backup
The server's current files are replaced by the backup's.
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
backupIdrequired | path · string | Backup ID (from the backup list) |
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/backups/2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c/restore" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
GET
/projects/:id/services/:serviceId/backups/:backupId/downloadDownload link
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
backupIdrequired | path · string | Backup ID (from the backup list) |
Example request
curl "https://sourhost.net/api/v1/projects/12/services/34/backups/2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c/download" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
HTTP
HTTP/2 200 OK
{
"url": "https://de-n3.sourhost.net:8080/download/backup?token=…"
}POST
/projects/:id/services/:serviceId/backups/:backupId/lockLock / unlock
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
backupIdrequired | path · string | Backup ID (from the backup list) |
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/backups/2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c/lock" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
PUT
/projects/:id/services/:serviceId/backups/:backupId/renameRename a backup
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
backupIdrequired | path · string | Backup ID (from the backup list) |
Example request
curl -X PUT "https://sourhost.net/api/v1/projects/12/services/34/backups/2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c/rename" \
-H "Authorization: Bearer $SOURHOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Финал"}'Response
204 Empty response
DELETE
/projects/:id/services/:serviceId/backups/:backupIdDelete a backup
Scope:
servers:backupsParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
backupIdrequired | path · string | Backup ID (from the backup list) |
Example request
curl -X DELETE "https://sourhost.net/api/v1/projects/12/services/34/backups/2f6c1a9e-4b7d-4c1e-9a3b-6d5e8f7a1b2c" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
GET
/projects/:id/services/:serviceId/cronScheduled tasks
Scope:
servers:readParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
Example request
curl "https://sourhost.net/api/v1/projects/12/services/34/cron" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
HTTP
HTTP/2 200 OK
{
"items": [
{
"id": "5",
"name": "Ночной рестарт",
"action": "restart",
"command": "",
"isActive": true,
"onlyWhenOnline": false,
"minute": "0",
"hour": "5",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"lastRunAt": "2026-11-11T05:00:00+02:00",
"nextRunAt": "2026-11-12T05:00:00+02:00"
}
]
}POST
/projects/:id/services/:serviceId/cronCreate a task
Scope:
servers:cronParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
namerequired | body · string | Task name |
actionrequired | body · string | start, stop, restart or command |
command | body · string | Console command when action is command |
minute / hour / dayOfMonth / month / dayOfWeekrequired | body · string | Cron fields in the account timezone; * means any |
isActive / onlyWhenOnline | body · boolean | Whether it runs; only while the server is running |
Example request
curl -X POST "https://sourhost.net/api/v1/projects/12/services/34/cron" \
-H "Authorization: Bearer $SOURHOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Ночной рестарт","action":"restart","command":"","isActive":true,"onlyWhenOnline":false,"minute":"0","hour":"5","dayOfMonth":"*","month":"*","dayOfWeek":"*"}'Response
204 Empty response
PATCH
/projects/:id/services/:serviceId/cron/:cronIdChange a task
Scope:
servers:cronParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
cronIdrequired | path · string | Task ID (from the task list) |
namerequired | body · string | Task name |
actionrequired | body · string | start, stop, restart or command |
command | body · string | Console command when action is command |
minute / hour / dayOfMonth / month / dayOfWeekrequired | body · string | Cron fields in the account timezone; * means any |
isActive / onlyWhenOnline | body · boolean | Whether it runs; only while the server is running |
Example request
curl -X PATCH "https://sourhost.net/api/v1/projects/12/services/34/cron/5" \
-H "Authorization: Bearer $SOURHOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Ночной рестарт","action":"restart","command":"","isActive":true,"onlyWhenOnline":false,"minute":"0","hour":"6","dayOfMonth":"*","month":"*","dayOfWeek":"*"}'Response
204 Empty response
DELETE
/projects/:id/services/:serviceId/cron/:cronIdDelete a task
Scope:
servers:cronParameters
idrequired | path · string | Project number (from GET /projects), or ticket number |
serviceIdrequired | path · string | Service number (from GET /projects/:id/services) |
cronIdrequired | path · string | Task ID (from the task list) |
Example request
curl -X DELETE "https://sourhost.net/api/v1/projects/12/services/34/cron/5" \
-H "Authorization: Bearer $SOURHOST_TOKEN"Response
204 Empty response
Common errors
Any method can answer with these. More on errors
| 400 | bad_request | Invalid body or parameters |
| 401 | token_invalid | The token is wrong, revoked or expired |
| 403 | token_scope_missing | The token lacks the scope |
| 403 | token_project_forbidden | The project or service is outside the token’s limits |
| 404 | not_found | No such project, service or object |
| 429 | token_rate_limited | Too many requests, see Retry-After |
| 503 | upstream_unavailable | The panel or node didn't answer — retry later |