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

# Create a field

> Creates the field in the project of the API key and answers 201 with the created record.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/fields
openapi: 3.0.3
info:
  title: Leadstaker API
  version: 1.0.0
  description: Public REST API for Leadstaker projects.
servers:
  - url: https://n-api.leadstaker.com
    description: Production
security: []
tags:
  - name: Fields
    description: >-
      Custom field definitions, both the built-in ones and the ones a project
      creates.
  - name: Field groups
    description: Sections that organize custom fields in the interface.
  - name: Deals
    description: Opportunities moving through a pipeline, each tied to a contact.
  - name: Contacts
    description: >-
      People inside a project, holding the custom field values collected about
      them.
  - name: Messages
    description: Individual messages inside a chat, inbound and outbound.
  - name: Chats
    description: Conversations with a contact over a connected channel.
  - name: Loss reasons
    description: The catalog of reasons a deal can be marked as lost.
  - name: Pipelines
    description: Ordered sets of stages a deal travels through.
  - name: Stages
    description: Steps inside a pipeline, including the built-in open and closed ones.
  - name: Tags
    description: Free-form labels attached to deals.
  - name: Notes
    description: >-
      Free text attached to a contact or a deal, written by a user, an agent, or
      the system.
paths:
  /v1/fields:
    post:
      tags:
        - Fields
      summary: Create a field
      description: >-
        Creates the field in the project of the API key and answers 201 with the
        created record.
      operationId: postFields
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - TEXT
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - NUMBER
                    config:
                      type: object
                      properties:
                        min:
                          type: number
                        max:
                          type: number
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - DATE
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - BOOLEAN
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - OPTIONS
                    config:
                      type: object
                      properties:
                        options:
                          type: array
                          items:
                            type: string
                          minItems: 1
                      required:
                        - options
                      additionalProperties: false
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                    - config
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - MULTISELECT
                    config:
                      type: object
                      properties:
                        options:
                          type: array
                          items:
                            type: string
                          minItems: 1
                      required:
                        - options
                      additionalProperties: false
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                    - config
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - PHONE
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - EMAIL
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - CPF
                    config:
                      type: object
                      properties:
                        strict:
                          type: boolean
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - CNPJ
                    config:
                      type: object
                      properties:
                        strict:
                          type: boolean
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - CPF_CNPJ
                    config:
                      type: object
                      properties:
                        strict:
                          type: boolean
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - CEP
                    config:
                      type: object
                      properties: {}
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - DEAL
                        - CONTACT
                    label:
                      type: string
                    fieldGroupId:
                      type: string
                    type:
                      type: string
                      enum:
                        - CURRENCY
                    config:
                      type: object
                      properties:
                        currency:
                          type: string
                          enum:
                            - BRL
                        min:
                          type: number
                        max:
                          type: number
                      additionalProperties: false
                      default: {}
                    position:
                      type: integer
                      minimum: 0
                    level:
                      type: string
                      enum:
                        - USER
                        - API
                      default: USER
                  required:
                    - entityType
                    - label
                    - type
                  additionalProperties: false
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - TEXT
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - NUMBER
                      config:
                        type: object
                        properties:
                          min:
                            type: number
                          max:
                            type: number
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - DATE
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - BOOLEAN
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - OPTIONS
                      config:
                        type: object
                        properties:
                          options:
                            type: array
                            items:
                              type: string
                            minItems: 1
                        required:
                          - options
                        additionalProperties: false
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - config
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - MULTISELECT
                      config:
                        type: object
                        properties:
                          options:
                            type: array
                            items:
                              type: string
                            minItems: 1
                        required:
                          - options
                        additionalProperties: false
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - config
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - PHONE
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - EMAIL
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - CPF
                      config:
                        type: object
                        properties:
                          strict:
                            type: boolean
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - CNPJ
                      config:
                        type: object
                        properties:
                          strict:
                            type: boolean
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - CPF_CNPJ
                      config:
                        type: object
                        properties:
                          strict:
                            type: boolean
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - CEP
                      config:
                        type: object
                        properties: {}
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
                  - type: object
                    properties:
                      entityType:
                        type: string
                        enum:
                          - DEAL
                          - CONTACT
                      label:
                        type: string
                      fieldGroupId:
                        type: string
                      id:
                        type: string
                        minLength: 1
                      type:
                        type: string
                        enum:
                          - CURRENCY
                      config:
                        type: object
                        properties:
                          currency:
                            type: string
                            enum:
                              - BRL
                          min:
                            type: number
                          max:
                            type: number
                        additionalProperties: false
                        default: {}
                      position:
                        type: integer
                        minimum: 0
                      level:
                        type: string
                        enum:
                          - USER
                          - API
                      code:
                        type: string
                        enum:
                          - NAME
                          - PHONE
                          - EMAIL
                          - PRICE
                          - ACQUISITION_SOURCE
                          - ORIGIN_URL
                          - LEAD_ID
                          - WHATSAPP_LID
                          - CUSTOM_ID
                      projectId:
                        type: string
                        minLength: 1
                      archivedAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - entityType
                      - label
                      - id
                      - type
                      - level
                    additionalProperties: false
              example:
                id: 66eab3c47d21ff0011b2d6e8
                entityType: CONTACT
                label: Nome
                type: TEXT
                config: {}
                position: 0
                level: USER
                fieldGroupId: 66eab3c47d21ff0011b2d6f0
                projectId: 665f1c2e8a94b70012d4e9a1
                createdAt: '2026-01-12T14:08:00.000Z'
                updatedAt: '2026-01-15T09:32:00.000Z'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The payload failed validation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    Error:
      type: object
      required:
        - errorCode
        - message
        - status
      properties:
        errorCode:
          type: string
        message:
          type: string
        status:
          type: integer
        errors:
          type: array
          items:
            type: object
            required:
              - field
              - code
              - message
            properties:
              field:
                type: string
              code:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````