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

# Create a new database

> **Two options:** Create a brand new managed PostgreSQL database (we handle everything!) or connect to your existing database. For managed databases, we'll spin up a new PostgreSQL instance for you. For external databases, just provide your connection details.



## OpenAPI

````yaml openapi.json post /
openapi: 3.0.0
info:
  title: Aurora Database API
  description: >-
    Comprehensive database management API providing dynamic database
    connections, real-time table operations, advanced querying, and transaction
    logging. Supports both managed PostgreSQL databases and external database
    connections with full CRUD operations.
  contact:
    name: Aurora Development Team
    email: support@aurora.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: /api
    description: Aurora API Server
security:
  - sanctum: []
tags:
  - name: Database Management
    description: >-
      🗄️ **Create, manage, and connect databases** - Start here to set up your
      PostgreSQL databases or connect to existing ones. These endpoints let you
      create managed databases, test connections, and handle basic database
      operations.
  - name: Table Operations
    description: >-
      📊 **Design your data structure** - Build and manage tables within your
      databases. Create tables with custom names, get table information, and
      organize your data structure exactly how you need it.
  - name: Column Management
    description: >-
      🏗️ **Define your data fields** - Add columns to your tables with various
      data types like text, numbers, dates, and more. Configure column
      properties, validation rules, and organize your data schema.
  - name: Formula Management
    description: >-
      🧮 **Create calculated fields** - Build dynamic Formula columns that
      automatically calculate values based on other columns in your table.
      Perfect for CRM calculations like deal values, commissions, and lead
      scoring.
  - name: Data Operations
    description: >-
      📝 **Work with your data** - The core endpoints for managing your actual
      data. Insert new records, update existing ones, delete data, and retrieve
      information with powerful filtering and search capabilities.
  - name: Advanced Queries
    description: >-
      🔍 **Powerful data analysis** - Advanced querying capabilities including
      complex filtering, aggregations, grouping, and custom search operations.
      Perfect for analytics and reporting.
  - name: Transaction History
    description: >-
      📋 **Audit and monitoring** - Track all changes and operations performed
      on your databases. View transaction logs, get statistics, and maintain a
      complete audit trail of your data operations.
  - name: Account
    description: Account
  - name: Agents
    description: Agents
  - name: Agents - Skills
    description: Agents - Skills
  - name: Agents - Tools
    description: Agents - Tools
  - name: Agents - Runs
    description: Agents - Runs
  - name: Row Comments
    description: Row Comments
  - name: Bulk Data Operations
    description: Bulk Data Operations
  - name: Browser Utilities
    description: Browser Utilities
  - name: Utility Management
    description: Utility Management
  - name: File Utilities
    description: File Utilities
  - name: Image Utilities
    description: Image Utilities
  - name: Media Utilities
    description: Media Utilities
  - name: Vector Collections
    description: Vector Collections
  - name: Vector Store
    description: Vector Store
  - name: Vector Points
    description: Vector Points
  - name: Vector Search
    description: Vector Search
paths:
  /:
    post:
      tags:
        - Database Management
      summary: Create a new database
      description: >-
        **Two options:** Create a brand new managed PostgreSQL database (we
        handle everything!) or connect to your existing database. For managed
        databases, we'll spin up a new PostgreSQL instance for you. For external
        databases, just provide your connection details.
      operationId: createDatabase
      requestBody:
        description: Database configuration
        required: true
        content:
          application/json:
            schema:
              required:
                - name
                - connection_type
              properties:
                name:
                  description: Database name
                  type: string
                  maxLength: 255
                  example: My New Database
                description:
                  description: Database description
                  type: string
                  maxLength: 1000
                  example: Optional description
                  nullable: true
                connection_type:
                  description: Type of database connection
                  type: string
                  enum:
                    - managed_pg
                    - external_db
                  example: managed_pg
                icon_url:
                  description: Icon URL for the database
                  type: string
                  example: database-icon.svg
                  nullable: true
                icon_color:
                  description: Hex color code for the database icon
                  type: string
                  pattern: ^#[0-9A-Fa-f]{6}$
                  example: '#60a5fa'
                  nullable: true
                connection_host:
                  description: Database host (required for external_db)
                  type: string
                  example: localhost
                  nullable: true
                connection_port:
                  description: Database port (required for external_db)
                  type: integer
                  maximum: 65535
                  minimum: 1
                  example: 5432
                  nullable: true
                connection_db_name:
                  description: Database name (required for external_db)
                  type: string
                  example: mydb
                  nullable: true
                connection_username:
                  description: Database username (required for external_db)
                  type: string
                  example: user
                  nullable: true
                connection_password:
                  description: Database password (required for external_db)
                  type: string
                  example: password
                  nullable: true
              type: object
      responses:
        '201':
          description: Database created successfully
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                    example: Database created successfully
                  transaction_id:
                    type: string
                    format: uuid
                  database:
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      connection_type:
                        type: string
                      connection_db_name:
                        type: string
                        nullable: true
                      status:
                        type: string
                      connection_summary:
                        properties:
                          type:
                            type: string
                          host:
                            type: string
                          database:
                            type: string
                          can_connect:
                            type: boolean
                        type: object
                    type: object
                type: object
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                type: object
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: boolean
                    example: true
                  message:
                    type: string
                  trace_id:
                    type: string
                    format: uuid
                  timestamp:
                    type: string
                    format: date-time
                type: object
      security:
        - sanctum: []
components:
  securitySchemes:
    sanctum:
      type: apiKey
      description: Enter token in format (Bearer <token>)
      name: Authorization
      in: header

````