> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camposcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# /v1/databases/{databaseId}

> This endpoint permanently deletes a database and all of its data.

> [!WARNING]
>
> This endpoint has a rate limit of 1 request every 3 seconds, shared with the other endpoints that change databases (create, update, update credentials and delete).

> [!WARNING]
>
> All the data stored in the database is deleted and cannot be recovered.


## OpenAPI

````yaml DELETE /v1/databases/{databaseId}
openapi: 3.1.0
info:
  title: CamposCloud API Documentation
  description: >-
    This documentation provides an overview of the CamposCloud API, including
    authentication, endpoints, and data structures. It is designed to help
    developers integrate with the CamposCloud platform effectively.
  version: 1.0.0
servers:
  - url: https://api.camposcloud.com
security:
  - bearerAuth: []
paths:
  /v1/databases/{databaseId}:
    delete:
      tags:
        - Databases
      description: >-
        Permanently deletes a database **and all the data stored in it**. This
        cannot be undone. A database that is still being created cannot be
        deleted. For team databases the `canDeleteDatabase` permission is
        required.
      parameters:
        - name: databaseId
          in: path
          required: true
          description: ID of the database.
          schema:
            type: string
            pattern: ^[a-f0-9]{24}$
      responses:
        '200':
          description: The database was deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Application deleted successfully.
        '400':
          description: >-
            `databaseId` is not a valid ID, or the database is still being
            created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  This application is currently being created. Please wait until
                  the process is completed before deleting it.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            You are not allowed to perform this action. Personal databases can
            only be changed by their owner; team databases require the
            `canDeleteDatabase` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  You do not have permission to perform this action on this
                  application.
        '404':
          description: Database not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  Application not found or you do not have permission to access
                  it.
        '429':
          description: >-
            A rate limit was exceeded. Creating, updating, changing the password
            of and deleting databases share a limit of 1 request every 3
            seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Database change limit reached, please try again later
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Error:
      type: object
      description: >-
        Every error returned by the API has this shape. The message can be in
        English or in Portuguese depending on the endpoint.
      required:
        - error
      properties:
        error:
          type: string
          description: Human readable description of the error.
          example: Application not found.
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing or malformed, or the API token is
        invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid developer token
    InternalError:
      description: >-
        Unexpected error. On endpoints that do not document a `400` for it, this
        is also returned when an ID in the URL is not a valid identifier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal server error. Please try again later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your CamposCloud API token, sent as `Authorization: Bearer <token>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.