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

# Create a table



## OpenAPI

````yaml post /tables
openapi: 3.0.1
info:
  title: Elementum API
  description: ''
  contact:
    email: apiteam@elementum.io
  version: 0.0.1
servers:
  - url: /v1
security: []
tags:
  - name: Access Token
    description: Manage access tokens using OAuth 2.0 standards
  - name: Agents
    description: Manage AI agents
  - name: Apps
    description: Compose and manage apps
  - name: Attachments
    description: Manage the attachments of a record
  - name: Automations
    description: Manage automations
  - name: Comments
    description: Manage the conversation of a record
  - name: Flows
    description: Manage flows
  - name: Groups
    description: Manage groups and group membership
  - name: Domains
    description: Manage organization domains
  - name: Records
    description: Manage your records
  - name: Related-items
    description: Manage the related items of a record
  - name: Search Tables
    description: Manage search tables (snowflake and linked)
  - name: Skills
    description: Manage agent skills
  - name: Tables
    description: 'Manage tables: schemas, fields, joins, and join mappings'
  - name: Users
    description: Manage users in your organization
  - name: Views
    description: Manage app views
  - name: Watchers
    description: Manage the watchers of a record
externalDocs:
  description: Find out more about Elementum
  url: https://www.elementum.com/
paths:
  /tables:
    post:
      tags:
        - Tables
      summary: Create a table
      operationId: createTable
      parameters: []
      requestBody:
        description: Table creation request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TableCreateRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ClientCredentials: []
components:
  schemas:
    TableCreateRequest:
      required:
        - categoryId
        - fields
        - handle
        - name
        - source
      type: object
      properties:
        name:
          type: string
          description: Table display name
        dataView:
          $ref: '#/components/schemas/TableDataViewCreateInput'
        description:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/TableFieldCreateInput'
        orderBy:
          type: object
          description: Opaque Sort JSON
        join:
          $ref: '#/components/schemas/TableJoinInput'
        source:
          type: string
          description: Source aspect or table id
          format: uuid
        categoryId:
          type: string
          description: Aspect category to file the table under
          format: uuid
        limit:
          type: object
          description: Opaque Limit JSON
        joins:
          type: array
          items:
            $ref: '#/components/schemas/TableJoinInput'
        cloudMapping:
          $ref: '#/components/schemas/TableCloudMappingInput'
        icon:
          type: string
        handle:
          type: string
          description: Record-handle prefix
        color:
          type: string
        filter:
          type: object
          description: Opaque Filter JSON applied to the table results
    Table:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/TableField'
        orderBy:
          type: object
        __typename:
          type: string
        source:
          $ref: '#/components/schemas/Table'
        handle:
          type: string
        type:
          type: string
        limit:
          type: object
        filter:
          type: object
        clientHandle:
          type: string
          description: Portable cross-environment identifier (client handle)
        joins:
          type: array
          items:
            $ref: '#/components/schemas/TableJoin'
        dataView:
          $ref: '#/components/schemas/TableDataView'
        id:
          type: string
          format: uuid
        name:
          type: string
    TableDataViewCreateInput:
      type: object
      properties:
        snowflake:
          $ref: '#/components/schemas/TableDataViewSnowflakeCreateInput'
    TableFieldCreateInput:
      type: object
      properties:
        cloud:
          $ref: '#/components/schemas/TableFieldCloudCreateInput'
        reference:
          $ref: '#/components/schemas/TableFieldAggregatableCreateInput'
        calculation:
          $ref: '#/components/schemas/TableCalculationCreateInput'
      description: 'Tagged union: set exactly one of `reference`, `cloud`, or `calculation`.'
    TableJoinInput:
      required:
        - joinOn
        - source
        - type
      type: object
      properties:
        source:
          type: string
          description: Source table to join in
          format: uuid
        type:
          $ref: '#/components/schemas/TableJoinType'
        joinOn:
          type: array
          items:
            $ref: '#/components/schemas/TableJoinFieldInput'
        filter:
          type: object
          description: Optional filter applied to the joined table; opaque RSQL/Filter JSON
    TableCloudMappingInput:
      required:
        - cloudLinkId
      type: object
      properties:
        bigQueryMapping:
          $ref: '#/components/schemas/TableBigQueryMappingInput'
        databricksMapping:
          $ref: '#/components/schemas/TableDatabricksMappingInput'
        snowflake:
          $ref: '#/components/schemas/TableSnowflakeMappingInput'
        cloudLinkId:
          type: string
          description: The cloud link backing this table
          format: uuid
    TableField:
      type: object
      properties:
        __typename:
          type: string
          description: >-
            The table-field variant (TableFieldReference, TableFieldCloud,
            TableFieldCalculation, TableFieldPicklist, TableFieldMultiPicklist)
        field:
          $ref: '#/components/schemas/TableField'
        id:
          type: string
          format: uuid
        calculation:
          $ref: '#/components/schemas/TableCalculation'
        tags:
          type: array
          items:
            type: string
        semanticTags:
          type: array
          items:
            type: string
        expanded:
          $ref: '#/components/schemas/TableFieldExpanded'
        clientHandle:
          type: string
          description: Portable cross-environment identifier (client handle)
        fieldType:
          $ref: '#/components/schemas/AspectFieldType'
        name:
          type: string
        aggregation:
          $ref: '#/components/schemas/TableFieldAggregation'
        columnName:
          type: string
          description: Backing warehouse column (cloud fields only)
    TableJoin:
      type: object
      properties:
        onFields:
          type: array
          items:
            $ref: '#/components/schemas/TableJoinFields'
        id:
          type: string
          format: uuid
        type:
          $ref: '#/components/schemas/TableJoinType'
        clientHandle:
          type: string
          description: Portable cross-environment identifier (client handle)
        filter:
          type: object
        source:
          $ref: '#/components/schemas/Table'
    TableDataView:
      type: object
      properties:
        databaseName:
          type: string
        __typename:
          type: string
          description: The data-view variant (TableDataViewSnowflake)
        id:
          type: string
          format: uuid
        clientHandle:
          type: string
          description: Portable cross-environment identifier (client handle)
        name:
          type: string
        schemaName:
          type: string
    TableDataViewSnowflakeCreateInput:
      required:
        - databaseName
        - name
        - schemaName
      type: object
      properties:
        databaseName:
          type: string
        name:
          type: string
        schemaName:
          type: string
    TableFieldCloudCreateInput:
      required:
        - name
      type: object
      properties:
        name:
          type: string
          description: Display name for the table field
        snowflake:
          $ref: '#/components/schemas/TableFieldSnowflakeInput'
        tags:
          type: array
          items:
            type: string
        bigQuery:
          $ref: '#/components/schemas/TableFieldBigQueryInput'
    TableFieldAggregatableCreateInput:
      required:
        - field
        - name
      type: object
      properties:
        name:
          type: string
          description: Display name for the table field
        field:
          type: string
          description: Source aspect-field UUID this reference points at
          format: uuid
        expanded:
          $ref: '#/components/schemas/TableFieldExpanded'
        aggregation:
          $ref: '#/components/schemas/TableFieldAggregation'
        tags:
          type: array
          items:
            type: string
    TableCalculationCreateInput:
      required:
        - name
        - text
      type: object
      properties:
        text:
          type: string
          description: Calculation expression
        name:
          type: string
        tags:
          type: array
          items:
            type: string
    TableJoinType:
      type: string
      enum:
        - FULL
        - INNER
        - LEFT
        - RIGHT
    TableJoinFieldInput:
      required:
        - leftFieldId
        - rightFieldId
      type: object
      properties:
        leftFieldId:
          type: string
          description: Field on the parent table side of the join
          format: uuid
        rightFieldId:
          type: string
          description: Field on the joined table side of the join
          format: uuid
    TableBigQueryMappingInput:
      required:
        - datasetName
        - tableName
      type: object
      properties:
        tableName:
          type: string
          description: Source table name
        datasetName:
          type: string
          description: Source dataset name
    TableDatabricksMappingInput:
      required:
        - databaseName
        - schemaName
        - tableName
      type: object
      properties:
        databaseName:
          type: string
          description: Source database name
        tableName:
          type: string
          description: Source table name
        schemaName:
          type: string
          description: Source schema name
    TableSnowflakeMappingInput:
      required:
        - databaseName
        - schemaName
        - tableName
      type: object
      properties:
        databaseName:
          type: string
          description: Source database name
        tableName:
          type: string
          description: Source table name
        schemaName:
          type: string
          description: Source schema name
    TableCalculation:
      type: object
      properties:
        text:
          type: string
          description: Calculation expression
    TableFieldExpanded:
      type: string
      enum:
        - GROUP_NAME
        - MULTI_PICKLIST_LABEL
        - PICKLIST_LABEL
        - STAGE_NAME
        - USER_EMAIL
        - USER_FIRST_NAME
        - USER_LAST_NAME
    AspectFieldType:
      type: string
      description: The Elementum field data type
      enum:
        - ATTACHMENT_ID
        - BOOLEAN
        - DATE
        - DATETIME
        - DECIMAL
        - GROUP_ID
        - HANDLE
        - HTML
        - JSON
        - MULTI_PICKLIST
        - NUMBER
        - PICKLIST
        - TEXT
        - USER_ID
    TableFieldAggregation:
      type: string
      enum:
        - AVERAGE
        - COUNT
        - COUNT_DISTINCT
        - MAX
        - MIN
        - NOT_SET
        - STANDARD_DEVIATION
        - SUM
    TableJoinFields:
      type: object
      properties:
        clientHandle:
          type: string
          description: Portable cross-environment identifier (client handle)
        id:
          type: string
          format: uuid
        rightField:
          $ref: '#/components/schemas/TableField'
        joinMappings:
          type: object
          additionalProperties: true
          description: Connection of join-field value mappings
        leftField:
          $ref: '#/components/schemas/TableField'
    TableFieldSnowflakeInput:
      required:
        - columnName
        - type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AspectFieldType'
        columnName:
          type: string
          description: Source column name
    TableFieldBigQueryInput:
      required:
        - columnName
        - type
      type: object
      properties:
        type:
          $ref: '#/components/schemas/AspectFieldType'
        columnName:
          type: string
          description: Source column name
  responses:
    '400':
      description: Bad Request
    '401':
      description: Unauthorized
    '403':
      description: Forbidden
    '404':
      description: Not Found
    '422':
      description: Unprocessable Entity
    '429':
      description: Too Many Requests
    '500':
      description: Internal Server Error
  securitySchemes:
    ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes: {}

````

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