Delete a database of an application
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/database/example';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"acknowledgeDataloss":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://dashboard.quantcdn.io/api/v3/organizations/example/applications/example/database/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "acknowledgeDataloss": true }'Deletes the pending or previous database. No final snapshot is taken and its automated backups are deleted with it, so the body must set acknowledgeDataloss to true (422 otherwise, nothing is deleted). Take a backup before promoting: a retired database is not reachable through the backups API after the promote. The active database cannot be deleted (409), nor can one while another database operation (including its own provision) holds the application’s lock. Needs the delete_applications permission and the cloud:delete scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation ID
The application ID
The database instance identifier
Request Bodyrequired
Section titled “Request Bodyrequired”object
Must be true: the database and its automated backups are deleted with no final snapshot.
Responses
Section titled “Responses”Deletion started, or the instance was already gone
object
No final snapshot was taken.
Example
{ "status": "deleting"}The platform refused the body
object
409 only: the operation that holds the application’s lock.
409 only: the operation that was refused.
409 only: the pending or previous database that blocks the request, or the provision in flight.
409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).
Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.
Delete 500 only: what could not be cleaned up.
Example
{ "operation": "provision", "requested": "provision"}The application or the database was not found
The database is the active one, another database operation holds the lock (including its own provision), it belongs to another stack, or an environment still needs it (environments lists them: a pending database’s DB_NEXT_* could not yet be withdrawn, or a running revision still uses a previous database). Repeat the request once they are redeployed
object
409 only: the operation that holds the application’s lock.
409 only: the operation that was refused.
409 only: the pending or previous database that blocks the request, or the provision in flight.
409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).
Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.
Delete 500 only: what could not be cleaned up.
Example
{ "operation": "provision", "requested": "provision"}AcknowledgeDataloss is missing or not true
The instance is being deleted but clean-up failed part-way. Repeat the request.
object
409 only: the operation that holds the application’s lock.
409 only: the operation that was refused.
409 only: the pending or previous database that blocks the request, or the provision in flight.
409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).
Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.
Delete 500 only: what could not be cleaned up.
Example
{ "operation": "provision", "requested": "provision"}The platform could not complete the request
object
409 only: the operation that holds the application’s lock.
409 only: the operation that was refused.
409 only: the pending or previous database that blocks the request, or the provision in flight.
409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).
Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.
Delete 500 only: what could not be cleaned up.
Example
{ "operation": "provision", "requested": "provision"}