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

# Post table view

> Create a view



## OpenAPI

````yaml /swagger.json post /table/{tableId}/view
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /table/{tableId}/view:
    post:
      tags:
        - view
      description: Create a view
      parameters:
        - schema:
            type: string
          required: true
          name: tableId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - grid
                    - calendar
                    - kanban
                    - form
                    - gallery
                    - plugin
                description:
                  type: string
                order:
                  type: number
                options:
                  anyOf:
                    - type: object
                      properties:
                        rowHeight:
                          type: string
                          enum:
                            - short
                            - medium
                            - tall
                            - extraTall
                            - autoFit
                          description: The row height level of row in view
                        fieldNameDisplayLines:
                          type: number
                          minimum: 1
                          maximum: 3
                          description: The field name display lines in view
                        frozenColumnCount:
                          type: number
                          minimum: 0
                          description: >-
                            The frozen column count in view. Deprecated: this
                            field will be removed in a future release and may no
                            longer take effect.
                        frozenFieldId:
                          type: string
                          description: >-
                            Freeze to the right side of this field id in grid
                            view
                      additionalProperties: false
                    - type: object
                      properties:
                        stackFieldId:
                          type: string
                          description: The field id of the Kanban stack.
                        coverFieldId:
                          type: string
                          nullable: true
                          description: >-
                            The cover field id is a designated attachment field
                            id, the contents of which appear at the top of each
                            Kanban card.
                        isCoverFit:
                          type: boolean
                          description: >-
                            If true, cover images are resized to fit Kanban
                            cards.
                        isFieldNameHidden:
                          type: boolean
                          description: If true, hides field name in the Kanban cards.
                        isEmptyStackHidden:
                          type: boolean
                          description: If true, hides empty stacks in the Kanban.
                      additionalProperties: false
                    - type: object
                      properties:
                        coverFieldId:
                          type: string
                          nullable: true
                          description: >-
                            The cover field id is a designated attachment field
                            id, the contents of which appear at the top of each
                            gallery card.
                        isCoverFit:
                          type: boolean
                          description: >-
                            If true, cover images are resized to fit gallery
                            cards.
                        isFieldNameHidden:
                          type: boolean
                          description: If true, hides field name in the gallery cards.
                      additionalProperties: false
                    - type: object
                      properties:
                        startDateFieldId:
                          type: string
                          nullable: true
                          description: The start date field id.
                        endDateFieldId:
                          type: string
                          nullable: true
                          description: The end date field id.
                        titleFieldId:
                          type: string
                          nullable: true
                          description: The title field id.
                        colorConfig:
                          type: object
                          nullable: true
                          properties:
                            type:
                              type: string
                              enum:
                                - field
                                - custom
                            fieldId:
                              type: string
                              nullable: true
                              description: The color field id.
                            color:
                              type: string
                              nullable: true
                              enum:
                                - blueLight2
                                - blueLight1
                                - blueBright
                                - blue
                                - blueDark1
                                - cyanLight2
                                - cyanLight1
                                - cyanBright
                                - cyan
                                - cyanDark1
                                - grayLight2
                                - grayLight1
                                - grayBright
                                - gray
                                - grayDark1
                                - greenLight2
                                - greenLight1
                                - greenBright
                                - green
                                - greenDark1
                                - orangeLight2
                                - orangeLight1
                                - orangeBright
                                - orange
                                - orangeDark1
                                - pinkLight2
                                - pinkLight1
                                - pinkBright
                                - pink
                                - pinkDark1
                                - purpleLight2
                                - purpleLight1
                                - purpleBright
                                - purple
                                - purpleDark1
                                - redLight2
                                - redLight1
                                - redBright
                                - red
                                - redDark1
                                - tealLight2
                                - tealLight1
                                - tealBright
                                - teal
                                - tealDark1
                                - yellowLight2
                                - yellowLight1
                                - yellowBright
                                - yellow
                                - yellowDark1
                              description: The color.
                          required:
                            - type
                      additionalProperties: false
                    - type: object
                      properties:
                        coverUrl:
                          type: string
                          description: The cover url of the form
                        logoUrl:
                          type: string
                          description: The logo url of the form
                        submitLabel:
                          type: string
                          description: The submit button text of the form
                      additionalProperties: false
                    - type: object
                      properties:
                        pluginId:
                          type: string
                          description: The plugin id
                        pluginInstallId:
                          type: string
                          description: The plugin install id
                        pluginLogo:
                          type: string
                          description: The plugin logo
                      required:
                        - pluginId
                        - pluginInstallId
                        - pluginLogo
                      additionalProperties: false
                sort:
                  type: object
                  nullable: true
                  properties:
                    sortObjs:
                      type: array
                      items:
                        type: object
                        properties:
                          fieldId:
                            type: string
                            description: The id of the field.
                          order:
                            type: string
                            enum:
                              - asc
                              - desc
                        required:
                          - fieldId
                          - order
                    manualSort:
                      type: boolean
                  required:
                    - sortObjs
                filter:
                  type: object
                  description: >-
                    A filter object for complex query conditions based on
                    fields, operators, and values. Use our visual query builder
                    at https://app.teable.ai/developer/tool/query-builder to
                    build filters.
                group:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      fieldId:
                        type: string
                        description: The id of the field.
                      order:
                        type: string
                        enum:
                          - asc
                          - desc
                    required:
                      - fieldId
                      - order
                isLocked:
                  type: boolean
                shareId:
                  type: string
                enableShare:
                  type: boolean
                shareMeta:
                  type: object
                  properties:
                    allowCopy:
                      type: boolean
                    includeHiddenField:
                      type: boolean
                    password:
                      type: string
                      minLength: 3
                    includeRecords:
                      type: boolean
                    submit:
                      type: object
                      properties:
                        allow:
                          type: boolean
                        requireLogin:
                          type: boolean
                columnMeta:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: object
                        properties:
                          order:
                            type: number
                            description: >-
                              Order is a floating number, column will sort by it
                              in the view.
                          width:
                            type: number
                            description: Column width in the view.
                          hidden:
                            type: boolean
                            description: If column hidden in the view.
                          statisticFunc:
                            type: string
                            nullable: true
                            enum:
                              - count
                              - empty
                              - filled
                              - unique
                              - max
                              - min
                              - sum
                              - average
                              - checked
                              - unChecked
                              - percentEmpty
                              - percentFilled
                              - percentUnique
                              - percentChecked
                              - percentUnChecked
                              - earliestDate
                              - latestDate
                              - dateRangeOfDays
                              - dateRangeOfMonths
                              - totalAttachmentSize
                            description: Statistic function of the column in the view.
                        required:
                          - order
                        additionalProperties: false
                      - type: object
                        properties:
                          order:
                            type: number
                            description: >-
                              Order is a floating number, column will sort by it
                              in the view.
                          visible:
                            type: boolean
                            description: If column visible in the kanban view.
                        required:
                          - order
                        additionalProperties: false
                      - type: object
                        properties:
                          order:
                            type: number
                            description: >-
                              Order is a floating number, column will sort by it
                              in the view.
                          visible:
                            type: boolean
                            description: If column visible in the gallery view.
                        required:
                          - order
                        additionalProperties: false
                      - type: object
                        properties:
                          order:
                            type: number
                            description: >-
                              Order is a floating number, column will sort by it
                              in the view.
                          visible:
                            type: boolean
                            description: If column visible in the view.
                          required:
                            type: boolean
                            description: If column is required.
                        required:
                          - order
                        additionalProperties: false
                      - type: object
                        properties:
                          order:
                            type: number
                            description: >-
                              Order is a floating number, column will sort by it
                              in the view.
                          hidden:
                            type: boolean
                            description: If column hidden in the view.
                        required:
                          - order
                        additionalProperties: false
                  description: >-
                    A mapping of view IDs to their corresponding column
                    metadata.
              required:
                - type
      responses:
        '201':
          description: Returns data about a view.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    enum:
                      - grid
                      - calendar
                      - kanban
                      - form
                      - gallery
                      - plugin
                  description:
                    type: string
                  order:
                    type: number
                  options:
                    anyOf:
                      - type: object
                        properties:
                          rowHeight:
                            type: string
                            enum:
                              - short
                              - medium
                              - tall
                              - extraTall
                              - autoFit
                            description: The row height level of row in view
                          fieldNameDisplayLines:
                            type: number
                            minimum: 1
                            maximum: 3
                            description: The field name display lines in view
                          frozenColumnCount:
                            type: number
                            minimum: 0
                            description: >-
                              The frozen column count in view. Deprecated: this
                              field will be removed in a future release and may
                              no longer take effect.
                          frozenFieldId:
                            type: string
                            description: >-
                              Freeze to the right side of this field id in grid
                              view
                        additionalProperties: false
                      - type: object
                        properties:
                          stackFieldId:
                            type: string
                            description: The field id of the Kanban stack.
                          coverFieldId:
                            type: string
                            nullable: true
                            description: >-
                              The cover field id is a designated attachment
                              field id, the contents of which appear at the top
                              of each Kanban card.
                          isCoverFit:
                            type: boolean
                            description: >-
                              If true, cover images are resized to fit Kanban
                              cards.
                          isFieldNameHidden:
                            type: boolean
                            description: If true, hides field name in the Kanban cards.
                          isEmptyStackHidden:
                            type: boolean
                            description: If true, hides empty stacks in the Kanban.
                        additionalProperties: false
                      - type: object
                        properties:
                          coverFieldId:
                            type: string
                            nullable: true
                            description: >-
                              The cover field id is a designated attachment
                              field id, the contents of which appear at the top
                              of each gallery card.
                          isCoverFit:
                            type: boolean
                            description: >-
                              If true, cover images are resized to fit gallery
                              cards.
                          isFieldNameHidden:
                            type: boolean
                            description: If true, hides field name in the gallery cards.
                        additionalProperties: false
                      - type: object
                        properties:
                          startDateFieldId:
                            type: string
                            nullable: true
                            description: The start date field id.
                          endDateFieldId:
                            type: string
                            nullable: true
                            description: The end date field id.
                          titleFieldId:
                            type: string
                            nullable: true
                            description: The title field id.
                          colorConfig:
                            type: object
                            nullable: true
                            properties:
                              type:
                                type: string
                                enum:
                                  - field
                                  - custom
                              fieldId:
                                type: string
                                nullable: true
                                description: The color field id.
                              color:
                                type: string
                                nullable: true
                                enum:
                                  - blueLight2
                                  - blueLight1
                                  - blueBright
                                  - blue
                                  - blueDark1
                                  - cyanLight2
                                  - cyanLight1
                                  - cyanBright
                                  - cyan
                                  - cyanDark1
                                  - grayLight2
                                  - grayLight1
                                  - grayBright
                                  - gray
                                  - grayDark1
                                  - greenLight2
                                  - greenLight1
                                  - greenBright
                                  - green
                                  - greenDark1
                                  - orangeLight2
                                  - orangeLight1
                                  - orangeBright
                                  - orange
                                  - orangeDark1
                                  - pinkLight2
                                  - pinkLight1
                                  - pinkBright
                                  - pink
                                  - pinkDark1
                                  - purpleLight2
                                  - purpleLight1
                                  - purpleBright
                                  - purple
                                  - purpleDark1
                                  - redLight2
                                  - redLight1
                                  - redBright
                                  - red
                                  - redDark1
                                  - tealLight2
                                  - tealLight1
                                  - tealBright
                                  - teal
                                  - tealDark1
                                  - yellowLight2
                                  - yellowLight1
                                  - yellowBright
                                  - yellow
                                  - yellowDark1
                                description: The color.
                            required:
                              - type
                        additionalProperties: false
                      - type: object
                        properties:
                          coverUrl:
                            type: string
                            description: The cover url of the form
                          logoUrl:
                            type: string
                            description: The logo url of the form
                          submitLabel:
                            type: string
                            description: The submit button text of the form
                        additionalProperties: false
                      - type: object
                        properties:
                          pluginId:
                            type: string
                            description: The plugin id
                          pluginInstallId:
                            type: string
                            description: The plugin install id
                          pluginLogo:
                            type: string
                            description: The plugin logo
                        required:
                          - pluginId
                          - pluginInstallId
                          - pluginLogo
                        additionalProperties: false
                  sort:
                    type: object
                    nullable: true
                    properties:
                      sortObjs:
                        type: array
                        items:
                          type: object
                          properties:
                            fieldId:
                              type: string
                              description: The id of the field.
                            order:
                              type: string
                              enum:
                                - asc
                                - desc
                          required:
                            - fieldId
                            - order
                      manualSort:
                        type: boolean
                    required:
                      - sortObjs
                  filter:
                    type: object
                    description: >-
                      A filter object for complex query conditions based on
                      fields, operators, and values. Use our visual query
                      builder at
                      https://app.teable.ai/developer/tool/query-builder to
                      build filters.
                  group:
                    type: array
                    nullable: true
                    items:
                      type: object
                      properties:
                        fieldId:
                          type: string
                          description: The id of the field.
                        order:
                          type: string
                          enum:
                            - asc
                            - desc
                      required:
                        - fieldId
                        - order
                  isLocked:
                    type: boolean
                  shareId:
                    type: string
                  enableShare:
                    type: boolean
                  shareMeta:
                    type: object
                    properties:
                      allowCopy:
                        type: boolean
                      includeHiddenField:
                        type: boolean
                      password:
                        type: string
                        minLength: 3
                      includeRecords:
                        type: boolean
                      submit:
                        type: object
                        properties:
                          allow:
                            type: boolean
                          requireLogin:
                            type: boolean
                  createdBy:
                    type: string
                  lastModifiedBy:
                    type: string
                  createdTime:
                    type: string
                  lastModifiedTime:
                    type: string
                  columnMeta:
                    type: object
                    additionalProperties:
                      anyOf:
                        - type: object
                          properties:
                            order:
                              type: number
                              description: >-
                                Order is a floating number, column will sort by
                                it in the view.
                            width:
                              type: number
                              description: Column width in the view.
                            hidden:
                              type: boolean
                              description: If column hidden in the view.
                            statisticFunc:
                              type: string
                              nullable: true
                              enum:
                                - count
                                - empty
                                - filled
                                - unique
                                - max
                                - min
                                - sum
                                - average
                                - checked
                                - unChecked
                                - percentEmpty
                                - percentFilled
                                - percentUnique
                                - percentChecked
                                - percentUnChecked
                                - earliestDate
                                - latestDate
                                - dateRangeOfDays
                                - dateRangeOfMonths
                                - totalAttachmentSize
                              description: Statistic function of the column in the view.
                          required:
                            - order
                          additionalProperties: false
                        - type: object
                          properties:
                            order:
                              type: number
                              description: >-
                                Order is a floating number, column will sort by
                                it in the view.
                            visible:
                              type: boolean
                              description: If column visible in the kanban view.
                          required:
                            - order
                          additionalProperties: false
                        - type: object
                          properties:
                            order:
                              type: number
                              description: >-
                                Order is a floating number, column will sort by
                                it in the view.
                            visible:
                              type: boolean
                              description: If column visible in the gallery view.
                          required:
                            - order
                          additionalProperties: false
                        - type: object
                          properties:
                            order:
                              type: number
                              description: >-
                                Order is a floating number, column will sort by
                                it in the view.
                            visible:
                              type: boolean
                              description: If column visible in the view.
                            required:
                              type: boolean
                              description: If column is required.
                          required:
                            - order
                          additionalProperties: false
                        - type: object
                          properties:
                            order:
                              type: number
                              description: >-
                                Order is a floating number, column will sort by
                                it in the view.
                            hidden:
                              type: boolean
                              description: If column hidden in the view.
                          required:
                            - order
                          additionalProperties: false
                    description: >-
                      A mapping of view IDs to their corresponding column
                      metadata.
                  pluginId:
                    type: string
                required:
                  - id
                  - name
                  - type
                  - createdBy
                  - createdTime
                  - columnMeta
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/table/%7BtableId%7D/view \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","type":"grid","description":"string","order":0,"options":{"rowHeight":"short","fieldNameDisplayLines":1,"frozenColumnCount":0,"frozenFieldId":"string"},"sort":{"sortObjs":[{"fieldId":"string","order":"asc"}],"manualSort":true},"filter":{},"group":[{"fieldId":"string","order":"asc"}],"isLocked":true,"shareId":"string","enableShare":true,"shareMeta":{"allowCopy":true,"includeHiddenField":true,"password":"string","includeRecords":true,"submit":{"allow":true,"requireLogin":true}},"columnMeta":{"property1":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"},"property2":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"}}}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/table/%7BtableId%7D/view';
            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"name":"string","type":"grid","description":"string","order":0,"options":{"rowHeight":"short","fieldNameDisplayLines":1,"frozenColumnCount":0,"frozenFieldId":"string"},"sort":{"sortObjs":[{"fieldId":"string","order":"asc"}],"manualSort":true},"filter":{},"group":[{"fieldId":"string","order":"asc"}],"isLocked":true,"shareId":"string","enableShare":true,"shareMeta":{"allowCopy":true,"includeHiddenField":true,"password":"string","includeRecords":true,"submit":{"allow":true,"requireLogin":true}},"columnMeta":{"property1":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"},"property2":{"order":0,"width":0,"hidden":true,"statisticFunc":"count"}}}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/table/%7BtableId%7D/view',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              name: 'string',
              type: 'grid',
              description: 'string',
              order: 0,
              options: {
                rowHeight: 'short',
                fieldNameDisplayLines: 1,
                frozenColumnCount: 0,
                frozenFieldId: 'string'
              },
              sort: {sortObjs: [{fieldId: 'string', order: 'asc'}], manualSort: true},
              filter: {},
              group: [{fieldId: 'string', order: 'asc'}],
              isLocked: true,
              shareId: 'string',
              enableShare: true,
              shareMeta: {
                allowCopy: true,
                includeHiddenField: true,
                password: 'string',
                includeRecords: true,
                submit: {allow: true, requireLogin: true}
              },
              columnMeta: {
                property1: {order: 0, width: 0, hidden: true, statisticFunc: 'count'},
                property2: {order: 0, width: 0, hidden: true, statisticFunc: 'count'}
              }
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"name\":\"string\",\"type\":\"grid\",\"description\":\"string\",\"order\":0,\"options\":{\"rowHeight\":\"short\",\"fieldNameDisplayLines\":1,\"frozenColumnCount\":0,\"frozenFieldId\":\"string\"},\"sort\":{\"sortObjs\":[{\"fieldId\":\"string\",\"order\":\"asc\"}],\"manualSort\":true},\"filter\":{},\"group\":[{\"fieldId\":\"string\",\"order\":\"asc\"}],\"isLocked\":true,\"shareId\":\"string\",\"enableShare\":true,\"shareMeta\":{\"allowCopy\":true,\"includeHiddenField\":true,\"password\":\"string\",\"includeRecords\":true,\"submit\":{\"allow\":true,\"requireLogin\":true}},\"columnMeta\":{\"property1\":{\"order\":0,\"width\":0,\"hidden\":true,\"statisticFunc\":\"count\"},\"property2\":{\"order\":0,\"width\":0,\"hidden\":true,\"statisticFunc\":\"count\"}}}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/table/%7BtableId%7D/view", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````