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

# Create custom field

> Create a custom field in the company. An `option` field is created with its options.

Version:
v4


## OpenAPI

````yaml openapi-v2.json POST /core/v4/custom-fields
openapi: 3.0.0
info:
  title: Sesame Public API v2
  description: >-
    Public API v2 — additive surface `/public/{context}/v{N}`,
    endpoint-versioned from v4
  version: 1.0.0
servers:
  - url: https://api.sesamehr.com
    description: Production
security:
  - Bearer: []
paths:
  /core/v4/custom-fields:
    post:
      tags:
        - Custom fields
      summary: Create custom field
      description: >-
        Create a custom field in the company. An `option` field is created with
        its options.
      operationId: CreateCustomField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomFieldRequest'
      responses:
        '201':
          description: The identifier of the created custom field.
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/CreatedEntry'
                type: object
        '401':
          description: Missing or invalid API key
        '403':
          description: API consumer lacks permission over the requested resource
        '422':
          description: Validation error
components:
  schemas:
    CreateCustomFieldRequest:
      required:
        - name
        - type
      properties:
        name:
          description: >-
            Unique within the company. The read-only `slug` is generated from
            it.
          type: string
          maxLength: 255
        type:
          type: string
          enum:
            - date
            - email
            - geo
            - numeric
            - option
            - phone
            - text
            - url
        section:
          type: string
          default: default
          enum:
            - default
            - labor
            - personal
        options:
          description: >-
            Option names. Required, with at least one name, when `type` is
            `option`; not allowed for any other type. Names are compared
            ignoring case and surrounding spaces and must not repeat.
          type: array
          items:
            type: string
            maxLength: 255
          minItems: 1
      type: object
    CreatedEntry:
      properties:
        id:
          description: Identifier of the created resource.
          type: string
          format: uuid
      type: object
  securitySchemes:
    Bearer:
      type: http
      description: 'Sesame Public API consumer token (Authorization: Bearer <token>)'
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.