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

# Create a custom_field

> Create a new custom field. book_id is accepted for backwards compatibility but ignored.



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/custom_fields
openapi: 3.0.1
info:
  title: Slant Public API V1
  version: v1
  description: Public API for creating and managing resources in Slant
  contact:
    name: Slant API Support
    email: api@slant.com
servers:
  - url: https://api.slant.app
security:
  - bearer: []
paths:
  /v1/custom_fields:
    post:
      tags:
        - Custom Fields
      summary: Create a custom_field
      description: >-
        Create a new custom field. book_id is accepted for backwards
        compatibility but ignored.
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
          description: >-
            Unique key to ensure idempotent request handling. If a request with
            the same key was already processed, the original response will be
            returned.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - field_key
                - display_name
                - entity_type
                - field_type
              properties:
                book_id:
                  type: string
                  description: Deprecated. Ignored.
                  example: abc123xyz
                field_key:
                  type: string
                  description: >-
                    Unique field key (lowercase, letters, numbers, underscores
                    only)
                  example: pageport_lead_source
                display_name:
                  type: string
                  description: Human-readable field name
                  example: Lead Source
                entity_type:
                  type: string
                  description: >-
                    Entity type this field applies to (Client and Prospect
                    normalize to Household)
                  example: Household
                  enum:
                    - Household
                    - Person
                    - Contact
                    - Opportunity
                field_type:
                  type: string
                  description: Data type of the field
                  example: text
                  enum:
                    - text
                    - number
                    - date
                    - boolean
                    - single_select
                    - multi_select
                    - cross_reference
                options:
                  type: object
                  description: >-
                    Field-specific options (required for select fields and
                    cross_reference)
                  properties:
                    select_options:
                      type: array
                      items:
                        type: string
                      description: Options for single_select and multi_select fields
                      example:
                        - Option 1
                        - Option 2
                        - Option 3
                    cross_reference_allowed_target_types:
                      type: array
                      items:
                        type: string
                      description: Allowed target types for cross_reference fields
                      example:
                        - Household
                        - Contact
        required: true
      responses:
        '201':
          description: custom_field created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
        '400':
          description: bad request - invalid JSON
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - invalid_json
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
        '401':
          description: unauthorized - missing or invalid token
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - token_missing
                      - token_invalid
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
        '403':
          description: forbidden
        '422':
          description: unprocessable entity - invalid payload
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - detail
                properties:
                  error:
                    type: string
                    description: Error code
                    enum:
                      - invalid_payload
                      - record_invalid
                      - parameter_missing
                  detail:
                    oneOf:
                      - type: string
                        description: Human-readable error description
                      - type: array
                        items:
                          type: string
                        description: Array of validation error messages
      security:
        - bearer: []
components:
  schemas:
    CustomField:
      type: object
      required:
        - id
        - field_key
        - display_name
        - entity_type
        - field_type
      properties:
        id:
          type: string
          description: The custom field ID
          example: abc123xyz
        field_key:
          type: string
          description: The unique field key
          example: pageport_lead_source
        display_name:
          type: string
          description: The human-readable field name
          example: Lead Source
        entity_type:
          type: string
          description: The entity type this field applies to
          example: Household
          enum:
            - Household
            - Person
            - Contact
            - Opportunity
        field_type:
          type: string
          description: The field data type
          example: text
          enum:
            - text
            - number
            - date
            - boolean
            - single_select
            - multi_select
            - cross_reference
        options:
          type: object
          nullable: true
          description: >-
            Field-specific options (e.g., select_options for select fields,
            cross_reference_allowed_target_types for cross_reference)
          properties:
            select_options:
              type: array
              items:
                type: string
              example:
                - Option 1
                - Option 2
            cross_reference_allowed_target_types:
              type: array
              items:
                type: string
              example:
                - Household
                - Contact
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: OAuth
      description: OAuth 2.0 Bearer Token from Clerk authentication

````