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

# Update a custom field

> Updates a custom-field definition. Only the properties you send change.

`slug` and `type` may be echoed with their stored values but never changed. `values` is merged by option `value`: existing options are edited in place, new ones are appended, and a stored option missing from the list is rejected — retire it with `status: "DEACTIVATED"` instead. `status` of the field itself is not writable here; use the activate and deactivate endpoints.


## OpenAPI

````yaml /api-reference/identity.openapi.json put /realms/{realmId}/organizations/{organizationId}/custom-fields/{customFieldId}
openapi: 3.0.3
info:
  title: Identity
  version: 1.0.0
  description: >-
    Portão 3 identity API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). 4 app groups run without
    the identity authorizer; publicPatterns enumerates every route they expose,
    except POST /auth/sign-in, documented with HTTP Basic for the API-client
    credentials flow. Confidence tiers: generated:typed=45 copied:manual=0
    unknown=0.
servers:
  - url: https://api.identity.v2.portao3.com.br/
    description: production
  - url: https://api.identity.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Authentication
  - name: Current User
  - name: Custom Fields
  - name: API Clients
  - name: Users
  - name: Organizations
  - name: Groups
  - name: Realms
paths:
  /realms/{realmId}/organizations/{organizationId}/custom-fields/{customFieldId}:
    put:
      tags:
        - Custom Fields
      summary: Update a custom field
      description: Updates a custom-field definition. Only the properties you send change.
      operationId: >-
        putRealmsByRealmIdOrganizationsByOrganizationIdCustomFieldsByCustomFieldId
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of your organization.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: customFieldId
          in: path
          required: true
          description: |-
            ID of the custom field.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 9c4f0a2e-7b3d-4e8a-a1f5-2d6c8b0e4a71
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  description: >-
                    New human-readable name of the field. Omit to keep the
                    current one.
                  example: Centro de custo
                  type: string
                  minLength: 1
                  maxLength: 50
                slug:
                  description: >-
                    Immutable. May be echoed with the stored value (for example
                    when resending the whole definition); a different value
                    answers 422 `CUSTOM_FIELD_SLUG_IMMUTABLE`.
                  example: centro-de-custo
                  type: string
                  minLength: 2
                  maxLength: 80
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                location:
                  description: >-
                    Replaces the full list of entities the field is attached to.
                    Omit to keep the current one.


                    ---


                    Example: `["TRANSACTION","CARD"]`
                  type: array
                  items:
                    type: string
                    enum:
                      - TRANSACTION
                      - CARD
                      - WALLET
                      - CUSTOMER
                      - TRIP
                      - TRAVEL_PASSENGER
                      - USER
                      - VEHICLE
                    example: TRANSACTION
                type:
                  description: >-
                    Immutable. May be echoed with the stored value; a different
                    value answers 422 `CUSTOM_FIELD_TYPE_IMMUTABLE`.
                  example: SELECT
                  type: string
                  enum:
                    - TEXT
                    - NUMBER
                    - DATE
                    - BOOLEAN
                    - SELECT
                    - MULTI_SELECT
                    - CUSTOMER
                    - FILE
                    - MULTI_FILE
                values:
                  description: >-
                    The complete option list of a `SELECT` / `MULTI_SELECT`
                    field, merged by `value`: existing options are edited in
                    place, new ones are appended, and a stored option that is
                    missing from the list is rejected — deactivate it instead.
                    Omit to leave the options untouched.
                  type: array
                  items:
                    type: object
                    properties:
                      value:
                        type: string
                        maxLength: 100
                        description: >-
                          Identity of the option. An existing `value` edits that
                          option in place; a new one appends an option. Every
                          stored option must be present — omitting one answers
                          422 `CUSTOM_FIELD_VALUE_CANNOT_BE_REMOVED`.
                        example: marketing
                      label:
                        type: string
                        minLength: 1
                        maxLength: 100
                        description: Display text of the option.
                        example: Marketing
                      description:
                        description: Optional help text for the option.
                        example: Campanhas e eventos
                        type: string
                        maxLength: 256
                      status:
                        description: >-
                          Set `DEACTIVATED` to retire an option: it stays
                          readable on historical values but can no longer be
                          chosen. Set `ACTIVE` to reinstate it.
                        example: ACTIVE
                        type: string
                        enum:
                          - ACTIVE
                          - DEACTIVATED
                    required:
                      - value
                      - label
                  nullable: true
                mask:
                  description: >-
                    Display format of a `NUMBER` field: `NONE`, `BRL`, `USD` or
                    `PERCENT`. A `NUMBER` field's existing mask cannot be
                    cleared (422 `CUSTOM_FIELD_MASK_REQUIRED`).
                  example: BRL
                  type: string
                required:
                  type: boolean
                  description: >-
                    Whether a value must be provided on every entity listed in
                    `location`.
                  example: true
                description:
                  description: Help text shown alongside the field.
                  example: Centro de custo responsável pela despesa
                  type: string
                  maxLength: 512
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier of the custom field.
                    example: 9c4f0a2e-7b3d-4e8a-a1f5-2d6c8b0e4a71
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - DEACTIVATED
                    description: >-
                      `ACTIVE` fields are rendered and validated on the entities
                      listed in `location`. `DEACTIVATED` fields are hidden from
                      new entries while their stored values stay readable.
                      Changed only through the activate and deactivate
                      endpoints.
                    example: ACTIVE
                  realm:
                    type: string
                    description: Realm the field belongs to.
                    example: 6f1d2c3b-4a5e-4f60-9b7c-8d9e0f1a2b3c
                  organization:
                    type: string
                    description: Organization the field belongs to.
                    example: 0b8e7d6c-5a4f-4e3d-9c2b-1a0f9e8d7c6b
                  label:
                    type: string
                    description: Human-readable name shown wherever the field is rendered.
                    example: Centro de custo
                  slug:
                    type: string
                    description: >-
                      Stable key of the field: the property name under which its
                      value is stored in the `customFields` map of transactions,
                      cards, wallets, users and the other entities in
                      `location`. Unique per organization and immutable after
                      creation.
                    example: centro-de-custo
                  type:
                    type: string
                    enum:
                      - TEXT
                      - NUMBER
                      - DATE
                      - BOOLEAN
                      - SELECT
                      - MULTI_SELECT
                      - CUSTOMER
                      - FILE
                      - MULTI_FILE
                    description: Value type the field accepts. Immutable after creation.
                    example: SELECT
                  values:
                    type: array
                    items:
                      type: object
                      properties:
                        value:
                          type: string
                          description: >-
                            Stored identifier of the option — the value written
                            to the entity's `customFields` map when this option
                            is chosen. Immutable, and unique within the field on
                            creation. A few definitions created before that rule
                            still carry a repeated `value` (each occurrence with
                            its own label and `_id`), and updates preserve them
                            — treat `values` as an ordered list, not as a map
                            keyed by `value`.
                          example: marketing
                        label:
                          type: string
                          description: Display text of the option.
                          example: Marketing
                        description:
                          type: string
                          description: >-
                            Optional help text for the option. Empty when none
                            was given.
                          example: Campanhas e eventos
                        status:
                          type: string
                          enum:
                            - ACTIVE
                            - DEACTIVATED
                          description: >-
                            `ACTIVE` options can be selected. `DEACTIVATED`
                            options are kept so historical values still render,
                            but can no longer be chosen.
                          example: ACTIVE
                        _id:
                          type: string
                          description: >-
                            Internal identifier assigned when the option is
                            stored. Present on reads (get, list, activate,
                            deactivate); absent on the create response and, on
                            an update response, for an option that request has
                            just appended — the update returns what it wrote, so
                            fetch the field again if you need the new option's
                            `_id`. Ignored on writes: match options by `value`.
                          example: 68d3f1a2c4b5e6f7a8b9c0d1
                      required:
                        - value
                        - label
                      description: >-
                        One selectable option of a `SELECT` / `MULTI_SELECT`
                        custom field.
                    description: >-
                      Selectable options of a `SELECT` / `MULTI_SELECT` field.
                      Normally empty for the other types.
                  location:
                    type: array
                    items:
                      type: string
                      enum:
                        - TRANSACTION
                        - CARD
                        - WALLET
                        - CUSTOMER
                        - TRIP
                        - TRAVEL_PASSENGER
                        - USER
                        - VEHICLE
                      example: TRANSACTION
                    description: >-
                      Entities the field is attached to. A value is accepted —
                      and, when `required` is true, demanded — on each listed
                      entity.


                      ---


                      Example: `["TRANSACTION","CARD"]`
                  mask:
                    type: string
                    description: >-
                      Display format of a `NUMBER` field: `NONE` (plain number),
                      `BRL` (Brazilian reais), `USD` (US dollars) or `PERCENT`.
                      Empty for the other types.
                    example: BRL
                  required:
                    type: boolean
                    description: >-
                      Whether a value must be provided on every entity listed in
                      `location`.
                    example: true
                  description:
                    type: string
                    description: >-
                      Optional help text shown alongside the field. Empty when
                      none was given.
                    example: Centro de custo responsável pela despesa
                  createdBy:
                    type: string
                    description: ID of the user who created the field.
                    example: 3e2d1c0b-9a8f-4e7d-8c6b-5a4f3e2d1c0b
                  updatedBy:
                    type: string
                    description: ID of the user who last changed the field.
                    example: 3e2d1c0b-9a8f-4e7d-8c6b-5a4f3e2d1c0b
                  createdAt:
                    type: string
                    description: When the field was created (ISO 8601, UTC).
                    example: '2026-09-02T14:21:05.318Z'
                  updatedAt:
                    type: string
                    description: When the field was last changed (ISO 8601, UTC).
                    example: '2026-09-18T09:07:44.902Z'
                required:
                  - id
                  - status
                  - realm
                  - organization
                  - label
                  - slug
                  - type
                  - values
                  - location
                  - mask
                  - required
                  - description
                  - createdBy
                  - updatedBy
                description: A custom-field definition.
        '404':
          description: >-
            `CUSTOM_FIELD_NOT_FOUND` — No field with that ID exists in the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - CUSTOM_FIELD_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: CUSTOM_FIELD_NOT_FOUND
                origin: IDENTITY
                message: Custom field not found
        '409':
          description: >-
            `CUSTOM_FIELD_CONCURRENT_UPDATE` — Another request changed the field
            meanwhile; fetch it again and retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - CUSTOM_FIELD_CONCURRENT_UPDATE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: CUSTOM_FIELD_CONCURRENT_UPDATE
                origin: IDENTITY
                message: >-
                  Custom field was modified by another request — reload it and
                  try again
        '422':
          description: >-
            `CUSTOM_FIELD_SLUG_IMMUTABLE` — `slug` differs from the stored one.


            `CUSTOM_FIELD_TYPE_IMMUTABLE` — `type` differs from the stored one.


            `CUSTOM_FIELD_VALUE_CANNOT_BE_REMOVED` — A stored option is missing
            from `values`; deactivate it instead.


            `CUSTOM_FIELD_DUPLICATED_VALUE` — `values` repeats a `value` more
            often than it is already stored.


            `CUSTOM_FIELD_MASK_REQUIRED` — The request clears the `mask` of a
            `NUMBER` field.


            `BAD_REQUEST` — A path parameter is not a valid ID or the body
            failed validation; `fields` lists each offending field.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - CUSTOM_FIELD_SLUG_IMMUTABLE
                      - CUSTOM_FIELD_TYPE_IMMUTABLE
                      - CUSTOM_FIELD_VALUE_CANNOT_BE_REMOVED
                      - CUSTOM_FIELD_DUPLICATED_VALUE
                      - CUSTOM_FIELD_MASK_REQUIRED
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - IDENTITY
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: CUSTOM_FIELD_SLUG_IMMUTABLE
                origin: IDENTITY
                message: Custom field slug cannot be changed after creation

````

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