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

# Update custom field

> This endpoint enables you to update a specific custom field of your organization by specifying its ID.
You can update the **name**, **description**, **slug**, **constraints**, and **section assignment** of the custom field. However, the **type** of a custom field cannot be modified. Use the `force` parameter to apply changes that might conflict with existing business data. `PROVIDER` users can pass `org_id` to update a custom field for a managed organization.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml put /custom_fields/{custom_field_id}
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /custom_fields/{custom_field_id}:
    put:
      tags:
        - Custom Fields
      summary: Update custom field
      description: >
        This endpoint enables you to update a specific custom field of your
        organization by specifying its ID.

        You can update the **name**, **description**, **slug**, **constraints**,
        and **section assignment** of the custom field. However, the **type** of
        a custom field cannot be modified. Use the `force` parameter to apply
        changes that might conflict with existing business data. `PROVIDER`
        users can pass `org_id` to update a custom field for a managed
        organization.
      operationId: putUpdateCustomFields
      parameters:
        - $ref: '#/components/parameters/custom_field_id'
        - $ref: '#/components/parameters/query_org_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CustomFieldEditTypeBool'
                  title: Boolean Field
                - $ref: '#/components/schemas/CustomFieldEditTypeText'
                  title: Text Field
                - $ref: '#/components/schemas/CustomFieldEditTypeInteger'
                  title: Integer Field
                - $ref: '#/components/schemas/CustomFieldEditTypeFloat'
                  title: Float Field
                - $ref: '#/components/schemas/CustomFieldTypeEditSingleSelect'
                  title: Single Select Field
                - $ref: '#/components/schemas/CustomFieldTypeEditMultipleSelect'
                  title: Multiple Select Field
                - $ref: '#/components/schemas/CustomFieldTypeEditMultipleSelectImage'
                  title: Multiple Select Image Field
                - $ref: '#/components/schemas/CustomFieldTypeEditImagesUploader'
                  title: Images Uploader Field
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/RequestStatus'
        '400':
          description: New constraints are not respected for some businesses
          content:
            application/json:
              schema:
                anyOf:
                  - title: Text Field Error
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          json:
                            type: object
                            properties:
                              businesses_count:
                                type: integer
                                description: Number of businesses in error
                                example: 2
                              description:
                                type: string
                                description: Error description
                                example: >-
                                  At least one business does not respect the new
                                  constraints, please send forced_update=true to
                                  force update.
                              constraints:
                                type: array
                                description: Constraints in error
                                items:
                                  type: string
                                example:
                                  - max_len
                  - title: Number Field Error
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          json:
                            type: object
                            properties:
                              businesses_count:
                                type: integer
                                description: Number of businesses in error
                                example: 2
                              description:
                                type: string
                                description: Error description
                                example: >-
                                  At least one business does not respect the new
                                  constraints, please send forced_update=true to
                                  force update.
                              constraints:
                                type: array
                                description: Constraints in error
                                items:
                                  type: string
                                example:
                                  - min
                                  - max
                  - title: Select Field Error
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          json:
                            type: object
                            properties:
                              businesses_count:
                                type: integer
                                description: Number of businesses in error
                                example: 2
                              description:
                                type: string
                                description: Error description
                                example: >-
                                  At least one business had one of these values,
                                  please send forced_update=true to force
                                  update.
                              options:
                                type: array
                                description: Options in error
                                items:
                                  type: string
                                example:
                                  - free parking
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    custom_field_id:
      in: path
      name: custom_field_id
      required: true
      schema:
        $ref: '#/components/schemas/CustomFieldId'
    query_org_id:
      in: query
      name: org_id
      schema:
        type: integer
      required: false
      description: >
        Organization ID. Only `PROVIDER` users can specify a different
        organization. If not provided, defaults to your own organization.
  schemas:
    CustomFieldEditTypeBool:
      description: Boolean Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeBool'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldEditTypeText:
      description: Text Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeText'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        max_len:
          $ref: '#/components/schemas/CustomFieldMaxLen'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldEditTypeInteger:
      description: Integer Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeInteger'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        min:
          $ref: '#/components/schemas/CustomFieldMin'
        max:
          $ref: '#/components/schemas/CustomFieldMax'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldEditTypeFloat:
      description: Float Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeFloat'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        min:
          $ref: '#/components/schemas/CustomFieldFloatMin'
        max:
          $ref: '#/components/schemas/CustomFieldFloatMax'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldTypeEditSingleSelect:
      description: Single Select Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeSingleSelect'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        created_values:
          $ref: '#/components/schemas/CustomFieldCreatedValues'
        created_values_orders:
          $ref: '#/components/schemas/CustomFieldCreatedValuesOrders'
        deleted_values:
          $ref: '#/components/schemas/CustomFieldDeletedValues'
        renamed_values:
          $ref: '#/components/schemas/CustomFieldRenamedValues'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldTypeEditMultipleSelect:
      description: Multiple Select Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeMultipleSelect'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        created_values:
          $ref: '#/components/schemas/CustomFieldCreatedValues'
        created_values_orders:
          $ref: '#/components/schemas/CustomFieldCreatedValuesOrders'
        deleted_values:
          $ref: '#/components/schemas/CustomFieldDeletedValues'
        renamed_values:
          $ref: '#/components/schemas/CustomFieldRenamedValues'
        max_selected_values:
          $ref: '#/components/schemas/CustomFieldMaxSelectedValues'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldTypeEditMultipleSelectImage:
      description: Multiple Select Image Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeMultipleSelectImage'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        created_values:
          $ref: '#/components/schemas/CustomFieldCreatedValuesMSI'
        deleted_values:
          $ref: '#/components/schemas/CustomFieldDeletedValues'
        edited_values:
          $ref: '#/components/schemas/CustomFieldEditedValuesMSI'
        max_selected_values:
          $ref: '#/components/schemas/CustomFieldMaxSelectedValues'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    CustomFieldTypeEditImagesUploader:
      description: Images uploader Custom Field
      type: object
      required:
        - name
        - type
      properties:
        name:
          $ref: '#/components/schemas/CustomFieldName'
        description:
          $ref: '#/components/schemas/CustomFieldDescription'
        type:
          $ref: '#/components/schemas/CustomFieldTypeImagesUploader'
        slug:
          $ref: '#/components/schemas/CustomFieldSlug'
        created_values:
          $ref: '#/components/schemas/CustomFieldCreatedValuesImagesUploader'
        deleted_values:
          $ref: '#/components/schemas/CustomFieldDeletedValuesImagesUploader'
        edited_values:
          $ref: '#/components/schemas/CustomFieldEditedValuesImagesUploader'
        force:
          $ref: '#/components/schemas/CustomFieldForceUpdate'
        section_id:
          $ref: '#/components/schemas/CustomFieldSectionId'
    RequestStatus:
      description: Request status
      type: string
      enum:
        - success
    CustomFieldId:
      description: Id of the custom field
      type: integer
      example: 42
    CustomFieldName:
      description: The name of the custom field
      type: string
      minLength: 1
      maxLength: 50
      example: Click and collect
    CustomFieldDescription:
      description: Description of the custom field
      type: string
      maxLength: 150
      nullable: true
      example: Whether the business offers click and collect service
    CustomFieldTypeBool:
      description: BOOLEAN
      minLength: 1
      type: string
      example: BOOLEAN
    CustomFieldSlug:
      description: >-
        Unique identifier slug for the custom field. Cannot contain any of the
        following characters: `,;/\|<>`
      type: string
      minLength: 1
      maxLength: 100
      nullable: true
      example: click-and-collect
    CustomFieldForceUpdate:
      description: >
        The deletion of a custom field or the update of its metadata can have
        impacts on custom fields which are already set for businesses.

        - If `force` is set to false, updates/deletions will be performed only
        if they are non-destructive.  
          If some businesses would be impacted by the update/deletion, an exception will be returned.

        - If `force` is set to true, destructive modification will be performed
        and businesses' values will be deleted accordingly.
      type: boolean
      default: false
    CustomFieldSectionId:
      description: Id of the custom field section
      type: integer
      example: 6
    CustomFieldTypeText:
      description: TEXT
      minLength: 1
      type: string
      example: TEXT
    CustomFieldMaxLen:
      description: maximum lenght for TEXT field
      type: integer
      example: 10
    CustomFieldTypeInteger:
      description: INTEGER
      minLength: 1
      type: string
      example: INTEGER
    CustomFieldMin:
      description: minimum value for INTEGER field
      type: integer
      example: 0
    CustomFieldMax:
      description: maximum value for INTEGER field
      type: integer
      example: 100
    CustomFieldTypeFloat:
      description: FLOAT
      minLength: 1
      type: string
      example: FLOAT
    CustomFieldFloatMin:
      description: minimum value for FLOAT field
      type: number
      example: 0
    CustomFieldFloatMax:
      description: maximum value for FLOAT field
      type: number
      example: 10.5
    CustomFieldTypeSingleSelect:
      description: SINGLE_SELECT
      minLength: 1
      type: string
      example: SINGLE_SELECT
    CustomFieldCreatedValues:
      description: list of available values to add
      type: array
      items:
        type: string
      example:
        - Image 3
    CustomFieldCreatedValuesOrders:
      description: >
        The order of the created values. Array of integers where each element
        corresponds  to the display order of the value at the same index in
        created_values. Orders with gaps (e.g., [5, 8, 1]) will be automatically
        normalized to consecutive  values (e.g., [2, 3, 1]) while preserving the
        relative ordering.
      type: array
      items:
        type: integer
        nullable: true
      nullable: true
      example:
        - 3
        - 2
        - 4
        - 1
    CustomFieldDeletedValues:
      description: list of available values to remove
      type: array
      items:
        type: string
      example:
        - Image 1
    CustomFieldRenamedValues:
      description: list of available values to rename
      type: array
      items:
        type: object
        properties:
          old_value:
            type: string
          new_value:
            type: string
      example:
        - old_value: Image 1
          new_value: Draw 1
        - old_value: Image 2
          new_value: Photo 2
    CustomFieldTypeMultipleSelect:
      description: MULTIPLE_SELECT
      minLength: 1
      type: string
      example: MULTIPLE_SELECT
    CustomFieldMaxSelectedValues:
      description: Maximum number of values that can be selected for multiple select fields
      type: integer
      minimum: 1
      nullable: true
      example: 3
    CustomFieldTypeMultipleSelectImage:
      description: MULTIPLE_SELECT_IMAGE
      minLength: 1
      type: string
      example: MULTIPLE_SELECT_IMAGE
    CustomFieldCreatedValuesMSI:
      description: list of available values to add
      type: array
      items:
        type: object
        required:
          - label
          - url
          - value
        properties:
          label:
            type: string
            description: Label for the image option
          url:
            type: string
            description: URL of the image option
          value:
            type: string
            description: Value identifier for the option
          order:
            type: integer
            nullable: true
            description: Display order for the option
      example:
        - label: Image 3
          url: https://image3
          value: Image 3
          order: 1
    CustomFieldEditedValuesMSI:
      description: list of available values to edit
      type: array
      items:
        type: object
        required:
          - label
          - url
          - value
          - old_value
        properties:
          label:
            type: string
            description: New label for the image option
          url:
            type: string
            description: New URL for the image option
          value:
            type: string
            description: New value for the image option
          old_value:
            type: string
            description: Original value being edited
      example:
        - label: Updated Image
          url: https://updated-image.jpg
          value: updated-image
          old_value: old-image
    CustomFieldTypeImagesUploader:
      description: IMAGES_UPLOADER
      minLength: 1
      type: string
      example: IMAGES_UPLOADER
    CustomFieldCreatedValuesImagesUploader:
      description: List of text fields to add
      type: array
      items:
        $ref: '#/components/schemas/CustomFieldValuesImagesUploader'
      example:
        - text_field: text 1
          max_length: 30
        - text_field: text 2
          max_length: 20
    CustomFieldDeletedValuesImagesUploader:
      description: List of text fields to delete
      type: array
      items:
        type: string
      example:
        - my text field
    CustomFieldEditedValuesImagesUploader:
      description: List of edited text fields
      type: array
      items:
        type: object
        properties:
          new_value:
            $ref: '#/components/schemas/CustomFieldValuesImagesUploader'
          old_value:
            $ref: '#/components/schemas/CustomFieldValuesImagesUploader'
      example:
        - new_value:
            text_field: new name
            max_length: 40
          old_value:
            text_field: old name
            max_length: 20
    CustomFieldValuesImagesUploader:
      description: Images uploader custom field value
      type: object
      properties:
        text_field:
          type: string
        max_length:
          type: number
      example:
        - text_field: name 1
          max_length: 20
        - text_field: name 2
          max_length: 30
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
    '404':
      description: Resource does not exist
      content:
        application/json:
          schema:
            description: >-
              Error that occcurs when you are trying to reach a resource that
              does not exist
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: string
                    default: Resource not found
  securitySchemes:
    ApiKeyAuth:
      description: >
        The authentication system on Partoo API is using API Key that should be
        put in the header of the request (the name of the header is `x-APIKey`).
        An api_key is linked to a user. This user's role will give you different
        access level to the API features.
      type: apiKey
      in: header
      name: x-APIKey

````