Skip to content

How to manage server backups via API

Before using the API to manage your Server Backups, please ensure you meet the requirements for authentication described in the prerequisites below.

Activate the Server Backup Management Service

Section titled “Activate the Server Backup Management Service”

To activate the Server Backup Management Service for a new server, send a request as shown below, including the portalProjectId, region and serverId in the URL.

POST https://server-backup.api.stackit.cloud/v2/projects/{portalProjectId}/regions/{region}/servers/{serverId}/service

Activate the Server Backup Management Service with default backup schedule

Section titled “Activate the Server Backup Management Service with default backup schedule”

If you want to activate the Server Backup Management Service for a new server with the default backup schedule already included, first send the following request, including the portalProjectId and region in the URL to fetch the proper backup policy ID:

GET https://server-backup.api.stackit.cloud/v2/projects/{portalProjectId}/regions/{region}/backup-policies

Afterwards send a request to activate the Server Backup Management Service and include the portalProjectId, region, serverId and backupPolicyId in the request body:

POST https://server-backup.api.stackit.cloud/v2/projects/{portalProjectId}/regions/{region}/servers/{serverId}/service
{
"backupPolicyId": "2ab33ea4-9b4b-492c-8679-3d664091c195"
}

This will enable the backup schedule with a 14-day retention period for all volumes of this server.

When you are creating backup schedules, you have to provide recurrence rules for calendar dates in the rrule field according to the Internet Calendaring and Scheduling Core Object Specification (iCalendar SRFC5545 ).

Please find below an example of the request which needs to be sent with provided portalProjectId, region, serverId and rrule:

POST https://server-backup.api.stackit.cloud/v2/projects/{portalProjectId}/regions/{region}/servers/{serverId}/backup-schedules
{
"backupProperties": {
"name": "Daily Backup",
"retentionPeriod": 3,
"volumeIds": [
"58335311-6acf-46c5-8652-cb96cd63181e",
"38345f49-047b-437d-83a1-458f04fa3182"
]
},
"enabled": true,
"name": "Daily Schedule",
"rrule": "DTSTART;TZID=Europe/Sofia:20200803T023000 RRULE:FREQ=DAILY;INTERVAL=1"
}

Also visit the full Server Backup Management API documentation , including all available endpoints and examples.