# set_database_backup_schedule

Source: https://modulify.ai/docs/api/backups/set-database-backup-schedule

Turns the automatic daily database backup of a site on or off, the same as the Daily backups switch in CMS settings.

- Title: Turn daily database backups on or off
- Scope: `sites:write`
- Access: Makes changes
- Endpoint: `POST /v1/set_database_backup_schedule`

It only controls the archive the platform takes each night. With it off, the nightly run skips the site and takes no new `automatic` database backup until it is turned back on. Manual backups with `create_database_backup` still work either way, and every archive the site already holds stays, still listed and still thinned as it ages, so turning it off deletes nothing.

It is set apart from daily storage backups, so changing one leaves the other as it was. Daily database backups are on for every site until someone turns them off, and the response carries `enabled` with the setting as it now stands. Any member of the workspace can change it.

On a site whose `eligibility` reads `no-database` in `list_database_backups` the setting is accepted but no daily backup runs until a database exists. Changing the setting needs a paid plan, like the **Daily backups** switch in the editor, so a site in a Free workspace answers `Daily database backups need a paid plan!` and keeps the setting it had.

The tool tells the client to change it only when you ask, and to say plainly that with it off no new daily archive of your data is taken. See [Turn daily database backups off](https://modulify.ai/docs/editor/backups#turn-daily-database-backups-off).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/set_database_backup_schedule`, sending the inputs below as a JSON object. The token needs the `sites:write` scope.

It makes changes, so send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

```bash
curl -X POST https://api.modulify.ai/v1/set_database_backup_schedule \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","enabled":true}'
```

Over MCP, the same method is the [set_database_backup_schedule tool](https://modulify.ai/docs/mcp/backups/set-database-backup-schedule).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site whose daily database backup should be turned on or off. |
| `enabled` | boolean | Yes | True to take the automatic daily database backup, false to stop taking it. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.