Twenty fields API

Custom field metadata management

OpenAPI Specification

twenty-fields-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Twenty Core companies fields API
  description: 'The Twenty Core API provides REST endpoints for CRUD operations on all CRM records including companies, people, opportunities, notes, tasks, and any custom objects defined in a workspace. All list endpoints use cursor-based pagination. Authentication is via Bearer token generated from workspace Settings → Playground. The API schema is per-tenant and adapts automatically as custom objects are added.

    Note: The full workspace-specific schema is available at https://api.twenty.com/open-api/core (requires Bearer token) and reflects all standard and custom objects configured in your workspace.

    '
  version: v0.1
  contact:
    email: felix@twenty.com
  license:
    name: AGPL-3.0
    url: https://github.com/twentyhq/twenty?tab=License-1-ov-file#readme
  termsOfService: https://github.com/twentyhq/twenty?tab=coc-ov-file#readme
servers:
- url: https://api.twenty.com/rest/core
  description: Production
security:
- bearerAuth: []
tags:
- name: fields
  description: Custom field metadata management
paths:
  /fields:
    get:
      tags:
      - fields
      summary: Find Many Fields
      description: Returns metadata for all fields across all objects in the workspace.
      operationId: findManyFields
      parameters:
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/orderBy'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/startingAfter'
      - $ref: '#/components/parameters/endingBefore'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldMetadataListResponse'
        '401':
          $ref: '#/components/responses/401'
    post:
      tags:
      - fields
      summary: Create One Field
      description: Creates a new custom field on an object.
      operationId: createOneField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldMetadataInput'
            example:
              objectMetadataId: 3c2a1d0e-1234-5678-abcd-ef0123456789
              name: invoiceNumber
              label: Invoice Number
              type: TEXT
              description: Unique invoice identifier
              icon: IconHash
              isNullable: false
      responses:
        '201':
          description: Field created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldMetadataResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
  /fields/{id}:
    parameters:
    - $ref: '#/components/parameters/id'
    get:
      tags:
      - fields
      summary: Find One Field
      operationId: findOneField
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldMetadataResponse'
        '401':
          $ref: '#/components/responses/401'
    patch:
      tags:
      - fields
      summary: Update One Field
      operationId: updateOneField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldMetadataInput'
      responses:
        '200':
          description: Field updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldMetadataResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
    delete:
      tags:
      - fields
      summary: Delete One Field
      operationId: deleteOneField
      responses:
        '200':
          description: Field deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          $ref: '#/components/responses/401'
components:
  parameters:
    id:
      name: id
      in: path
      required: true
      description: Object UUID
      schema:
        type: string
        format: uuid
    endingBefore:
      name: ending_before
      in: query
      required: false
      description: Cursor for backward pagination
      schema:
        type: string
    startingAfter:
      name: starting_after
      in: query
      required: false
      description: Cursor for forward pagination
      schema:
        type: string
    filter:
      name: filter
      in: query
      required: false
      description: Filter expression
      schema:
        type: string
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of records to return (default 1000)
      schema:
        type: integer
        minimum: 0
        maximum: 1000
        default: 1000
    orderBy:
      name: order_by
      in: query
      required: false
      description: Ordering clause
      schema:
        type: string
  schemas:
    FieldMetadataResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            field:
              $ref: '#/components/schemas/FieldMetadata'
    FieldMetadataListResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            fields:
              type: object
              properties:
                edges:
                  type: array
                  items:
                    type: object
                    properties:
                      node:
                        $ref: '#/components/schemas/FieldMetadata'
                      cursor:
                        type: string
                pageInfo:
                  $ref: '#/components/schemas/PageInfo'
                totalCount:
                  type: integer
    FieldMetadata:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        objectMetadataId:
          type: string
          format: uuid
        name:
          type: string
          description: Camel-case field name
        label:
          type: string
          description: Human-readable field label
        type:
          type: string
          enum:
          - TEXT
          - RICH_TEXT
          - NUMERIC
          - NUMBER
          - BOOLEAN
          - DATE
          - DATE_TIME
          - SELECT
          - MULTI_SELECT
          - RELATION
          - CURRENCY
          - FULL_NAME
          - EMAILS
          - PHONES
          - LINKS
          - ADDRESS
          - RATING
          - UUID
          - JSON
          - ARRAY
          - TS_VECTOR
        description:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
        isNullable:
          type: boolean
        isCustom:
          type: boolean
          readOnly: true
        isSystem:
          type: boolean
          readOnly: true
        isActive:
          type: boolean
        defaultValue:
          nullable: true
        options:
          type: array
          nullable: true
          items:
            type: object
            properties:
              id:
                type: string
              value:
                type: string
              label:
                type: string
              color:
                type: string
    DeleteResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
    FieldMetadataInput:
      type: object
      required:
      - objectMetadataId
      - name
      - label
      - type
      properties:
        objectMetadataId:
          type: string
          format: uuid
        name:
          type: string
        label:
          type: string
        type:
          type: string
          enum:
          - TEXT
          - RICH_TEXT
          - NUMERIC
          - NUMBER
          - BOOLEAN
          - DATE
          - DATE_TIME
          - SELECT
          - MULTI_SELECT
          - CURRENCY
          - FULL_NAME
          - EMAILS
          - PHONES
          - LINKS
          - ADDRESS
          - RATING
          - UUID
          - JSON
          - ARRAY
        description:
          type: string
        icon:
          type: string
        isNullable:
          type: boolean
        defaultValue:
          nullable: true
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              label:
                type: string
              color:
                type: string
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
        messages:
          type: array
          items:
            type: string
        error:
          type: string
    PageInfo:
      type: object
      properties:
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          type: string
          nullable: true
        endCursor:
          type: string
          nullable: true
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            statusCode: 403
            messages:
            - Missing authentication token
            error: FORBIDDEN_EXCEPTION
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Workspace-scoped Bearer token. Generate from Settings → Playground in your Twenty workspace.

        '
externalDocs:
  description: Twenty Developer Documentation
  url: https://docs.twenty.com/developers/extend/api