API / Method reference / Backups and schedules

Backups and schedules

Backups and scheduled tasks.

GET/projects/:id/services/:serviceId/backups

List backups

Scope: servers:read
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService 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/backups

Create a backup

Made in the background. At the limit, the oldest unlocked one is replaced.

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService 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/restore

Restore a backup

The server's current files are replaced by the backup's.

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
backupIdrequiredpath · stringBackup 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/download

Download link

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
backupIdrequiredpath · stringBackup 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/lock

Lock / unlock

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
backupIdrequiredpath · stringBackup 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/rename

Rename a backup

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
backupIdrequiredpath · stringBackup 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/:backupId

Delete a backup

Scope: servers:backups
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
backupIdrequiredpath · stringBackup 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/cron

Scheduled tasks

Scope: servers:read
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService 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/cron

Create a task

Scope: servers:cron
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
namerequiredbody · stringTask name
actionrequiredbody · stringstart, stop, restart or command
commandbody · stringConsole command when action is command
minute / hour / dayOfMonth / month / dayOfWeekrequiredbody · stringCron fields in the account timezone; * means any
isActive / onlyWhenOnlinebody · booleanWhether 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/:cronId

Change a task

Scope: servers:cron
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
cronIdrequiredpath · stringTask ID (from the task list)
namerequiredbody · stringTask name
actionrequiredbody · stringstart, stop, restart or command
commandbody · stringConsole command when action is command
minute / hour / dayOfMonth / month / dayOfWeekrequiredbody · stringCron fields in the account timezone; * means any
isActive / onlyWhenOnlinebody · booleanWhether 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/:cronId

Delete a task

Scope: servers:cron
Parameters
idrequiredpath · stringProject number (from GET /projects), or ticket number
serviceIdrequiredpath · stringService number (from GET /projects/:id/services)
cronIdrequiredpath · stringTask 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

400bad_requestInvalid body or parameters
401token_invalidThe token is wrong, revoked or expired
403token_scope_missingThe token lacks the scope
403token_project_forbiddenThe project or service is outside the token’s limits
404not_foundNo such project, service or object
429token_rate_limitedToo many requests, see Retry-After
503upstream_unavailableThe panel or node didn't answer — retry later