> For the complete documentation index, see [llms.txt](https://docs.discloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discloud.com/en/api-and-integrations/api-overview/database.md).

# Database

## List database presets

> Returns the Dispack catalog of available engines (versions, ports, volumes), random name/password suggestions, and per-engine \`vars\` with required/optional env keys plus \`fromSuggestions\` (suggested\* → env) so clients can build the POST /database body without hardcoding env names.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/presets":{"get":{"tags":["Databases"],"summary":"List database presets","description":"Returns the Dispack catalog of available engines (versions, ports, volumes), random name/password suggestions, and per-engine `vars` with required/optional env keys plus `fromSuggestions` (suggested* → env) so clients can build the POST /database body without hardcoding env names.","operationId":"listDatabasePresets","responses":{"200":{"description":"Presets loaded successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create database

> Starts asynchronous provisioning of a managed database. Returns HTTP 200 immediately with the new id. Poll GET /database/{dbID} until the resource exists and is online. Minimum plan Diamond (4). Optional projectID bills quota to the project owner and requires project admin access.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database":{"post":{"tags":["Databases"],"summary":"Create database","description":"Starts asynchronous provisioning of a managed database. Returns HTTP 200 immediately with the new id. Poll GET /database/{dbID} until the resource exists and is online. Minimum plan Diamond (4). Optional projectID bills quota to the project owner and requires project admin access.","operationId":"createDatabase","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["displayName","db","totalRam"],"properties":{"displayName":{"type":"string","description":"Friendly name (required)"},"db":{"type":"object","required":["type","version"],"properties":{"type":{"type":"string","description":"Engine (postgres, mysql, mariadb, mongodb, redis, valkey, …)"},"version":{"type":"string"},"extensions":{"type":"array","items":{"type":"string"}},"port":{"type":"integer"}}},"vars":{"type":"object","additionalProperties":{"type":"string"},"description":"Plaintext credentials/env for the engine (do not send varsEncrypted)"},"totalRam":{"type":"integer","minimum":100,"description":"RAM in MB (minimum 100)"},"projectID":{"type":"string","description":"Optional project to link"},"autoRestart":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Creation started","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid body (missing fields, varsEncrypted on create, invalid vars)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan or RAM quota insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running for this resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No cluster available or hostname exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Database details and status

> Returns live container status plus plaintext vars (decrypted). Same access model as the dashboard: owner or team member with access to the linked project.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}":{"get":{"tags":["Databases"],"summary":"Database details and status","description":"Returns live container status plus plaintext vars (decrypted). Same access model as the dashboard: owner or team member with access to the linked project.","operationId":"getDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Database status loaded","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No access to this database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete database

> Permanently removes the database record and its infrastructure. Requires delete\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}":{"delete":{"tags":["Databases"],"summary":"Delete database","description":"Permanently removes the database record and its infrastructure. Requires delete_app.","operationId":"deleteDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Database deleted","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to delete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Update database

> Updates displayName, hostname and/or totalRam. Requires commit\_app; changing totalRam also requires edit\_ram. Hostname requires owner plan \&gt; 3. Changing hostname or RAM triggers an async infrastructure rebuild (rebuilding=true + opId); poll GET /database/{dbID}.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}":{"patch":{"tags":["Databases"],"summary":"Update database","description":"Updates displayName, hostname and/or totalRam. Requires commit_app; changing totalRam also requires edit_ram. Hostname requires owner plan &gt; 3. Changing hostname or RAM triggers an async infrastructure rebuild (rebuilding=true + opId); poll GET /database/{dbID}.","operationId":"updateDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"hostname":{"type":"string","description":"Private hostname (1–2 segments a-z0-9_ joined by -, max 25)"},"totalRam":{"type":"integer","minimum":100,"maximum":16384}}}}}},"responses":{"200":{"description":"Database updated (optionally rebuilding)","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid body or no fields to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or plan too low for hostname","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Hostname already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Start database

> Starts the database container. Requires start\_app. Subject to RAM/slot checks.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/start":{"put":{"tags":["Databases"],"summary":"Start database","description":"Starts the database container. Requires start_app. Subject to RAM/slot checks.","operationId":"startDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Started (or already running with status error)","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error or start failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or resource limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Stop database

> Stops the database container. Requires stop\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/stop":{"put":{"tags":["Databases"],"summary":"Stop database","description":"Stops the database container. Requires stop_app.","operationId":"stopDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Stopped (or already stopped with status error)","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to stop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Restart database

> Restarts the database container. Requires restart\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/restart":{"put":{"tags":["Databases"],"summary":"Restart database","description":"Restarts the database container. Requires restart_app.","operationId":"restartDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Restarted successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error or restart failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or resource limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Create database backup

> Creates a backup of the managed database (synchronous). Requires backup\_app. Returns download metadata; S3 keys are stripped from the response.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/backup":{"post":{"tags":["Databases"],"summary":"Create database backup","description":"Creates a backup of the managed database (synchronous). Requires backup_app. Returns download metadata; S3 keys are stripped from the response.","operationId":"backupDatabase","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"gzip":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Backup created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Backup not supported or failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to backup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Database offline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## List database backups

> Lists backups stored in S3 for this database. Requires status\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/backups":{"get":{"tags":["Databases"],"summary":"List database backups","description":"Lists backups stored in S3 for this database. Requires status_app.","operationId":"listDatabaseBackups","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size (1–1000, default 50). Alias maxKeys also accepted.","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Continuation token from a previous response","schema":{"type":"string"}},{"name":"detail","in":"query","required":false,"description":"minimal (default) or full","schema":{"type":"string","enum":["minimal","full"]}}],"responses":{"200":{"description":"Backups listed","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get backup download URL

> Returns a presigned URL for the backup dump. Requires backup\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/backups/{backupId}/download":{"get":{"tags":["Databases"],"summary":"Get backup download URL","description":"Returns a presigned URL for the backup dump. Requires backup_app.","operationId":"downloadDatabaseBackup","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}},{"name":"backupId","in":"path","required":true,"description":"Backup ID","schema":{"type":"string"}},{"name":"expiresInDays","in":"query","required":false,"description":"URL validity in days (1–14)","schema":{"type":"integer","minimum":1,"maximum":14}}],"responses":{"200":{"description":"Download URL generated","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database or backup not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Restore backup as a new database

> Creates a new managed database from an existing backup (asynchronous). Requires backup\_app on the source database. Minimum plan Diamond (4). Returns the new id immediately; poll GET /database/{id}.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/restore":{"post":{"tags":["Databases"],"summary":"Restore backup as a new database","description":"Creates a new managed database from an existing backup (asynchronous). Requires backup_app on the source database. Minimum plan Diamond (4). Returns the new id immediately; poll GET /database/{id}.","operationId":"restoreDatabaseBackup","parameters":[{"name":"dbID","in":"path","required":true,"description":"Source database ID (backup owner)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["backupId","totalRam"],"properties":{"backupId":{"type":"string"},"totalRam":{"type":"integer","minimum":100},"displayName":{"type":"string"},"projectID":{"type":"string"},"vars":{"type":"object","additionalProperties":{"type":"string"}},"varsEncrypted":{"type":"string","description":"Mutually exclusive with vars"},"autoRestart":{"type":"boolean"},"db":{"type":"object","properties":{"version":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Restore started","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission or plan/quota insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Source database or project not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Another process is already running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get database logs

> Returns recent container logs (same shape as app logs). Requires logs\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/logs":{"get":{"tags":["Databases"],"summary":"Get database logs","description":"Returns recent container logs (same shape as app logs). Requires logs_app.","operationId":"getDatabaseLogs","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Logs loaded","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to read logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete database logs

> Purges stored logs for the database. Requires logs\_app.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Databases","description":"Operations about managed databases (create, lifecycle, backups and logs). Requires plan Diamond (4) or higher to create/restore. Create and restore return immediately with an id; poll GET /database/{dbID} for status."}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/database/{dbID}/logs":{"delete":{"tags":["Databases"],"summary":"Delete database logs","description":"Purges stored logs for the database. Requires logs_app.","operationId":"deleteDatabaseLogs","parameters":[{"name":"dbID","in":"path","required":true,"description":"Database ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Logs deleted","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to delete logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Database not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
