Backup API 🟡 BETA

The Backup API provides endpoints for creating, managing, and restoring backups of bot data and configurations.

Status: Roadmap

This API is on the development roadmap. The endpoints documented below represent the planned interface design.

Base URL

http://localhost:9000/api/v1/backup

Authentication

Uses the standard botserver authentication mechanism with administrator-level permissions required.

Endpoints

Backup Operations

MethodEndpointDescription
POST/api/v1/backup/createCreate a new backup
GET/api/v1/backup/listList all backups
GET/api/v1/backup/{backup_id}Get backup details
DELETE/api/v1/backup/{backup_id}Delete a backup

Restore Operations

MethodEndpointDescription
POST/api/v1/backup/restore/{backup_id}Restore from backup
GET/api/v1/backup/restore/{job_id}/statusCheck restore status

Scheduling

MethodEndpointDescription
POST/api/v1/backup/scheduleCreate backup schedule
GET/api/v1/backup/scheduleList backup schedules
PUT/api/v1/backup/schedule/{schedule_id}Update schedule
DELETE/api/v1/backup/schedule/{schedule_id}Delete schedule

Request Examples

Create Backup

backup_options = NEW OBJECT
backup_options.type = "full"
backup_options.include_files = true
backup_options.include_database = true

result = POST "/api/v1/backup/create", backup_options
TALK "Backup created: " + result.backup_id

List Backups

backups = GET "/api/v1/backup/list"
FOR EACH backup IN backups
    TALK backup.id + " - " + backup.created_at + " (" + backup.size + ")"
NEXT

Restore from Backup

restore_options = NEW OBJECT
restore_options.target = "staging"

result = POST "/api/v1/backup/restore/backup-123", restore_options
TALK "Restore job started: " + result.job_id

Schedule Automated Backup

schedule = NEW OBJECT
schedule.cron = "0 2 * * *"
schedule.type = "incremental"
schedule.retention_days = 30

POST "/api/v1/backup/schedule", schedule
TALK "Backup schedule created"

Backup Types

TypeDescription
fullComplete backup of all data
incrementalOnly changes since last backup
differentialChanges since last full backup

Response Codes

CodeDescription
200Success
201Backup created
202Restore job accepted
400Bad Request
401Unauthorized
403Forbidden
404Backup not found
409Restore already in progress
500Internal Server Error

Required Permissions

OperationRequired Role
Create backupadmin or backup_operator
List backupsadmin or backup_operator
Restore backupadmin
Manage schedulesadmin
Delete backupadmin