Laravel Databases API

The Databases API from Laravel — 8 operation(s) for databases.

OpenAPI Specification

laravel-databases-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Laravel Cloud Applications Databases API
  version: 0.0.1
servers:
- url: https://cloud.laravel.com/api
security:
- http: []
tags:
- name: Databases
paths:
  /databases/clusters/{database}/databases:
    get:
      operationId: public.databases.clusters.databases.index
      description: Get a list of all databases for a specific database cluster.
      summary: List databases
      tags:
      - Databases
      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
            - environments
        explode: false
      responses:
        '200':
          description: Paginated set of `DatabaseSchemaResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseSchemaResource'
                  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:
                      anyOf:
                      - $ref: '#/components/schemas/DatabaseResource'
                      - $ref: '#/components/schemas/EnvironmentResource'
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    post:
      operationId: public.databases.clusters.databases.store
      description: Create a new database in a database cluster.
      summary: Create a database
      tags:
      - Databases
      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/StoreDatabaseSchemaRequest'
      responses:
        '201':
          description: '`DatabaseSchemaResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseSchemaResource'
                  included:
                    type: array
                    items:
                      anyOf:
                      - $ref: '#/components/schemas/DatabaseResource'
                      - $ref: '#/components/schemas/EnvironmentResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /databases/clusters/{database}/databases/{schema}:
    get:
      operationId: public.databases.clusters.databases.show
      description: Get a specific database.
      summary: Get a database
      tags:
      - Databases
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      - name: schema
        in: path
        required: true
        description: The schema identifier
        schema:
          type: string
      - name: include
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - database
            - environments
        explode: false
      responses:
        '200':
          description: '`DatabaseSchemaResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseSchemaResource'
                  included:
                    type: array
                    items:
                      anyOf:
                      - $ref: '#/components/schemas/DatabaseResource'
                      - $ref: '#/components/schemas/EnvironmentResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
    delete:
      operationId: public.databases.clusters.databases.destroy
      description: Delete a database from a database cluster.
      summary: Delete a database
      tags:
      - Databases
      parameters:
      - name: database
        in: path
        required: true
        description: The database identifier
        schema:
          type:
          - string
          - 'null'
      - name: schema
        in: path
        required: true
        description: The schema identifier
        schema:
          type: string
      responses:
        '204':
          description: No content
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
  /orgs/{organization}/servers/{server}/database/schemas:
    get:
      operationId: organizations.servers.database.schemas.index
      description: 'List all database schemas associated with the server.


        Processing mode: <small><code>sync</code></small>'
      summary: List database schemas
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: page[size]
        in: query
        description: The number of results that will be returned per page.
        schema:
          type: integer
          default: 30
      - name: page[cursor]
        in: query
        description: The cursor to start the pagination from.
        schema:
          type: string
      - name: filter[name]
        in: query
        description: The name of the database schema.
        schema:
          type: string
          examples:
          - forge
      - name: filter[status]
        in: query
        description: The status of the database schema.
        schema:
          type: string
          examples:
          - installed
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - name
            - -name
            - created_at
            - -created_at
            - updated_at
            - -updated_at
        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_2'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      next_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the next set of items.
                      prev_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the previous set of items.
                    required:
                    - path
                    - per_page
                    - next_cursor
                    - prev_cursor
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    post:
      operationId: organizations.servers.database.schemas.store
      description: 'Add a new database schema to the server.


        Processing mode: <small><code>async</code></small>'
      summary: Create database schema
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDatabaseRequest'
      responses:
        '202':
          description: '`DatabaseResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseResource_2'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:create-databases
      x-permissions:
      - server:create-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/database/schemas/{database}:
    get:
      operationId: organizations.servers.database.schemas.show
      description: 'Get a specific database schema associated with the server.


        Processing mode: <small><code>sync</code></small>'
      summary: Get database schema
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: database
        in: path
        required: true
        description: The database ID
        schema:
          type: integer
      responses:
        '200':
          description: '`DatabaseResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseResource_2'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    delete:
      operationId: organizations.servers.database.schemas.destroy
      description: 'Remove a database schema from the server.


        Processing mode: <small><code>async</code></small>'
      summary: Delete database schema
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: database
        in: path
        required: true
        description: The database ID
        schema:
          type: integer
      responses:
        '202':
          description: Accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:delete-databases
      x-permissions:
      - server:delete-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/database/schemas/synchronizations:
    post:
      operationId: organizations.servers.database.schemas.synchronizations.store
      description: 'Synchronize all database schemas on the server.


        Processing mode: <small><code>async</code></small>'
      summary: Update database schemas
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      responses:
        '202':
          description: Accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:create-databases
      x-permissions:
      - server:create-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/database/users:
    get:
      operationId: organizations.servers.database.users.index
      description: 'List all database users associated with the server.


        Processing mode: <small><code>sync</code></small>'
      summary: List database users
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: page[size]
        in: query
        description: The number of results that will be returned per page.
        schema:
          type: integer
          default: 30
      - name: page[cursor]
        in: query
        description: The cursor to start the pagination from.
        schema:
          type: string
      - name: filter[name]
        in: query
        description: The name of the database user.
        schema:
          type: string
          examples:
          - forge
      - name: filter[status]
        in: query
        description: The status of the database user.
        schema:
          type: string
          examples:
          - installed
      - name: sort
        in: query
        schema:
          type: array
          items:
            type: string
            enum:
            - name
            - -name
            - created_at
            - -created_at
            - updated_at
            - -updated_at
        explode: false
      responses:
        '200':
          description: Paginated set of `DatabaseUserResource`
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseUserResource'
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                      last:
                        type: string
                      prev:
                        type: string
                      next:
                        type: string
                  meta:
                    type: object
                    properties:
                      path:
                        type:
                        - string
                        - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      next_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the next set of items.
                      prev_cursor:
                        type:
                        - string
                        - 'null'
                        description: The "cursor" that points to the previous set of items.
                    required:
                    - path
                    - per_page
                    - next_cursor
                    - prev_cursor
                required:
                - data
                - links
                - meta
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    post:
      operationId: organizations.servers.database.users.store
      description: 'Add a new database user to the server.


        Processing mode: <small><code>async</code></small>'
      summary: Create database user
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDatabaseUserRequest'
      responses:
        '202':
          description: '`DatabaseUserResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseUserResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:create-databases
      x-permissions:
      - server:create-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/database/users/{databaseUser}:
    get:
      operationId: organizations.servers.database.users.show
      description: 'Get a specific database user associated with the server.


        Processing mode: <small><code>sync</code></small>'
      summary: Get database user
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: databaseUser
        in: path
        required: true
        description: The database user ID
        schema:
          type: integer
      responses:
        '200':
          description: '`DatabaseUserResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DatabaseUserResource'
                required:
                - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:view
      x-permissions:
      - server:view
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
    put:
      operationId: organizations.servers.database.users.update
      description: 'Update a database user on the server.


        Processing mode: <small><code>async</code></small>'
      summary: Update database user
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: databaseUser
        in: path
        required: true
        description: The database user ID
        schema:
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDatabaseUserRequest'
      responses:
        '202':
          description: Accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:create-databases
      x-permissions:
      - server:create-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
    delete:
      operationId: organizations.servers.database.users.destroy
      description: 'Remove a database user from the server.


        Processing mode: <small><code>async</code></small>'
      summary: Delete database user
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      - name: databaseUser
        in: path
        required: true
        description: The database user ID
        schema:
          type: integer
      responses:
        '202':
          description: Accepted
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
      security:
      - oauth2:
        - server:delete-databases
      x-permissions:
      - server:delete-databases
      x-mint:
        metadata:
          noindex: true
      x-processingMode: async
  /orgs/{organization}/servers/{server}/database/password:
    put:
      operationId: organizations.servers.database.password.update
      description: 'Update the password for the database on the server.

        It will only update the password Forge thinks is the password, it will not change the password on the server itself.

        This should only be used if you have changed the password on the server itself and want to update Forge.


        Processing mode: <small><code>sync</code></small>'
      summary: Update the password for the database
      tags:
      - Databases
      parameters:
      - name: organization
        in: path
        required: true
        description: The organization slug
        schema:
          type: string
      - name: server
        in: path
        required: true
        description: The server ID
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDatabasePasswordRequest'
      responses:
        '204':
          description: No content
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
      security:
      - oauth2:
        - server:manage-services
      x-permissions:
      - server:manage-services
      x-mint:
        metadata:
          noindex: true
      x-processingMode: sync
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
    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
    UpdateDatabasePasswordRequest:
      type: object
      properties:
        password:
          type: string
          maxLength: 255
      required:
      - password
      title: UpdateDatabasePasswordRequest
    BranchResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - branches
        id:
          type: string
      required:
      - type
      - id
      title: BranchResourceIdentifier
    DatabaseSchemaResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - databaseSchemas
        attributes:
          type: object
          properties:
            name:
              type: string
            status:
              type: string
            created_at:
              type:
              - string
              - 'null'
              format: date-time
          required:
          - name
          - status
          - created_at
        relationships:
          type: object
          properties:
            database:
              type: object
              properties:
                data:
                  anyOf:
                  - $ref: '#/components/schemas/DatabaseResourceIdentifier'
                  - type: 'null'
              required:
              - data
            environments:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/EnvironmentResourceIdentifier'
              required:
              - data
      required:
      - id
      - type
      title: DatabaseSchemaResource
    ApplicationResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - applications
        id:
          type: string
      required:
      - type
      - id
      title: ApplicationResourceIdentifier
    FilesystemResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
          - filesystems
        id:
          type: string
      required:
      - type
      - id
      title: FilesystemResourceIdentifier
    CreateDatabaseRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the database to create.
          examples:
          - forge
          maxLength: 63
        user:
          type:
          - string
          - 'null'
          description: The name of the database user to create. Only needed if a new user should be created alongside the database.
          examples:
          - james
        password:
          type:
          - string
          - 'null'
          description: The password for the database user. Only used if the user is provided.
          examples:
          - password
          maxLength: 255
        backup_configuration_ids:
          type: array
          description: The backup configurations the database should be added to.
          examples:
          - - 1
            - 2
          items:
            type: integer
      required:
      - name
      title: CreateDatabaseRequest
    EnvironmentResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - environments
        attributes:
          type: object
          properties:
            name:
              type: string
            slug:
              type: string
            status:
              $ref: '#/components/schemas/EnvironmentStatus'
            created_from_automation:
              type: boolean
            vanity_domain:
              type: string
            php_major_version:
              type: string
              

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