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

# Create grid table

> Create a grid table. Two kinds, chosen with kind:

kind=calc (the default) creates a calculation table defined by a SELECT query. The query becomes the table's defining expression; the table is not materialized yet. Materialize it with the materialize route once created.

kind=data creates an empty appendable data table from a column schema, for callers that own their own rows (app state, operator logs). The table is promoted on creation, so the id it returns accepts row appends immediately via POST /v1/tables/{table_id}/rows. An integer s_id primary key and a _sm_created_at timestamp are added automatically; s_id is caller-supplied on every append, not auto-generated. Use this rather than POST /v1/table-imports, which loads a table from an uploaded file and produces an import table that does not accept appends.

Creation is atomic for both kinds: the table is removed if naming, the defining query, or any column fails.



## OpenAPI

````yaml https://api.summation.com/openapi.json post /v1/grid/tables
openapi: 3.1.0
info:
  title: summation-api public API
  version: 0.1.0
servers: []
security: []
tags:
  - name: Auth
    description: Machine authentication for API clients.
  - name: Tenant
    description: Organization and tenant context resolved by summation-api.
  - name: Projects
    description: Project resources.
  - name: Conversations
    description: Conversation and message resources.
  - name: Reports
    description: Report resources and report operations.
  - name: Runs
    description: Project run history and execution status.
  - name: Playbooks
    description: Playbook resources.
  - name: Files
    description: Project file resources.
  - name: Catalog Entries
    description: Project-scoped data asset attachments.
  - name: Data Connectors
    description: Reusable external data source connections.
  - name: App Connectors
    description: External app connectors whose tools the agent can use during chat.
  - name: Tables
    description: Canonical table metadata and catalog.
  - name: Views
    description: Canonical Summation view metadata and catalog.
  - name: Query Executions
    description: Read-only SQL query execution.
  - name: Grid
    description: Materialized grid status, sync, and lineage.
  - name: Schedules
    description: Schedule and schedule run inspection.
  - name: Workflows
    description: >-
      Workflows: what they run, when they run, and where their output is
      delivered.
  - name: Verification Tests
    description: >-
      Administrative custom verification-test definitions, overlays, and
      effective-set previews.
paths:
  /v1/grid/tables:
    post:
      tags:
        - Grid
      summary: Create grid table
      description: >-
        Create a grid table. Two kinds, chosen with kind:


        kind=calc (the default) creates a calculation table defined by a SELECT
        query. The query becomes the table's defining expression; the table is
        not materialized yet. Materialize it with the materialize route once
        created.


        kind=data creates an empty appendable data table from a column schema,
        for callers that own their own rows (app state, operator logs). The
        table is promoted on creation, so the id it returns accepts row appends
        immediately via POST /v1/tables/{table_id}/rows. An integer s_id primary
        key and a _sm_created_at timestamp are added automatically; s_id is
        caller-supplied on every append, not auto-generated. Use this rather
        than POST /v1/table-imports, which loads a table from an uploaded file
        and produces an import table that does not accept appends.


        Creation is atomic for both kinds: the table is removed if naming, the
        defining query, or any column fails.
      operationId: create_grid_table
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GridTableCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          description: Invalid request or unsupported option.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '401':
          description: Missing, invalid, or expired credentials.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '403':
          description: Authenticated but missing the required scope.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '404':
          description: Resource not found or not accessible.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
        '500':
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemError'
      security:
        - SummationMachineAuth:
            - agent:write
components:
  schemas:
    GridTableCreateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Name for the new table, shown across Summation.
        kind:
          type: string
          enum:
            - calc
            - data
          title: Kind
          description: >-
            What kind of table to create. calc (the default) builds a
            calculation table from a SELECT query. data builds an empty
            appendable data table from a column schema, ready for row appends.
            Omit for the calculation behavior.
          default: calc
        query:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Query
          description: >-
            SELECT query that defines the calculation table's columns and rows
            (e.g. SELECT 1 as new_total). Required for kind=calc; not allowed
            for kind=data.
        columns:
          items:
            $ref: '#/components/schemas/GridTableColumnRequest'
          type: array
          maxItems: 50
          title: Columns
          description: >-
            Columns of the new data table, in order. Required for kind=data; not
            allowed for kind=calc. An integer s_id primary key and a
            _sm_created_at timestamp are added automatically and must not be
            listed here.
        key_columns:
          items:
            type: string
          type: array
          maxItems: 50
          title: Key Columns
          description: >-
            Optional business-key columns, used to match rows on upsert (PUT
            /v1/tables/{table_id}/rows). Names must appear in columns. This is
            not the physical primary key, which is always the automatic s_id.
      type: object
      required:
        - name
      title: GridTableCreateRequest
    ProblemError:
      description: >-
        Public error envelope (RFC 7807 ``application/problem+json``).


        Mirrors the body produced by :func:`api_error`. Declaring it in the
        contract

        lets generated clients type error handling instead of guessing.
      properties:
        type:
          description: URI reference identifying the problem type.
          title: Type
          type: string
        title:
          description: Short, human-readable summary of the problem type.
          title: Title
          type: string
        status:
          description: HTTP status code.
          title: Status
          type: integer
        detail:
          description: Human-readable explanation specific to this occurrence.
          title: Detail
          type: string
        code:
          description: Stable, machine-readable error code.
          title: Code
          type: string
        request_id:
          description: Correlation id, echoed in the x-request-id header.
          title: Request Id
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      title: ProblemError
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GridTableColumnRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Column name, unique within the table.
        type:
          type: string
          enum:
            - string
            - integer
            - decimal
            - big_decimal
            - boolean
            - date
            - datetime
            - json
            - uuid
          title: Type
          description: >-
            Column data type: string, integer, decimal, big_decimal, boolean,
            date, datetime, json, or uuid.
        nullable:
          type: boolean
          title: Nullable
          description: >-
            Whether the column accepts nulls. Set false to require a value in
            every appended row.
          default: true
      additionalProperties: false
      type: object
      required:
        - name
        - type
      title: GridTableColumnRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    SummationMachineAuth:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            agent:read: agent:read
            agent:write: agent:write
          tokenUrl: /v1/auth/m2m/token

````