> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://americancloud.com/docs/api/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://americancloud.com/docs/api/_mcp/server.

# Update a backup schedule

PUT https://api.americancloud.com/api/v1/databases/clusters/{clusterId}/backups/schedule
Content-Type: application/json

Reference: https://americancloud.com/docs/api/api-reference/database-backups/update-schedule-database-backups

## Authentication

- `X-API-Client-ID` header (required) — API Client ID
- `X-API-Client-Secret` header (required) — API Client Secret

## Request

### Path parameters

- `clusterId` (string, required) — Database cluster ID

### Body (application/json)

This endpoint expects a ModifyBackupScheduleRequestDto.

- `scheduleName` (string, required) — Name of the schedule group being modified.
- `backupPolicyName` (string, required) — Backup policy these schedules will be applied to.
- `schedules` (list of BackupScheduleItemDto, required) — Schedule entries that make up the policy.
- `pitrEnabled` (boolean, required, default: false) — Whether point-in-time recovery is enabled for the cluster.

## Response

### 202

Backup schedule update accepted

## Errors

### 400 Bad Request Error

The request was malformed or failed validation.

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

### 401 Unauthorized Error

Authentication credentials were missing or invalid.

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

### 403 Forbidden Error

The authenticated principal is not permitted to perform this action.

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

### 404 Not Found Error

Database cluster not found

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

### 409 Conflict Error

The infrastructure cluster cannot answer yet. `code` is `infra_not_ready` while the cluster starts — retry once it is running — or `infra_deleting` while the cluster is being removed. Cluster is currently being modified

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

### 500 Internal Server Error

An unexpected error occurred on the server.

- `statusCode` (double, required) — HTTP status code.
- `message` (ApiErrorDtoMessage, required) — Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.
- `error` (string, optional) — Short HTTP error label.
- `code` (string, optional) — Machine-readable reason for the error. Match on this value rather than on `message`, which can be reworded at any time. Present on the errors that have more than one cause for the same status code; omitted otherwise.
- `errors` (list of ValidationErrorItemDto, optional) — Per-field validation details. Present on 400 responses produced by request-body validation; omitted otherwise.
- `snapshots` (list of BlockingSnapshotDto, optional) — The snapshots that block a delete. Present on a 409 whose `code` is `volume_has_snapshots`; omitted otherwise.

## Types

### BackupScheduleItemDto

- `name` (string, required) — Name of this schedule entry.
- `backupMethod` (enum, required) — Backup method to use for runs of this schedule.
  - Allowed values: `xtrabackup`, `pg-basebackup`, `datafile`
- `cronExpression` (string, required) — Cron expression describing when the schedule fires.
- `retentionPeriod` (string, optional, default: 30d) — How long to keep each backup produced by this schedule.
- `enabled` (boolean, optional, default: true) — Whether this schedule is active.

### ApiErrorDtoMessage

Human-readable error message. A single string for most errors, or an array of strings when the request failed multiple validation checks.

### ValidationErrorItemDto

- `field` (string, required) — Dotted path to the field that failed validation.
- `message` (string, required) — Human-readable validation message for this field.

### BlockingSnapshotDto

- `id` (string, required) — Snapshot ID.
- `name` (string, required) — Snapshot name.

## Examples

**Request**

```json
{
  "scheduleName": "production-backups",
  "backupPolicyName": "default-backup-policy",
  "schedules": [
    {
      "name": "nightly-full",
      "backupMethod": "pg-basebackup",
      "cronExpression": "0 3 * * *"
    }
  ],
  "pitrEnabled": false
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule"

payload = {
    "scheduleName": "production-backups",
    "backupPolicyName": "default-backup-policy",
    "schedules": [
        {
            "name": "nightly-full",
            "backupMethod": "pg-basebackup",
            "cronExpression": "0 3 * * *"
        }
    ],
    "pitrEnabled": False
}
headers = {
    "X-API-Client-ID": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule';
const options = {
  method: 'PUT',
  headers: {'X-API-Client-ID': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"scheduleName":"production-backups","backupPolicyName":"default-backup-policy","schedules":[{"name":"nightly-full","backupMethod":"pg-basebackup","cronExpression":"0 3 * * *"}],"pitrEnabled":false}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule"

	payload := strings.NewReader("{\n  \"scheduleName\": \"production-backups\",\n  \"backupPolicyName\": \"default-backup-policy\",\n  \"schedules\": [\n    {\n      \"name\": \"nightly-full\",\n      \"backupMethod\": \"pg-basebackup\",\n      \"cronExpression\": \"0 3 * * *\"\n    }\n  ],\n  \"pitrEnabled\": false\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-API-Client-ID", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-API-Client-ID"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"scheduleName\": \"production-backups\",\n  \"backupPolicyName\": \"default-backup-policy\",\n  \"schedules\": [\n    {\n      \"name\": \"nightly-full\",\n      \"backupMethod\": \"pg-basebackup\",\n      \"cronExpression\": \"0 3 * * *\"\n    }\n  ],\n  \"pitrEnabled\": false\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule")
  .header("X-API-Client-ID", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"scheduleName\": \"production-backups\",\n  \"backupPolicyName\": \"default-backup-policy\",\n  \"schedules\": [\n    {\n      \"name\": \"nightly-full\",\n      \"backupMethod\": \"pg-basebackup\",\n      \"cronExpression\": \"0 3 * * *\"\n    }\n  ],\n  \"pitrEnabled\": false\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule', [
  'body' => '{
  "scheduleName": "production-backups",
  "backupPolicyName": "default-backup-policy",
  "schedules": [
    {
      "name": "nightly-full",
      "backupMethod": "pg-basebackup",
      "cronExpression": "0 3 * * *"
    }
  ],
  "pitrEnabled": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Client-ID' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-API-Client-ID", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"scheduleName\": \"production-backups\",\n  \"backupPolicyName\": \"default-backup-policy\",\n  \"schedules\": [\n    {\n      \"name\": \"nightly-full\",\n      \"backupMethod\": \"pg-basebackup\",\n      \"cronExpression\": \"0 3 * * *\"\n    }\n  ],\n  \"pitrEnabled\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Client-ID": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "scheduleName": "production-backups",
  "backupPolicyName": "default-backup-policy",
  "schedules": [
    [
      "name": "nightly-full",
      "backupMethod": "pg-basebackup",
      "cronExpression": "0 3 * * *"
    ]
  ],
  "pitrEnabled": false
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.americancloud.com/api/v1/databases/clusters/123e4567-e89b-12d3-a456-426614174000/backups/schedule")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```