Laravel Database Clusters API

The Database Clusters API from Laravel — 4 operation(s) for database clusters.

OpenAPI Specification

laravel-database-clusters-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Laravel Cloud Applications Database Clusters API
  version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: Database Clusters
paths:
  /databases/types:
    get:
      operationId: public.databases.types
      description: List all available database types with their configuration schemas.
      summary: List database types
      tags:
      - Database Clusters
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        label:
                          type: string
                        regions:
                          type: array
                          items:
                            type: string
                        config_schema:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              type:
                                type: string
                              required:
                                type: boolean
                              nullable:
                                type: boolean
                              description:
                                type: string
                              min:
                                type: integer
                              max:
                                type: integer
                              enum:
                                type: array
                                items:
                                  type: string
                              example:
                                type: string
                            required:
                            - name
                            - type
                            - required
                      required:
                      - type
                      - label
                      - regions
                      - config_schema
                required:
                - data
  /databases/clusters:
    get:
      operationId: public.databases.clusters.index
      description: Get a list of all database clusters for the authenticated organization. The `schemas` relationship is deprecated.
      summary: List database clusters
      tags:
      - Database Clusters
      parameters:
      - name: filter[type]
        in: query
        schema:
          type: string
      - name: filter[region]
        in: query
        schema:
          type: string
      - name: filter[status]
        in: query
        schema:
          type: string
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - schemas
            - databases
        explode: false
      responses:
        '200':
          description: Paginated set of `DatabaseResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseResource'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        minimum: 1
                      from:
                        type:
                        - integer
                        - 'null'
                        minimum: 1
                      last_page:
                        type: integer
                        minimum: 1
                      links:
                        type: array
                        description: Generated paginator links.
                        items:
                          type: object
                          properties:
                            url:
                              type:
                              - string
                              - 'null'
                            label:
                              type: string
                            active:
                              type: boolean
                          required:
                          - url
                          - label
                          - active
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      to:
                        type:
                        - integer
                        - 'null'
                        description: Number of the last item in the slice.
                        minimum: 1
                      total:
                        type: integer
                        description: Total number of items being paginated.
                        minimum: 0
                    required:
                    - current_page
                    - from
                    - last_page
                    - links
                    - path
                    - per_page
                    - to
                    - total
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSchemaResource'
                required:
                - data
                - links
                - meta
        '401':
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error overview.
                    examples:
                    - ''
                required:
                - message
        '403':
          $ref: '#/components/responses/AuthorizationException'
    post:
      operationId: public.databases.clusters.store
      description: Create a new database cluster. A default database will also be created and returned on the `databases` relationship. `schemas` is deprecated.
      summary: Create database cluster
      tags:
      - Database Clusters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreDatabaseRequest'
      responses:
        '201':
          description: '`DatabaseResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSchemaResource'
                required:
                - data
        '401':
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error overview.
                    examples:
                    - ''
                required:
                - message
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /databases/clusters/{database}:
    get:
      operationId: public.databases.clusters.show
      description: Get a specific database cluster. The `schemas` relationship is deprecated.
      summary: Get database cluster
      tags:
      - Database Clusters
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - schemas
            - databases
        explode: false
      responses:
        '200':
          description: '`DatabaseResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSchemaResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    patch:
      operationId: public.databases.clusters.update
      description: Update a database cluster.
      summary: Update database cluster
      tags:
      - Database Clusters
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDatabaseRequest'
      responses:
        '200':
          description: '`DatabaseResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSchemaResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
    delete:
      operationId: public.databases.clusters.destroy
      description: Delete a database cluster.
      summary: Delete database cluster
      tags:
      - Database Clusters
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      responses:
        '204':
          description: No content
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /databases/clusters/{database}/metrics:
    get:
      operationId: public.databases.clusters.metrics
      description: Get metrics for a specific database cluster.
      summary: Get database cluster metrics
      tags:
      - Database Clusters
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      - name: period
        in: query
        schema:
          anyOf:
          - $ref: '#/components/schemas/MetricPeriod'
          - type: 'null'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      cpu_usage:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      compute_hours:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      memory_usage:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      writes:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      storage_usage:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                      replica_lag:
                        type: object
                        properties:
                          labels:
                            type: array
                            items:
                              type: string
                          average:
                            type: array
                            items:
                              type: number
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                x:
                                  type: string
                                y:
                                  type: array
                                  items:
                                    type: number
                              required:
                              - x
                              - y
                        required:
                        - labels
                        - average
                        - data
                    required:
                    - cpu_usage
                    - compute_hours
                    - memory_usage
                    - writes
                    - storage_usage
                    - replica_lag
                  meta:
                    type: object
                    properties:
                      period:
                        type: string
                      available_periods:
                        type: array
                        items:
                          type: string
                    required:
                    - period
                    - available_periods
                required:
                - data
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CloudRegion:
      type: string
      enum:
      - us-east-2
      - us-east-1
      - ca-central-1
      - eu-central-1
      - eu-west-1
      - eu-west-2
      - me-central-1
      - ap-southeast-1
      - ap-southeast-2
      - ap-northeast-1
      title: CloudRegion
    DatabaseResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - databases
        attributes:
          type: object
          properties:
            name:
              type: string
            type:
              $ref: '#/components/schemas/DatabaseType'
            status:
              $ref: '#/components/schemas/DatabaseStatus'
            region:
              $ref: '#/components/schemas/CloudRegion'
            created_at:
              type:
              - string
              - 'null'
              format: date-time
            config:
              description: Configuration object. Fields vary based on database type.
              oneOf:
              - title: Neon Serverless Postgres
                type: object
                description: Configuration for Neon Serverless Postgres databases
                properties:
                  cu_min:
                    type: number
                    description: Minimum compute units for auto-scaling
                    enum:
                    - 0.25
                    - 0.5
                    - 1
                    - 2
                    - 4
                    - 8
                    - 10
                  cu_max:
                    type: number
                    description: Maximum compute units for auto-scaling
                    enum:
                    - 0.25
                    - 0.5
                    - 1
                    - 2
                    - 4
                    - 8
                    - 10
                  suspend_seconds:
                    type: integer
                    description: 'Seconds of inactivity before hibernation (0 = never, otherwise 60–604800) (min: 0, max: 604800)'
                  retention_days:
                    type: integer
                    description: 'Days to retain point-in-time recovery data (min: 0, max: 30)'
                required:
                - cu_min
                - cu_max
                - suspend_seconds
                - retention_days
              - title: Laravel MySQL
                type: object
                description: Configuration for Laravel MySQL databases
                properties:
                  size:
                    type: string
                    description: Instance size for the database cluster
                    enum:
                    - mysql-flex-512mb
                    - mysql-flex-1gb
                    - mysql-flex-2gb
                    - db-flex.m-1vcpu-512mb
                    - db-flex.m-1vcpu-1gb
                    - db-flex.m-1vcpu-2gb
                    - db-flex.m-1vcpu-4gb
                    - db-pro.m-1vcpu-4gb
                    - db-pro.m-2vcpu-8gb
                    - db-pro.m-4vcpu-16gb
                    - db-pro.m-8vcpu-32gb
                    - mysql-pro-4gb
                    - mysql-pro-8gb
                    - mysql-pro-16gb
                    - mysql-pro-32gb
                  storage:
                    type: integer
                    description: 'Storage allocation in gigabytes (min: 5, max: 1000)'
                  is_public:
                    type: boolean
                    description: Whether the database is publicly accessible
                  uses_scheduled_snapshots:
                    type: boolean
                    description: Whether scheduled backups are enabled
                  retention_days:
                    type: integer
                    description: 'Days to retain backup data (min: 0, max: 30)'
                  maintenance_window:
                    type:
                    - string
                    - 'null'
                    description: UTC maintenance window for automated updates
                    examples:
                    - sun:06:00-sun:06:30
                  suspend_seconds:
                    type: integer
                    description: 'Seconds of inactivity before scaling to zero (0 = never). Requires an eligible size and the scale-to-zero feature. (min: 0, max: 3600)'
                required:
                - size
                - storage
                - is_public
                - uses_scheduled_snapshots
                - retention_days
              - title: AWS RDS
                type: object
                description: Configuration for AWS RDS MySQL databases
                properties:
                  size:
                    type: string
                    description: Instance size for the database cluster
                    enum:
                    - db.m8g.large
                    - db.m8g.xlarge
                    - db.m8g.2xlarge
                    - db.m8g.4xlarge
                    - db.m8g.8xlarge
                    - db.m8g.12xlarge
                    - db.m8g.16xlarge
                    - db.m8g.24xlarge
                    - db.m8g.48xlarge
                    - db.m7g.large
                    - db.m7g.xlarge
                    - db.m7g.2xlarge
                    - db.m7g.4xlarge
                    - db.m7g.8xlarge
                    - db.m7g.12xlarge
                    - db.m7g.16xlarge
                    - db.t4g.micro
                    - db.t4g.small
                    - db.t4g.medium
                    - db.t4g.large
                    - db.t4g.xlarge
                    - db.t4g.2xlarge
                    - db.r8g.large
                    - db.r8g.xlarge
                    - db.r8g.2xlarge
                    - db.r8g.4xlarge
                    - db.r8g.8xlarge
                    - db.r8g.12xlarge
                    - db.r8g.16xlarge
                  storage:
                    type: integer
                    description: 'Storage allocation in gigabytes (min: 5, max: 1000)'
                  is_public:
                    type: boolean
                    description: Whether the database is publicly accessible
                  uses_pitr:
                    type: boolean
                    description: Whether point-in-time recovery is enabled
                  retention_days:
                    type: integer
                    description: 'Days to retain backup data (min: 0, max: 30)'
                  maintenance_window:
                    type:
                    - string
                    - 'null'
                    description: UTC maintenance window for automated updates
                    examples:
                    - sun:06:00-sun:06:30
                  deployment_option:
                    type: string
                    description: Deployment configuration (single-az or multi-az)
                    enum:
                    - single-az
                    - single-az-with-read-replicas
                    - multi-az
                  read_replicas:
                    type:
                    - integer
                    - 'null'
                    description: The number of configured read replicas
                required:
                - size
                - storage
                - is_public
                - uses_pitr
                - retention_days
                - deployment_option
              discriminator:
                propertyName: type
                mapping:
                  laravel_mysql_84: '#/components/schemas/LaravelMysqlConfig'
                  laravel_mysql_8: '#/components/schemas/LaravelMysqlConfig'
                  aws_rds_mysql_8: '#/components/schemas/AwsRdsConfig'
                  aws_rds_postgres_18: '#/components/schemas/AwsRdsConfig'
                  neon_serverless_postgres_18: '#/components/schemas/NeonServerlessConfig'
                  neon_serverless_postgres_17: '#/components/schemas/NeonServerlessConfig'
                  neon_serverless_postgres_16: '#/components/schemas/NeonServerlessConfig'
            connection:
              type: object
              properties:
                hostname:
                  type: string
                port:
                  type: integer
                  enum:
                  - 3306
                  - 5432
                protocol:
                  type: string
                  enum:
                  - mysql
                  - postgres
                driver:
                  type: string
                  enum:
                  - mysql
                  - pgsql
                ? ''
                : anyOf:
                  - type: object
                    properties:
                      username:
                        type: string
                      password:
                        type: string
                    required:
                    - username
                    - password
                  - type: array
                    items:
                      type: string
                    minItems: 0
                    maxItems: 0
                    additionalItems: false
              required:
              - hostname
              - port
              - protocol
              - driver
              - null
          required:
          - name
          - type
          - status
          - region
          - created_at
          - config
          - connection
        relationships:
          type: object
          properties:
            schemas:
              type: object
              description: 'TODO: Remove the schemas relationship by March 2026.'
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/DatabaseSchemaResourceIdentifier'
              required:
              - data
            databases:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/DatabaseSchemaResourceIdentifier'
              required:
              - data
      required:
      - id
      - type
      title: DatabaseResource
    MetricPeriod:
      type: string
      enum:
      - 6h
      - 24h
      - 3d
      - 7d
      - 30d
      title: MetricPeriod
    DatabaseResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - databases
        id:
          type: string
      required:
      - type
      - id
      title: DatabaseResourceIdentifier
    DatabaseType:
      type: string
      enum:
      - laravel_mysql_84
      - laravel_mysql_8
      - aws_rds_mysql_8
      - aws_rds_postgres_18
      - neon_serverless_postgres_18
      - neon_serverless_postgres_17
      - neon_serverless_postgres_16
      title: DatabaseType
    UpdateDatabaseRequest:
      type: object
      properties:
        config:
          description: Configuration object. Fields vary based on database type.
          oneOf:
          - title: Neon Serverless Postgres
            type: object
            description: Configuration for Neon Serverless Postgres databases
            properties:
              cu_min:
                type: number
                description: Minimum compute units for auto-scaling
                enum:
                - 0.25
                - 0.5
                - 1
                - 2
                - 4
                - 8
                - 10
              cu_max:
                type: number
                description: Maximum compute units for auto-scaling
                enum:
                - 0.25
                - 0.5
                - 1
                - 2
                - 4
                - 8
                - 10
              suspend_seconds:
                type: integer
                description: 'Seconds of inactivity before hibernation (0 = never, otherwise 60–604800) (min: 0, max: 604800)'
              retention_days:
                type: integer
                description: 'Days to retain point-in-time recovery data (min: 0, max: 30)'
            required:
            - cu_min
            - cu_max
            - suspend_seconds
            - retention_days
          - title: Laravel MySQL
            type: object
            description: Configuration for Laravel MySQL databases
            properties:
              size:
                type: string
                description: Instance size for the database cluster
                enum:

# --- truncated at 32 KB (47 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/laravel/refs/heads/main/openapi/laravel-database-clusters-api-openapi.yml