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

# Criar campo adicional

> Cria um novo campo adicional no workspace.

Para os tipos `select` e `multi_select`, envie as opções disponíveis em `value` como um array de strings.

<Accordion title="Escopo necessário">
`custom_fields:write`
</Accordion>



## OpenAPI

````yaml /pt/api-reference/openapi.json post /v1/custom-fields
openapi: 3.1.0
info:
  title: OAuth 2.1
  description: Endpoints para registrar aplicativos e gerenciar tokens OAuth 2.1.
  version: 1.0.0
  contact:
    name: Suporte Vendaze
    email: suporte@vendaze.com
servers:
  - url: https://api.vendaze.com
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: OAuth
  - name: Pessoas
  - name: Empresas
  - name: Negócios
  - name: Pipelines
  - name: Tarefas
  - name: Tipos de Tarefas
  - name: Produtos
  - name: Tags
  - name: Listas
  - name: Campos Adicionais
  - name: Webhooks
paths:
  /v1/custom-fields:
    post:
      tags:
        - Campos Adicionais
      summary: Criar campo adicional
      description: >-
        Cria um novo campo adicional no workspace.


        Para os tipos `select` e `multi_select`, envie as opções disponíveis em
        `value` como um array de strings.


        <Accordion title="Escopo necessário">

        `custom_fields:write`

        </Accordion>
      operationId: createCustomField
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomFieldRequest'
      responses:
        '201':
          description: Campo criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateCustomFieldRequest:
      type: object
      required:
        - label
        - key
        - type
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 40
          description: Rótulo do campo.
          example: CPF
        key:
          type: string
          minLength: 1
          maxLength: 35
          pattern: ^[a-z0-9]+(_[a-z0-9]+)*$
          description: >-
            Chave única no workspace. Apenas letras minúsculas, dígitos e
            underscores entre palavras.
          example: cpf_cliente
        type:
          type: string
          enum:
            - text
            - long_text
            - select
            - multi_select
            - cpf
            - cnpj
            - date
            - number
            - link
            - address
          description: Tipo do campo.
        value:
          description: >-
            Opções para tipos `select` e `multi_select`. Obrigatório quando
            `type` for `select` ou `multi_select`. Deve ser omitido para todos
            os outros tipos de campo.
          example:
            select_list:
              - key: sl_opcao_a
                option: Opção A
              - key: sl_opcao_b
                option: Opção B
          properties:
            select_list:
              type: array
              items:
                type: object
                required:
                  - key
                  - option
                properties:
                  key:
                    type: string
                    description: >-
                      Identificador único da opção dentro do campo. Apenas
                      letras minúsculas, dígitos e underscores.
                    example: sl_opcao_a
                  option:
                    type: string
                    description: Texto exibido ao usuário.
                    example: Opção A
        required:
          type: boolean
          description: 'Se o campo é obrigatório. Padrão: `false`.'
          example: false
        show_people:
          type: boolean
          description: 'Exibir em pessoas. Padrão: `true`.'
          example: true
        show_companies:
          type: boolean
          description: 'Exibir em empresas. Padrão: `true`.'
          example: false
        show_deals:
          type: boolean
          description: 'Exibir em negócios. Padrão: `false`.'
          example: false
    CustomFieldResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CustomField'
    CustomField:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identificador único.
        label:
          type: string
          maxLength: 40
          description: Rótulo exibido na interface.
          example: CPF
        key:
          type: string
          maxLength: 35
          description: >-
            Chave única no workspace. Usada para referenciar o campo ao associar
            valores a registros.
          example: cpf_cliente
        type:
          type: string
          enum:
            - text
            - long_text
            - select
            - multi_select
            - cpf
            - cnpj
            - date
            - number
            - link
            - address
          description: Tipo do campo. Define o formato esperado do valor.
        value:
          description: >-
            Para tipos `select` e `multi_select`: lista de opções. Obrigatório
            para esses tipos. Deve ser omitido para todos os outros tipos de
            campo.
          nullable: true
          example:
            select_list:
              - key: sl_opcao_a
                option: Opção A
              - key: sl_opcao_b
                option: Opção B
        required:
          type: boolean
          description: Indica se o campo é obrigatório ao criar ou editar um registro.
        show_people:
          type: boolean
          description: Se este campo aparece em registros de pessoas.
        show_companies:
          type: boolean
          description: Se este campo aparece em registros de empresas.
        show_deals:
          type: boolean
          description: Se este campo aparece em registros de negócios.
        created_at:
          type: string
          format: date-time
          description: Data de criação em ISO 8601 UTC.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
              format: uuid
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: Validation failed.
            fields:
              type: object
              additionalProperties:
                type: string
            request_id:
              type: string
              format: uuid
  responses:
    BadRequest:
      description: 'Body malformado ou PATCH sem campos. Código de erro: `bad_request`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: bad_request
              message: Request body must be valid JSON.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Unauthorized:
      description: >-
        Token ausente, inválido ou expirado. Códigos possíveis: `unauthorized`,
        `token_expired`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthorized
              message: Missing or invalid Authorization header.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InsufficientScope:
      description: 'Token sem o escopo necessário. Código de erro: `insufficient_scope`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: insufficient_scope
              message: This endpoint requires the 'webhooks:read' scope.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Conflict:
      description: >-
        Já existe um campo com a mesma `key` no workspace. Código de erro:
        `conflict`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: conflict
              message: A record with this value already exists.
              fields:
                key: Value already in use.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    ValidationError:
      description: >-
        Validação de entrada falhou. Código: `validation_error`. O objeto
        `fields` mapeia cada campo inválido para uma descrição do problema.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            error:
              code: validation_error
              message: Validation failed.
              fields:
                url: url must use HTTPS.
                events: At least one event is required.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    RateLimitExceeded:
      description: 'Rate limit excedido. Código: `rate_limit_exceeded`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded. Try again in 60 seconds.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InternalError:
      description: 'Erro interno inesperado. Código: `internal_error`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal_error
              message: An unexpected error occurred.
              request_id: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token OAuth 2.1.

````