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

# Send the tables of a database once



## OpenAPI

````yaml /api-reference/openapi.json post /v1/databases
openapi: 3.1.0
info:
  title: tabSutra API
  version: '1.0'
  description: >-
    One pretrained model for forecasting, classification, regression and
    recommendation on tables and databases.
servers:
  - url: https://api.tabsutra.com
security:
  - bearerAuth: []
paths:
  /v1/databases:
    post:
      summary: Send the tables of a database once
      operationId: make_database_v1_databases_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DatabaseRequest:
      properties:
        name:
          type: string
          title: Name
          description: A name for the database.
          default: database
        tables:
          items:
            $ref: '#/components/schemas/TableRows'
          type: array
          title: Tables
          description: Every table of the database.
      type: object
      required:
        - tables
      title: DatabaseRequest
    DatabaseResponse:
      properties:
        database_id:
          type: string
          title: Database Id
          description: >-
            Pass it to the database's predict and evaluate. The same tables
            always give the same id.
        report:
          additionalProperties: true
          type: object
          title: Report
          description: >-
            Per table: rows, kind (things or events), keys and the share of
            foreign keys found, the columns read and the text columns left out;
            which tables of events reach each table of things.
      type: object
      required:
        - database_id
        - report
      title: DatabaseResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TableRows:
      properties:
        name:
          type: string
          title: Name
          description: >-
            The table's name; foreign keys of other tables point at it by this
            name.
          examples:
            - orders
        primary_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Primary Key
          description: A column whose values name the rows (each value once).
          examples:
            - order_id
        foreign_keys:
          additionalProperties:
            type: string
          type: object
          title: Foreign Keys
          description: >-
            {column: table}: the column holds the primary key of a row of that
            table.
          examples:
            - customer_id: customers
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
          description: >-
            When the row happened (a date). A table with a time column and
            foreign keys is a table of events (orders, visits); a table with a
            primary key and no time column is a table of things.
          examples:
            - ordered_at
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
          description: The table's rows, one object per row.
      type: object
      required:
        - name
        - rows
      title: TableRows
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as ''Authorization: Bearer <key>''.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.