Skip to content

Delete a database of an application

DELETE
/api/v3/organizations/{organisation}/applications/{application}/database/{instanceId}
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.

organisation
required
string

The organisation ID

application
required
string

The application ID

instanceId
required
string
/^[a-z][a-z0-9-]{0,62}$/

The database instance identifier

Media typeapplication/json
object
acknowledgeDataloss
required

Must be true: the database and its automated backups are deleted with no final snapshot.

boolean

Deletion started, or the instance was already gone

Media typeapplication/json
object
message
string
orgName
string
appName
string
instanceId
string
status
string
Allowed values: deleting deleted
note

No final snapshot was taken.

string
Example
{
"status": "deleting"
}

The platform refused the body

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
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

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
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.

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
Example
{
"operation": "provision",
"requested": "provision"
}

The platform could not complete the request

Media typeapplication/json
object
message
string
operation

409 only: the operation that holds the application’s lock.

string
Allowed values: provision promote delete
requested

409 only: the operation that was refused.

string
Allowed values: provision promote delete
instanceId

409 only: the pending or previous database that blocks the request, or the provision in flight.

string
statusUrl

409 only: for a provision in flight, the path to poll on the platform (this API serves it at the database route).

string
environments

Promote 409 only: the environments that have no user, or unreadable credentials, on the instance.

Array<string>
errors

Delete 500 only: what could not be cleaned up.

Array<string>
Example
{
"operation": "provision",
"requested": "provision"
}