Baserow Database table fields API

The Database table fields API from Baserow — 9 operation(s) for database table fields.

OpenAPI Specification

baserow-database-table-fields-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Baserow API spec Admin Database table fields API
  version: 2.2.2
  description: 'For more information about our REST API, please visit [this page](https://baserow.io/docs/apis%2Frest-api).


    For more information about our deprecation policy, please visit [this page](https://baserow.io/docs/apis%2Fdeprecations).'
  contact:
    url: https://baserow.io/contact
  license:
    name: MIT
    url: https://github.com/baserow/baserow/blob/develop/LICENSE
tags:
- name: Database table fields
paths:
  /api/database/fields/{field_id}/:
    get:
      operationId: get_database_table_field
      description: Returns the existing field if the authorized user has access to the related database's workspace. Depending on the type different properties could be returned.
      parameters:
      - in: path
        name: field_id
        schema:
          type: integer
        description: Returns the field related to the provided value.
        required: true
      tags:
      - Database table fields
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldField'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
    patch:
      operationId: update_database_table_field
      description: Updates the existing field if the authorized user has access to the related database's workspace. The type can also be changed and depending on that type, different additional properties can optionally be set. If you change the field type it could happen that the data conversion fails, in that case the `ERROR_CANNOT_CHANGE_FIELD_TYPE` is returned, but this rarely happens. If a data value cannot be converted it is set to `null` so data might go lost.If updated the field causes other fields to change then the specificinstances of those fields will be included in the related fields response key.
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: field_id
        schema:
          type: integer
        description: Updates the field related to the provided value.
        required: true
      tags:
      - Database table fields
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedFieldUpdateField'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedFieldUpdateField'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedFieldUpdateField'
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldFieldSerializerWithRelatedFields'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                    - ERROR_CANNOT_CHANGE_FIELD_TYPE
                    - ERROR_REQUEST_BODY_VALIDATION
                    - ERROR_RESERVED_BASEROW_FIELD_NAME
                    - ERROR_FIELD_WITH_SAME_NAME_ALREADY_EXISTS
                    - ERROR_INVALID_BASEROW_FIELD_NAME
                    - ERROR_FIELD_SELF_REFERENCE
                    - ERROR_FIELD_CIRCULAR_REFERENCE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
    delete:
      operationId: delete_database_table_field
      description: Deletes the existing field if the authorized user has access to the related database's workspace. Note that all the related data to that field is also deleted. Primary fields cannot be deleted because their value represents the row. If deleting the field causes other fields to change then the specificinstances of those fields will be included in the related fields response key.
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: field_id
        schema:
          type: integer
        description: Deletes the field related to the provided value.
        required: true
      tags:
      - Database table fields
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelatedFields'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                    - ERROR_CANNOT_DELETE_PRIMARY_FIELD
                    - ERROR_CANNOT_DELETE_ALREADY_DELETED_ITEM
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/{field_id}/duplicate/async/:
    post:
      operationId: duplicate_table_field
      description: Duplicates the table with the provided `table_id` parameter if the authorized user has access to the database's workspace.
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: field_id
        schema:
          type: integer
        description: The field to duplicate.
        required: true
      tags:
      - Database table fields
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateFieldJobTypeResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                    - ERROR_REQUEST_BODY_VALIDATION
                    - ERROR_MAX_JOB_COUNT_EXCEEDED
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/{field_id}/generate-ai-field-values/:
    post:
      operationId: generate_table_ai_field_value
      description: "Endpoint that's used by the AI field to start an sync task that will update the cell value of the provided row IDs based on the dynamically constructed prompt configured in the field settings. \nThis is a **premium** feature."
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: field_id
        schema:
          type: integer
        description: The field to generate the value for.
        required: true
      tags:
      - Database table fields
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateAIFieldValueView'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/GenerateAIFieldValueView'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GenerateAIFieldValueView'
        required: true
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateAIValuesJobTypeResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_GENERATIVE_AI_DOES_NOT_EXIST
                    - ERROR_MODEL_DOES_NOT_BELONG_TO_TYPE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                    - ERROR_ROW_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/{field_id}/unique_row_values/:
    get:
      operationId: get_database_field_unique_row_values
      description: Returns a list of all the unique row values for an existing field, sorted in order of frequency.
      parameters:
      - in: path
        name: field_id
        schema:
          type: integer
        description: Returns the values related to the provided field.
        required: true
      - in: query
        name: limit
        schema:
          type: integer
        description: Defines how many values should be returned.
      - in: query
        name: split_comma_separated
        schema:
          type: boolean
        description: Indicates whether the original column values must be splitted by comma.
      tags:
      - Database table fields
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UniqueRowValues'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/password-authentication/:
    post:
      operationId: password_field_authentication
      description: Checks if the provided password and row matches what is stored in the cell. The field must have `allow_endpoint_authentication` set to `true` in order to work.
      tags:
      - Database table fields
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordFieldAuthentication'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PasswordFieldAuthentication'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PasswordFieldAuthentication'
        required: true
      security:
      - UserSource JWT: []
      - JWT: []
      - Database token: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PasswordFieldAuthenticationResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_REQUEST_BODY_VALIDATION
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_NO_PERMISSION_TO_TABLE
                    - ERROR_INVALID_PASSWORD_FIELD_PASSWORD
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_FIELD_DOES_NOT_EXIST
                    - ERROR_ROW_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/table/{table_id}/:
    get:
      operationId: list_database_table_fields
      description: Lists all the fields of the table related to the provided parameter if the user has access to the related database's workspace. If the workspace is related to a template, then this endpoint will be publicly accessible. A table consists of fields and each field can have a different type. Each type can have different properties. A field is comparable with a regular table's column.
      parameters:
      - in: path
        name: table_id
        schema:
          type: integer
        description: Returns only the fields of the table related to the provided value.
        required: true
      tags:
      - Database table fields
      security:
      - UserSource JWT: []
      - JWT: []
      - Database token: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FieldField'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_NO_PERMISSION_TO_TABLE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_TABLE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
    post:
      operationId: create_database_table_field
      description: Creates a new field for the table related to the provided `table_id` parameter if the authorized user has access to the related database's workspace. Depending on the type, different properties can optionally be set.If creating the field causes other fields to change then the specificinstances of those fields will be included in the related fields response key.
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: table_id
        schema:
          type: integer
        description: Creates a new field for the provided table related to the value.
        required: true
      tags:
      - Database table fields
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldCreateField'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FieldCreateField'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FieldCreateField'
      security:
      - UserSource JWT: []
      - JWT: []
      - Database token: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldFieldSerializerWithRelatedFields'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_NOT_IN_GROUP
                    - ERROR_REQUEST_BODY_VALIDATION
                    - ERROR_MAX_FIELD_COUNT_EXCEEDED
                    - ERROR_RESERVED_BASEROW_FIELD_NAME
                    - ERROR_FIELD_WITH_SAME_NAME_ALREADY_EXISTS
                    - ERROR_INVALID_BASEROW_FIELD_NAME
                    - ERROR_FIELD_SELF_REFERENCE
                    - ERROR_FIELD_CIRCULAR_REFERENCE
                    - ERROR_IMMUTABLE_FIELD_PROPERTIES
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_NO_PERMISSION_TO_TABLE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_TABLE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/database/fields/table/{table_id}/change-primary-field/:
    post:
      operationId: change_primary_field
      description: Changes the primary field of a table to the one provided in the body payload.
      parameters:
      - in: header
        name: ClientSessionId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular client session. Then using the undo/redo endpoints with the same ClientSessionId header this action can be undone/redone.
      - in: header
        name: ClientUndoRedoActionGroupId
        schema:
          type: string
          format: uuid
        description: An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call.
      - in: path
        name: table_id
        schema:
          type: integer
        description: The table where to update the primary field in.
        required: true
      tags:
      - Database table fields
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangePrimaryFieldParams'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ChangePrimaryFieldParams'
          multipart/fo

# --- truncated at 32 KB (355 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/baserow/refs/heads/main/openapi/baserow-database-table-fields-api-openapi.yml