Laravel Database Snapshots API

The Database Snapshots API from Laravel — 2 operation(s) for database snapshots.

OpenAPI Specification

laravel-database-snapshots-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Laravel Cloud Applications Database Snapshots API
  version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: Database Snapshots
paths:
  /databases/clusters/{database}/snapshots:
    get:
      operationId: public.databases.clusters.snapshots.index
      description: Get a list of all snapshots for a specific database cluster.
      summary: List database snapshots
      tags:
      - Database Snapshots
      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:
            - database
        explode: false
      responses:
        '200':
          description: Paginated set of `DatabaseSnapshotResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSnapshotResource'
                  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/DatabaseResource'
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    post:
      operationId: public.databases.clusters.snapshots.store
      description: Create a new manual snapshot for a database cluster.
      summary: Create a database snapshot
      tags:
      - Database Snapshots
      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/StoreDatabaseSnapshotRequest'
      responses:
        '201':
          description: '`DatabaseSnapshotResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseSnapshotResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /database-snapshots/{databaseSnapshot}:
    get:
      operationId: public.database-snapshots.show
      description: Get a specific database snapshot.
      summary: Get a database snapshot
      tags:
      - Database Snapshots
      parameters:
      - name: databaseSnapshot
        in: path
        required: true
        description: The database snapshot identifier
        schema:
          type:
          - string
          - 'null'
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - database
        explode: false
      responses:
        '200':
          description: '`DatabaseSnapshotResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseSnapshotResource'
                  included:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    delete:
      operationId: public.database-snapshots.destroy
      summary: Delete a database snapshot
      tags:
      - Database Snapshots
      parameters:
      - name: databaseSnapshot
        in: path
        required: true
        description: The database snapshot 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'
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
    StoreDatabaseSnapshotRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type:
          - string
          - 'null'
          minLength: 3
          maxLength: 40
      required:
      - name
      title: StoreDatabaseSnapshotRequest
    DatabaseResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - databases
        id:
          type: string
      required:
      - type
      - id
      title: DatabaseResourceIdentifier
    Link:
      type: object
      properties:
        href:
          type: string
          format: uri
        rel:
          type: string
        describedby:
          type: string
        title:
          type: string
        type:
          type: string
        hreflang:
          anyOf:
          - type: string
          - type: array
            items:
              type: string
        meta:
          type: object
      required:
      - href
      title: Link
    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
    DatabaseSchemaResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - databaseSchemas
        id:
          type: string
      required:
      - type
      - id
      title: DatabaseSchemaResourceIdentifier
    DatabaseSnapshotResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - database_snapshots
        attributes:
          type: object
          properties:
            name:
              type:
              - string
              - 'null'
            description:
              type:
              - string
              - 'null'
            type:
              $ref: '#/components/schemas/DatabaseSnapshotType'
            status:
              $ref: '#/components/schemas/DatabaseSnapshotStatus'
            storage_bytes:
              type:
              - integer
              - 'null'
            pitr_enabled:
              type:
              - boolean
              - 'null'
            pitr_ends_at:
              type:
              - string
              - 'null'
              format: date-time
            completed_at:
              type:
              - string
              - 'null'
              format: date-time
            created_at:
              type:
              - string
              - 'null'
              format: date-time
          required:
          - name
          - description
          - type
          - status
          - storage_bytes
          - pitr_enabled
          - pitr_ends_at
          - completed_at
          - created_at
        relationships:
          type: object
          properties:
            database:
              type: object
              properties:
                data:
                  anyOf:
                  - $ref: '#/components/schemas/DatabaseResourceIdentifier'
                  - type: 'null'
              required:
              - data
        links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/Link'
          required:
          - self
      required:
      - id
      - type
      - links
      title: DatabaseSnapshotResource
    DatabaseSnapshotType:
      type: string
      enum:
      - manual
      - scheduled
      title: DatabaseSnapshotType
    DatabaseStatus:
      type: string
      enum:
      - creating
      - updating
      - restarting
      - upgrading
      - moving
      - available
      - stopped
      - restoring
      - restore_failed
      - disabled
      - snapshotting_before_archiving
      - archiving
      - archived
      - deleting
      - deleted
      - unknown
      title: DatabaseStatus
    DatabaseSnapshotStatus:
      type: string
      enum:
      - pending
      - creating
      - available
      - failed
      - deleting
      title: DatabaseSnapshotStatus
  responses:
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
            - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
            - message
            - errors
  securitySchemes:
    http:
      type: http
      description: The Bearer Token generated on the Cloud UI.
      scheme: bearer
      bearerFormat: bearer