Update Automatic Backup Config
This API updates the automatic backup configuration, including its scope, destination, schedule, and retention settings.
Endpoint Details
| URL | /v1/backup/config |
| Method | PUT |
| Authorization | Bearer Token |
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/json |
Request Body
Use the following format to make a request:
JSON Request
{
"scopes": [
1,
2,
3,
4
],
"destination_type": 1,
"local_path": "/tmp/backups/",
"s3_config": {
"bucket_name": "",
"region": "",
"access_key_id": "",
"secret_access_key": "",
"path_prefix": ""
},
"schedule": {
"schedule_type": 2,
"time": "10:00",
"weekly_days": [
1,
2,
3
],
"monthly_dates": [],
"include_last_day_of_month": false
},
"retention_days": 30
}
Body Parameters
| Parameter | Type | Description |
|---|---|---|
| scopes | Array | List of scope codes to include in the automatic backup |
| destination_type | Integer | Type of destination where the backup file is stored |
| local_path | String | Local path where the backup file is stored, used for local disk destinations |
| s3_config | Object | S3 destination configuration, used for S3 destinations |
| s3_config.bucket_name | String | Name of the S3 bucket where the backup file is stored |
| s3_config.region | String | Region of the S3 bucket |
| s3_config.access_key_id | String | Access key ID used to authenticate to S3 |
| s3_config.secret_access_key | String | Secret access key used to authenticate to S3 |
| s3_config.path_prefix | String | Path prefix applied to the backup file within the bucket |
| schedule | Object | Schedule configuration for the automatic backup |
| schedule.schedule_type | Integer | Type of schedule used for the automatic backup |
| schedule.time | String | Time of day the backup runs (HH:MM) |
| schedule.weekly_days | Array | Days of the week the backup runs, used when schedule_type is weekly |
| schedule.monthly_dates | Array | Dates of the month the backup runs, used when schedule_type is monthly |
| schedule.include_last_day_of_month | Boolean | Indicates whether the backup also runs on the last day of the month, used for monthly schedules |
| retention_days | Integer | Number of days backups are retained before removal |
Response
Here is an example response when the data is successfully updated:
Response
{
"data": {
"id": "49b51474-8bfb-4762-937c-144ccadb72d6",
"scopes": [
1,
2,
3,
4
],
"destination_type": 1,
"destination_path": "/tmp/backups/",
"schedule": {
"schedule_type": 2,
"time": "10:00",
"weekly_days": [
1,
2,
3
]
},
"retention_days": 30,
"is_enabled": true,
"created_at": 1779332170,
"updated_at": 1784780812,
"last_run_at": 1784779200,
"next_run_at": 1784862000,
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_by_name": "Admin Aplikasi",
"encryption_key": "Q5AjARpdOecvFP6CH4HCAlks+OeB7oQr1mpRLDN6YUs=",
"s3_config": {}
}
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
| id | UUID | Unique identifier of the backup configuration |
| scopes | Array | List of scope codes included in the backup |
| destination_type | Integer | Type of backup destination |
| destination_path | String | Path where the backup files are stored |
| schedule | Object | Schedule configuration for the automatic backup |
| schedule.schedule_type | Integer | Type of schedule used for the automatic backup |
| schedule.time | String | Time of day the backup runs (HH:MM) |
| schedule.weekly_days | Array | Days of the week the backup runs, used when schedule_type is weekly |
| schedule.monthly_dates | Array | Dates of the month the backup runs, used when schedule_type is monthly |
| retention_days | Integer | Number of days backups are retained before removal |
| is_enabled | Boolean | Indicates whether the automatic backup is enabled |
| created_at | Integer | Creation timestamp in Unix format |
| updated_at | Integer | Last update timestamp in Unix format |
| last_run_at | Integer | Timestamp of the last backup run in Unix format |
| next_run_at | Integer | Timestamp of the next scheduled backup run in Unix format |
| created_by | UUID | Identifier of the user who created the configuration |
| created_by_name | String | Display name of the user who created the configuration |
| encryption_key | String | Encryption key used to encrypt the backup files |
| s3_config | Object | S3 destination configuration, used when the destination is S3 |
info
- A valid Bearer Token is required to access this endpoint.
- The
scopesarray uses the following codes:1= System Configuration2= Keys3= Audit Log4= System Log
- The
destination_typedetermines where the backup file is stored:1= Local disk — stores the backup file directly on the server's local storage. Provide thelocal_pathvalue.3= S3 — stores the backup in an Amazon S3-compatible object storage. Provide thes3_configobject.
- The
schedule_typedetermines how often the automatic backup runs:1= Daily2= Weekly — theweekly_daysarray specifies which days of the week the backup runs3= Monthly — themonthly_datesarray specifies which dates of the month the backup runs
- The
weekly_daysarray uses the following codes:0= Sunday1= Monday2= Tuesday3= Wednesday4= Thursday5= Friday6= Saturday
- When
schedule.include_last_day_of_monthis set totrue, the backup also runs on the last day of the month for monthly schedules. - Unix timestamp fields can be converted to a human-readable date and time format as needed.