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

# Update a structured field

> Update a structured field’s display name, description, `show_when` rule, or group (`group_id`, `null` to ungroup).



## OpenAPI

````yaml patch /structured-fields/{fieldId}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /structured-fields/{fieldId}:
    patch:
      summary: Update a structured field
      description: >-
        Update a structured field’s display name, description, `show_when` rule,
        or group (`group_id`, `null` to ungroup). The key and type are
        immutable, and field definitions never accept a default value. A field
        can only depend on, or be depended on by, fields in its own group, so to
        move linked fields, remove the rule, move each field, then add the rule
        back.
      operationId: updateStructuredField
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: fieldId
          required: true
          description: Structured Field ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStructuredFieldDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredFieldTreeDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    UpdateStructuredFieldDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/UpdateStructuredFieldDtoInput'
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          minLength: 1
          maxLength: 1000
        show_when:
          anyOf:
            - $ref: '#/components/schemas/StructuredFieldShowWhenDto'
            - type: 'null'
        group_id:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
      additionalProperties: false
    StructuredFieldTreeDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/StructuredFieldTreeDto'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        org_id:
          type: string
        key:
          type: string
        name:
          type: string
        description:
          type: string
        type:
          $ref: '#/components/schemas/StructuredFieldTypeDto'
        value:
          type:
            - string
            - 'null'
        position:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        show_when_field_id:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
        show_when_values:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        group_id:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
        variants:
          type: array
          items:
            $ref: '#/components/schemas/StructuredFieldVariantTreeDto'
        system_options:
          type: array
          items:
            $ref: '#/components/schemas/StructuredFieldSystemOptionDto'
      required:
        - id
        - org_id
        - key
        - name
        - description
        - type
        - value
        - position
        - archived_at
        - created_at
        - updated_at
        - show_when_field_id
        - show_when_values
        - group_id
        - variants
        - system_options
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    StructuredFieldShowWhenDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/StructuredFieldShowWhenDtoInput'
      type: object
      properties:
        field_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        values:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
      required:
        - field_id
        - values
    StructuredFieldTypeDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/StructuredFieldTypeDto'
      type: string
      enum:
        - enum
        - text
        - number
        - boolean
        - date
        - user
        - team
        - tag
    StructuredFieldVariantTreeDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/StructuredFieldVariantTreeDto'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        org_id:
          type: string
        field_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        parent_id:
          anyOf:
            - type: string
              format: uuid
              pattern: >-
                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            - type: 'null'
        value:
          type: string
        variant_display_name:
          type: string
        variant_description:
          type: string
        position:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        children:
          type: array
          items:
            $ref: '#/components/schemas/StructuredFieldVariantTreeDto'
      required:
        - id
        - org_id
        - field_id
        - parent_id
        - value
        - variant_display_name
        - variant_description
        - position
        - archived_at
        - created_at
        - updated_at
        - children
      additionalProperties: false
    StructuredFieldSystemOptionDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/StructuredFieldSystemOptionDto'
      type: object
      properties:
        value:
          type: string
        label:
          type: string
        description:
          type:
            - string
            - 'null'
      required:
        - value
        - label
        - description
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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