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

# Put v1segments



## OpenAPI

````yaml https://api.comm.com/docs/api.json put /v1/segments/{segment}
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/segments/{segment}:
    put:
      tags:
        - Segments
      operationId: segments.update
      parameters:
        - name: segment
          in: path
          required: true
          description: The segment ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                query:
                  type: object
                  example:
                    condition: AND
                    rules:
                      - field: clicked_count
                        operator: greater
                        value: 0
                      - field: country_id
                        operator: equal
                        value: 225
                      - condition: OR
                        rules:
                          - field: leads_count
                            operator: equal
                            value: 1
                          - field: sales_count
                            operator: equal
                            value: 1
                      - field: date_created
                        operator: equal
                        value: '2023-07-05'
                  additionalProperties:
                    type: string
              required:
                - name
                - query
      responses:
        '200':
          description: '`SegmentResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SegmentResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    SegmentResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        name:
          type: string
        query:
          type: string
        is_active:
          type: string
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - type
        - name
        - query
        - is_active
        - created_at
        - updated_at
      title: SegmentResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      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:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````