Update database API Reference
const url = 'https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db';const options = { method: 'PATCH', headers: { 'If-Match': '582019', Authorization: '<Authorization>', 'Content-Type': 'application/json' }, body: '{"backup":{"retention":7,"schedule":"Daily"},"deletionProtection":false,"highAvailability":true,"resources":{"cpu":"500m","memory":"1Gi","storage":"10Gi"},"version":"18"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.kupe.cloud/api/v1/tenants/acme/databases/orders-db \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --header 'If-Match: 582019' \ --data '{ "backup": { "retention": 7, "schedule": "Daily" }, "deletionProtection": false, "highAvailability": true, "resources": { "cpu": "500m", "memory": "1Gi", "storage": "10Gi" }, "version": "18" }'Update a managed database with JSON merge-patch semantics. Only version, resources, highAvailability, deletionProtection and backup can change; at least one is required.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Tenant name
Database name
Header Parameters
Section titled “ Header Parameters ”ETag for optimistic locking
Request Body
Section titled “ Request Body ”Fields to update (at least one required)
object
Backup settings to change. Omitted fields keep their value. Shortening retention deletes the backups that fall outside the new window.
object
How far back the backups reach, in days: 7 to 35. Default 7.
Example
7How many full backups are kept within the retention period. Daily keeps one for every day. DailyThenWeekly keeps one for each of the last 7 days and one a week before that. The points you can recover to are the same either way; recovering to an older point takes longer. Default Daily.
Example
DailyTurn deletion protection on or off.
Example
falseTurn high availability on or off.
Example
trueResources to change. Omitted fields keep their value; storage grows only.
object
CPU in cores or millicores, without a unit: “500m”, “2” or “0.5”. At most 20 characters.
Example
500mMemory with a unit suffix (Ki, Mi, Gi, Ti, Pi, Ei or k, M, G, T, P, E): “1Gi”, “512Mi”. At most 20 characters.
Example
1GiStorage with a unit suffix, as for memory: “10Gi”. Grows only. At most 20 characters.
Example
10GiEngine major version. Must equal the current version: major version upgrades are not available yet.
Example
18Responses
Section titled “ Responses ”Updated database
object
Backup settings. Null when the database has never set them: it keeps the defaults, 7 days and Daily.
object
How far back the backups reach, in days. Absent when never set: the default, 7, applies.
How many full backups are kept within the retention period: Daily keeps one for every day, DailyThenWeekly one for each of the last 7 days and one a week before that.
Generation increments on every spec change; compare with status.observedGeneration.
object
CPU in cores or millicores, without a unit: “500m”, “2” or “0.5”. At most 20 characters.
Memory with a unit suffix (Ki, Mi, Gi, Ti, Pi, Ei or k, M, G, T, P, E): “1Gi”, “512Mi”. At most 20 characters.
Storage with a unit suffix, as for memory: “10Gi”. Grows only. At most 20 characters.
object
Bytes every full backup and all WAL kept for the database take up in storage, manual backups included. 0 until measured.
Conditions include CredentialsRotating: True (reason RotationPending) while a requested rotation is not yet applied.
object
CurrentVersion is the full engine version running.
When the newest full backup finished (RFC 3339). Empty until the first backup completes.
PreviousVersion is set while a major upgrade is in progress.
The oldest and newest points you can recover the database to. Null until the backups report them.
object
The oldest point you can recover to (RFC 3339).
The newest point you can recover to: the newest WAL saved (RFC 3339).
Rotations is the credential rotation state of each role. Wait for a rotation by polling until rotations.{role}.appliedAt equals the requestedAt the rotate-credentials call returned and delivered is true. If requestedAt moves to another token first, a newer rotation replaced it: wait for that one instead.
object
object
AppliedAt is the token of the last rotation the database applied: the new password is in effect in PostgreSQL. The bound credentials Secrets follow it (see Delivered).
Delivered is true once the requested rotation is applied and every binding of the role carries the new password in the credentials Secret of every namespace it lists (true for a role never rotated). The copy into the cluster follows within seconds and is not observed, so a workload restarted the moment this turns true can, rarely, still mount the previous password for a few seconds.
Pending is true while RequestedAt differs from AppliedAt: the old password still logs in.
RequestedAt is the token of the last rotation requested; empty if none ever was.
object
AppliedAt is the token of the last rotation the database applied: the new password is in effect in PostgreSQL. The bound credentials Secrets follow it (see Delivered).
Delivered is true once the requested rotation is applied and every binding of the role carries the new password in the credentials Secret of every namespace it lists (true for a role never rotated). The copy into the cluster follows within seconds and is not observed, so a workload restarted the moment this turns true can, rarely, still mount the previous password for a few seconds.
Pending is true while RequestedAt differs from AppliedAt: the old password still logs in.
RequestedAt is the token of the last rotation requested; empty if none ever was.
object
AppliedAt is the token of the last rotation the database applied: the new password is in effect in PostgreSQL. The bound credentials Secrets follow it (see Delivered).
Delivered is true once the requested rotation is applied and every binding of the role carries the new password in the credentials Secret of every namespace it lists (true for a role never rotated). The copy into the cluster follows within seconds and is not observed, so a workload restarted the moment this turns true can, rarely, still mount the previous password for a few seconds.
Pending is true while RequestedAt differs from AppliedAt: the old password still logs in.
RequestedAt is the token of the last rotation requested; empty if none ever was.
Example
{ "backup": { "retention": 7, "schedule": "Daily" }, "createdAt": "2026-10-09T10:00:00Z", "deletionProtection": true, "engine": "postgres", "generation": 3, "highAvailability": false, "name": "orders-db", "resourceVersion": "582019", "resources": { "cpu": "500m", "memory": "1Gi", "storage": "10Gi" }, "status": { "backupSizeBytes": 5368709120, "currentVersion": "18.6", "instancesDesired": 1, "instancesReady": 1, "lastBackupAt": "2026-10-21T03:17:00Z", "phase": "Pending", "previousVersion": "", "recoveryWindow": { "earliest": "2026-10-14T03:17:00Z", "latest": "2026-10-21T09:00:00Z" }, "rotations": { "owner": { "appliedAt": "2026-10-09T12:00:00.123456789Z", "delivered": true, "pending": false, "requestedAt": "2026-10-09T12:00:00.123456789Z" }, "readonly": { "appliedAt": "2026-10-09T12:00:00.123456789Z", "delivered": true, "pending": false, "requestedAt": "2026-10-09T12:00:00.123456789Z" }, "readwrite": { "appliedAt": "2026-10-09T12:00:00.123456789Z", "delivered": true, "pending": false, "requestedAt": "2026-10-09T12:00:00.123456789Z" } } }, "version": "18"}Headers
Section titled “ Headers ”New resource version
Validation error, a storage shrink (code storage_shrink_unsupported), a version change (code major_upgrade_unavailable), a backup retention outside the platform’s range (code DATABASE_BACKUP_RETENTION_OUT_OF_RANGE), or backup settings while the platform does not offer backups (code backups_unavailable)
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Missing or invalid authentication
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Admin access required
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Database not found, or databases are switched off and the patch sets more than deletionProtection (code databases_unavailable)
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}The database is being deleted (code terminating); a change that grows it while the tenant is suspended, awaiting a payment method or being deleted (codes tenant_suspended, payment_setup_required, tenant_terminating); or the database kept changing while it was being updated
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}ETag mismatch
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}Rate limit exceeded
object
Example generated
{ "code": "example", "error": "example", "field": "example", "message": "example", "severity": "example"}