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

# Update a category

> Updates category metadata and, when fields is supplied, the category custom fields. By default fields is replacement-style: omitted customer-managed fields are removed. Set addOnly=true to preserve existing fields and append only missing fields or missing plain-tag options.



## OpenAPI

````yaml /openapi/customer-api.json put /project/{projectId}/data-model/{id}
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Files
  - name: Import
  - name: Notifications
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
paths:
  /project/{projectId}/data-model/{id}:
    put:
      tags:
        - Data Model
      summary: Update a category
      description: >-
        Updates category metadata and, when fields is supplied, the category
        custom fields. By default fields is replacement-style: omitted
        customer-managed fields are removed. Set addOnly=true to preserve
        existing fields and append only missing fields or missing plain-tag
        options.
      operationId: CustomerCategoriesController_update
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              addOnly:
                summary: Additive field/tag-option ensure
                value:
                  addOnly: true
                  fields:
                    - key: priority
                      name: Priority
                      tags:
                        - name: Medium
                      type: tag
              replacement:
                summary: Replacement-style field update
                value:
                  fields:
                    - key: priority
                      name: Priority
                      tags:
                        - name: Low
                        - name: High
                      type: tag
            schema:
              $ref: '#/components/schemas/CustomerUpdateCategoryDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerCategoryResponseDto'
          description: ''
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    CustomerUpdateCategoryDto:
      properties:
        addOnly:
          default: false
          description: >-
            When true, fields becomes an additive "ensure this schema exists"
            list: omitted fields are preserved, existing fields keep their
            current name/type/settings, and only missing fields or missing
            plain-tag options are added. If an existing field key is sent with a
            different type, the request is rejected instead of converting the
            field. Without addOnly, fields keeps its normal replacement
            semantics.
          example: true
          type: boolean
        categoryType:
          enum:
            - folder
            - item
          type: string
        fields:
          description: >-
            Custom fields for this category. By default, sending this list
            replaces the customer-managed field list, so omitted fields are
            removed. Set addOnly=true to preserve existing fields and only add
            missing fields/tag options.
          items:
            $ref: '#/components/schemas/CustomerFieldInputDto'
          type: array
        humanIdPrefix:
          maxLength: 32
          nullable: true
          type: string
        name:
          type: string
      type: object
    CustomerCategoryResponseDto:
      properties:
        builtin:
          type: boolean
        categoryType:
          enum:
            - folder
            - item
          type: string
        fields:
          items:
            $ref: '#/components/schemas/CustomerFieldResponseDto'
          type: array
        humanIdPrefix:
          type: string
        humanIdPrefixLocked:
          type: boolean
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
        - categoryType
        - builtin
        - fields
        - humanIdPrefix
        - humanIdPrefixLocked
      type: object
    CustomerFieldInputDto:
      properties:
        key:
          type: string
        multi:
          description: >-
            Whether a tag field accepts multiple simultaneous values. Only
            meaningful for tag fields.
          type: boolean
        name:
          type: string
        tags:
          description: >-
            Plain tag options for this field. On normal category update this is
            the full replacement list; with addOnly it is treated as options to
            ensure exist.
          items:
            $ref: '#/components/schemas/CustomerTagInputDto'
          type: array
        type:
          enum:
            - text
            - richText
            - number
            - tag
            - date
            - toggle
            - user
            - verificationResult
            - diagram
            - jira
            - linear
            - googleDoc
            - googleSheet
            - aodocsDoc
            - cadFile
            - file
            - stage
          type: string
      required:
        - key
        - name
        - type
      type: object
    CustomerFieldResponseDto:
      properties:
        key:
          type: string
        multi:
          type: boolean
        name:
          type: string
        tags:
          items:
            $ref: '#/components/schemas/CustomerTagResponseDto'
          type: array
        type:
          type: string
      required:
        - key
        - name
        - type
      type: object
    CustomerTagInputDto:
      properties:
        name:
          description: >-
            Display name of the tag option. Customer API writes refer to plain
            tag options by name; Flow stores and preserves the internal option
            id.
          example: Medium
          type: string
      required:
        - name
      type: object
    CustomerTagResponseDto:
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - name
      type: object
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````