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

# Create a column

> Adds a new typed column to the given table and creates blank cells for every existing row.

Specify `data.type` to set the column type (defaults to `string`).

For `select`/`multiSelect` columns, provide `data.selectItems`.

Returns the created column and the new cells.



## OpenAPI

````yaml post /table/column
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /table/column:
    post:
      tags:
        - Tables
      summary: Create a column
      description: >-
        Adds a new typed column to the given table and creates blank cells for
        every existing row.


        Specify `data.type` to set the column type (defaults to `string`).


        For `select`/`multiSelect` columns, provide `data.selectItems`.


        Returns the created column and the new cells.
      operationId: createColumn
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tableId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - oneMany
                        - string
                        - number
                        - money
                        - time
                        - location
                        - date
                        - checkbox
                        - formula
                        - select
                        - multiSelect
                        - linkCell
                        - email
                        - url
                        - phone
                        - image
                    selectItems:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          label:
                            type: string
                          color:
                            type: string
                        required:
                          - id
                          - label
                          - color
                    number:
                      type: object
                      properties:
                        format:
                          type: string
                        decimalPlaces:
                          type: number
                        aggregation:
                          type:
                            - string
                            - 'null'
                          enum:
                            - sum
                            - avg
                            - min
                            - max
                            - null
                    oneMany:
                      type: object
                      properties:
                        tableId:
                          type: string
              required:
                - tableId
                - name
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      column:
                        type: object
                        properties:
                          _id:
                            type: string
                          originId:
                            type: string
                          projectId:
                            type: string
                          tableId:
                            type: string
                          workspaceId:
                            type: string
                          isIdentifier:
                            type: boolean
                            example: false
                          name:
                            type: string
                          slug:
                            type: string
                          description:
                            type: string
                          data:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - identifier
                                  - oneMany
                                  - string
                                  - number
                                  - money
                                  - time
                                  - location
                                  - date
                                  - checkbox
                                  - formula
                                  - select
                                  - multiSelect
                                  - linkCell
                                  - email
                                  - url
                                  - phone
                                  - image
                              selectItems:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    label:
                                      type: string
                                    color:
                                      type: string
                                  required:
                                    - id
                                    - label
                                    - color
                              number:
                                type: object
                                properties:
                                  format:
                                    type: string
                                  decimalPlaces:
                                    type: number
                                  aggregation:
                                    type:
                                      - string
                                      - 'null'
                                    enum:
                                      - sum
                                      - avg
                                      - min
                                      - max
                                      - null
                              oneMany:
                                type: object
                                properties:
                                  tableId:
                                    type: string
                            required:
                              - type
                              - selectItems
                          createdAt:
                            type: number
                          updatedAt:
                            type: number
                          isDeleted:
                            type: boolean
                            example: false
                        required:
                          - _id
                          - projectId
                          - tableId
                          - workspaceId
                          - isIdentifier
                          - name
                          - slug
                          - data
                          - createdAt
                          - updatedAt
                      cells:
                        type: array
                        items:
                          type: object
                          properties:
                            _id:
                              type: string
                            originId:
                              type: string
                            tableId:
                              type: string
                            rowId:
                              type: string
                            columnId:
                              type: string
                            workspaceId:
                              type: string
                            isIdentifier:
                              type: boolean
                              example: false
                            data: {}
                            createdAt:
                              type: number
                            updatedAt:
                              type: number
                            isDeleted:
                              type: boolean
                              example: false
                          required:
                            - _id
                            - tableId
                            - rowId
                            - columnId
                            - workspaceId
                            - isIdentifier
                            - createdAt
                            - updatedAt
                    required:
                      - column
                      - cells
                required:
                  - data
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '404':
          description: 404 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: HERO personal access token

````