> ## 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}/start

> This endpoint starts a database.

> [!WARNING]
>
> This endpoint has a rate limit of 10 requests per minute, shared by start, stop and restart.


## OpenAPI

````yaml POST /v1/databases/{databaseId}/start
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}/start:
    post:
      tags:
        - Databases
      description: >-
        Starts a database. The database must have the status `active` and its
        owner must have an active plan. For team databases the
        `canChangeStatusDatabase` permission is required.


        If the database has `restartRequired: true`, its container is rebuilt to
        apply the pending change instead.
      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, with refreshed metrics.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '400':
          description: >-
            `databaseId` is not a valid ID, or the status of the database is not
            `active`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  This application cannot be started at the moment. Please try
                  again later!
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            You are not allowed to change the state of the database, or its
            owner has no active plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: The owner of this application does not have an active plan.
        '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. Starting, stopping and restarting
            databases share a limit of 10 requests per minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Database power action limit reached, please try again later
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Database:
      type: object
      properties:
        _id:
          type: string
          description: ID of the database.
          example: 64b7f0c2a1b2c3d4e5f60718
        name:
          type: string
          description: Display name.
          example: main-db
        type:
          type: string
          enum:
            - mysql
            - postgresql
            - mongodb
            - redis
          example: postgresql
        status:
          type: string
          enum:
            - creating
            - active
            - rebuilding
            - error
          description: >-
            `creating` right after creation, `active` when ready, `rebuilding`
            while the container is rebuilt, `error` when the last rebuild
            failed.
          example: active
        restartRequired:
          type: boolean
          description: >-
            Whether a change (memory, or the password of a Redis database) is
            waiting for the next start, stop or restart to be applied.
          example: false
        userId:
          type:
            - string
            - 'null'
          description: ID of the account that owns the database.
          example: 64b7f0c2a1b2c3d4e5f60700
        teamId:
          description: >-
            Team of the database: `null` for personal databases, otherwise the
            team ID or an object with the ID and name of the team.
          oneOf:
            - type: 'null'
            - type: string
            - type: object
              properties:
                _id:
                  type: string
                name:
                  type: string
          example: null
        workerNodeId:
          description: >-
            Server that runs the database: its ID, or an object with the ID and
            name.
          oneOf:
            - type: 'null'
            - type: string
            - type: object
              properties:
                _id:
                  type: string
                nodeName:
                  type: string
          example:
            _id: 64b7f0c2a1b2c3d4e5f60799
            nodeName: node-1
        allocatedMemoryMB:
          type: integer
          description: >-
            Memory reserved for the database, in MB. It counts towards the
            memory of the plan.
          example: 512
        allocatedVCpu:
          type: number
          description: vCPUs available to the database.
          example: 1
        diskLimitBytes:
          type: integer
          description: Disk limit in bytes.
          example: 10737418240
        diskUsageBytes:
          type:
            - integer
            - 'null'
          description: Latest measured disk usage in bytes. `null` when not measured yet.
          example: 52428800
        containerImage:
          type: string
          description: Image and version of the database engine.
          example: postgres:trixie
        connection:
          $ref: '#/components/schemas/DatabaseConnection'
        currentResourceMetrics:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ResourceMetrics'
          description: Latest metrics. `null` when none were collected yet.
        createdAt:
          type: string
          format: date-time
          example: '2025-01-01T12:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2025-01-01T12:00:00.000Z'
    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.
    DatabaseConnection:
      type: object
      description: >-
        How to connect to the database. **The password is never returned by the
        API**: it is chosen when the database is created and can only be
        replaced, not read.
      properties:
        host:
          type: string
          description: Host name to connect to.
          example: db.camposcloud.com
        port:
          type:
            - integer
            - 'null'
          description: >-
            Port to connect to. `null` while the database is still being
            created.
          example: 30001
        username:
          type:
            - string
            - 'null'
          description: User name. `null` for Redis.
          example: app_user
        database:
          type:
            - string
            - 'null'
          description: Name of the initial database. Only for MySQL and PostgreSQL.
          example: app_db
    ResourceMetrics:
      type: object
      description: >-
        Latest resource metrics collected for the application. All counters are
        `0` while the application is offline.
      properties:
        timestamp:
          type:
            - string
            - 'null'
          format: date-time
          description: When the metrics were collected.
          example: '2025-01-01T12:00:00.000Z'
        online:
          type: boolean
          description: Whether the application is currently running.
          example: true
        uptime:
          type: integer
          description: Uptime in seconds.
          example: 35980
        startedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the application was started. `null` while it is offline.
          example: '2025-01-01T12:00:00.000Z'
        cpuUsagePercent:
          type: number
          description: CPU usage in percent.
          example: 0.42
        memoryUsageBytes:
          type: integer
          description: Memory in use, in bytes.
          example: 43671552
        memoryLimitBytes:
          type: integer
          description: Memory limit, in bytes.
          example: 268435456
        networkRxBytes:
          type: integer
          description: Bytes received over the network.
          example: 228961
        networkTxBytes:
          type: integer
          description: Bytes sent over the network.
          example: 228190
  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.