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

# Update a treatment group



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json put /v1/treatment-groups/{id}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/treatment-groups/{id}:
    put:
      tags:
        - TreatmentGroup
      summary: Update a treatment group
      operationId: treatmentGroup.update
      parameters:
        - name: id
          in: path
          required: true
          description: The treatment group identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreatmentGroupUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/TreatmentGroupResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Treatment group not found
                    required:
                      - message
                required:
                  - success
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    TreatmentGroupUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: Group name.
          maxLength: 255
        description:
          type:
            - string
            - 'null'
          description: Group description.
        total_price:
          type:
            - number
            - 'null'
          description: Total price for the group.
          minimum: 0
        is_price_manual:
          type:
            - boolean
            - 'null'
          description: Whether the price is manually set.
        is_active:
          type:
            - boolean
            - 'null'
          description: Active status.
        treatment_ids:
          type:
            - array
            - 'null'
          description: Treatment IDs to assign to this group.
          items:
            type: integer
            description: A treatment ID.
      title: TreatmentGroupUpdateRequest
    TreatmentGroupResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        total_price:
          type:
            - string
            - 'null'
        effective_price:
          type: string
        is_price_manual:
          type: boolean
        is_active:
          type: boolean
        treatments:
          type: array
          items:
            $ref: '#/components/schemas/TreatmentResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - name
        - description
        - total_price
        - effective_price
        - is_price_manual
        - is_active
        - created_at
        - updated_at
        - deleted_at
      title: TreatmentGroupResource
    TreatmentResource:
      type: object
      properties:
        id:
          type: integer
        group_id:
          type:
            - integer
            - 'null'
        name:
          type: string
        keywords:
          type: array
          items: {}
        price:
          type: string
        tax_rate:
          type: integer
        description:
          type:
            - string
            - 'null'
        session:
          type: integer
        is_active:
          type: string
        extra_info:
          type: object
        group:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
            is_active:
              type: boolean
          required:
            - id
            - name
            - is_active
        users:
          type: array
          items:
            $ref: '#/components/schemas/RelatedUserResource'
        sessions:
          type: array
          items:
            $ref: '#/components/schemas/TreatmentSessionResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - group_id
        - name
        - keywords
        - price
        - tax_rate
        - description
        - session
        - is_active
        - extra_info
        - created_at
        - updated_at
        - deleted_at
      title: TreatmentResource
    RelatedUserResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      title: RelatedUserResource
    TreatmentSessionResource:
      type: object
      properties:
        id:
          type: integer
        session_order:
          type: integer
        session_type:
          $ref: '#/components/schemas/AppointmentType'
        next_gap_days:
          type:
            - integer
            - 'null'
        offset_days:
          type: integer
        products:
          type: array
          items:
            $ref: '#/components/schemas/TreatmentSessionProductResource'
      required:
        - id
        - session_order
        - session_type
        - next_gap_days
        - offset_days
      title: TreatmentSessionResource
    AppointmentType:
      type: string
      enum:
        - control
        - operation
        - treatment
        - consultation
        - follow_up
        - emergency
        - surgery
      title: AppointmentType
    TreatmentSessionProductResource:
      type: object
      properties:
        id:
          type: integer
        product_id:
          type: integer
        min_quantity:
          type:
            - number
            - 'null'
        product:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            full_name:
              type: string
            brand:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: integer
                name:
                  type: string
              required:
                - id
                - name
            unit_code:
              type:
                - object
                - 'null'
              properties:
                id:
                  type: string
                name:
                  type: string
                code:
                  type: string
              required:
                - id
                - name
                - code
          required:
            - id
            - name
            - full_name
            - brand
            - unit_code
      required:
        - id
        - product_id
        - min_quantity
      title: TreatmentSessionProductResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````