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

# Create a database



## OpenAPI

````yaml /api-reference/openapi.json post /databases
openapi: 3.0.0
info:
  title: Shard Cloud API
  description: >-
    API reference for Shard Cloud's authenticated management endpoints — Apps,
    Databases, VMs, Custom Docker Images, and project-level Alerts & Backups.
    Every endpoint on this page requires a JWT bearer token (see Authentication
    below). CDN endpoints have their own reference under the CDN tab.
  version: 2.0.0
servers:
  - url: https://shardcloud.app/api
    description: API base path
security: []
tags:
  - name: Databases
    description: PostgreSQL, MySQL, MongoDB, and Redis database services.
  - name: Apps
    description: Web application deployment, files, domains, and configuration.
  - name: VMs
    description: Full Linux virtual machines with SSH access.
  - name: Custom Images
    description: User-built Docker images, deployable straight to an App.
  - name: Project
    description: >-
      Resource alerts and backups — shared across App, Database, and VM
      projects.
paths:
  /databases:
    post:
      tags:
        - Databases
      summary: Create a database
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetupDatabaseService'
      responses:
        '201':
          description: Database created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  connection_url:
                    type: string
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/ValidationError'
        '403':
          description: No valid subscription
      security:
        - JWTAuth: []
components:
  schemas:
    SetupDatabaseService:
      type: object
      required:
        - type
        - ram
        - password
        - name
      properties:
        type:
          type: string
          enum:
            - postgres
            - mysql
            - mongo
            - redis
        ram:
          type: integer
          minimum: 512
          description: >-
            RAM in MB. Minimum depends on type: 1024 for postgres/mysql/mongo,
            512 for redis.
        password:
          type: string
        visualizer:
          type: boolean
        name:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
    ValidationError:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
  securitySchemes:
    JWTAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Send your API token (Dashboard → Settings → API Token) as
        `Authorization: Bearer <token>`.

````