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

# Post v1custom fields



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/custom-fields
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/custom-fields:
    post:
      tags:
        - CustomFields
      operationId: custom-fields.store
      requestBody:
        description: '`CustomFieldDataRequest`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldDataRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CustomFieldResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          type:
                            type: array
                            prefixItems:
                              - type: string
                            minItems: 1
                            maxItems: 1
                            additionalItems: false
                        required:
                          - type
                    required:
                      - errors
                  - type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          type:
                            type: array
                            prefixItems:
                              - type: string
                                enum:
                                  - Please contact support for boolean type
                                  - Invalid field type
                            minItems: 1
                            maxItems: 1
                            additionalItems: false
                        required:
                          - type
                    required:
                      - errors
                  - type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          key:
                            type: array
                            prefixItems:
                              - type: string
                                example: Field key already exists
                            minItems: 1
                            maxItems: 1
                            additionalItems: false
                        required:
                          - key
                    required:
                      - errors
components:
  schemas:
    CustomFieldDataRequest:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - string
            - number
            - datetime
        description:
          type:
            - string
            - 'null'
        resource:
          type: string
          enum:
            - contact
            - sms
          default: contact
      required:
        - name
        - type
      title: CustomFieldDataRequest
    CustomFieldResource:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        key:
          type: string
        type:
          type: string
        created_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - name
        - key
        - type
        - created_at
      title: CustomFieldResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````