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

# Get production database schema

> Get the database schema (tables, columns, etc.) for a project's production database



## OpenAPI

````yaml https://api.specular.dev/openapi.json get /projects/{id}/schema
openapi: 3.0.0
info:
  title: Specular API
  description: Backend-as-a-Service API for managing projects and branches
  version: 1.0.0
servers:
  - url: https://api.specular.dev
    description: Production server
  - url: http://localhost:3000
    description: Development server
security:
  - bearerAuth: []
paths:
  /projects/{id}/schema:
    get:
      tags:
        - Projects
      summary: Get production database schema
      description: >-
        Get the database schema (tables, columns, etc.) for a project's
        production database
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Project ID
      responses:
        '200':
          description: Database schema
          content:
            application/json:
              schema:
                description: Database schema
                type: object
                properties:
                  tables:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        columns:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              type:
                                type: string
                              nullable:
                                type: boolean
                              default:
                                type: string
                                nullable: true
                        primaryKey:
                          type: array
                          items:
                            type: string
                          nullable: true
        '400':
          description: Project has no database
          content:
            application/json:
              schema:
                description: Project has no database
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                description: Authentication required
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                description: Project not found
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                description: Internal server error
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Bearer authentication with API key (format: Bearer sk_xxx)'

````