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

# Update Tenant Segment

> Update a tenant segment



## OpenAPI

````yaml PATCH /api/segments/{id}
openapi: 3.0.0
info:
  title: Reach API
  version: 1.0.0
  description: API documentation for Reach platform
servers:
  - url: https://api.embedreach.com
    description: Production server
security: []
paths:
  /api/segments/{id}:
    patch:
      tags:
        - Segments
      summary: Update Tenant Segment
      description: Update a tenant segment
      parameters:
        - name: reach-tenant-id
          in: header
          required: false
          schema:
            type: string
            description: >-
              If using a platform scoped JWT, you can pass in a header to
              impersonate a specific tenant to impersonate the request as.
        - schema:
            type: string
            description: The ID of the tenant segment to update
          required: true
          description: The ID of the tenant segment to update
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: A friendly name for the segment
                description:
                  type: string
                  description: A friendly description for the segment
                conditions:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - property
                          field:
                            anyOf:
                              - type: string
                                enum:
                                  - userId
                                  - email
                                  - phone
                                  - firstName
                                  - lastName
                                  - hipaaConsent
                              - type: string
                          value:
                            type: array
                            items:
                              anyOf:
                                - type: string
                                - type: number
                                - type: boolean
                                - type: string
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - relative
                                    value:
                                      type: number
                                      description: >-
                                        Number of days to add/subtract from
                                        today
                                    unit:
                                      type: string
                                      enum:
                                        - days
                                    direction:
                                      type: string
                                      enum:
                                        - before
                                        - after
                                  required:
                                    - type
                                    - value
                                    - unit
                                    - direction
                                - type: object
                                  properties:
                                    startDate:
                                      anyOf:
                                        - type: string
                                          nullable: true
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - relative
                                            value:
                                              type: number
                                              description: >-
                                                Number of days to add/subtract from
                                                today
                                            unit:
                                              type: string
                                              enum:
                                                - days
                                            direction:
                                              type: string
                                              enum:
                                                - before
                                                - after
                                          required:
                                            - type
                                            - value
                                            - unit
                                            - direction
                                        - nullable: true
                                    endDate:
                                      anyOf:
                                        - type: string
                                          nullable: true
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - relative
                                            value:
                                              type: number
                                              description: >-
                                                Number of days to add/subtract from
                                                today
                                            unit:
                                              type: string
                                              enum:
                                                - days
                                            direction:
                                              type: string
                                              enum:
                                                - before
                                                - after
                                          required:
                                            - type
                                            - value
                                            - unit
                                            - direction
                                        - nullable: true
                                  required:
                                    - startDate
                                    - endDate
                            description: >-
                              The value to compare the field against (string,
                              number, boolean, date)
                          operator:
                            type: string
                            enum:
                              - equals
                              - not_equals
                              - greater_than
                              - less_than
                              - exists
                              - not_exists
                              - equals_month_day
                              - equals_month_day_year
                              - between_month_day
                              - between_month_day_year
                              - array_contains
                              - contains
                              - not_contains
                              - in
                        required:
                          - field
                          - value
                          - operator
                      - type: object
                        properties:
                          sql_segment_id:
                            type: string
                        required:
                          - sql_segment_id
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - related_resource
                          relatedResource:
                            type: object
                            properties:
                              schemaId:
                                type: string
                              foreignKeyPath:
                                type: string
                            required:
                              - schemaId
                              - foreignKeyPath
                          countOperator:
                            type: string
                            enum:
                              - eq
                              - gt
                              - gte
                              - lt
                              - lte
                          countValue:
                            type: integer
                            minimum: 0
                          conditions:
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - property
                                field:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - userId
                                        - email
                                        - phone
                                        - firstName
                                        - lastName
                                        - hipaaConsent
                                    - type: string
                                value:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                      - type: boolean
                                      - type: string
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - relative
                                          value:
                                            type: number
                                            description: >-
                                              Number of days to add/subtract from
                                              today
                                          unit:
                                            type: string
                                            enum:
                                              - days
                                          direction:
                                            type: string
                                            enum:
                                              - before
                                              - after
                                        required:
                                          - type
                                          - value
                                          - unit
                                          - direction
                                      - type: object
                                        properties:
                                          startDate:
                                            anyOf:
                                              - type: string
                                                nullable: true
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - relative
                                                  value:
                                                    type: number
                                                    description: >-
                                                      Number of days to add/subtract from
                                                      today
                                                  unit:
                                                    type: string
                                                    enum:
                                                      - days
                                                  direction:
                                                    type: string
                                                    enum:
                                                      - before
                                                      - after
                                                required:
                                                  - type
                                                  - value
                                                  - unit
                                                  - direction
                                              - nullable: true
                                          endDate:
                                            anyOf:
                                              - type: string
                                                nullable: true
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - relative
                                                  value:
                                                    type: number
                                                    description: >-
                                                      Number of days to add/subtract from
                                                      today
                                                  unit:
                                                    type: string
                                                    enum:
                                                      - days
                                                  direction:
                                                    type: string
                                                    enum:
                                                      - before
                                                      - after
                                                required:
                                                  - type
                                                  - value
                                                  - unit
                                                  - direction
                                              - nullable: true
                                        required:
                                          - startDate
                                          - endDate
                                  description: >-
                                    The value to compare the field against
                                    (string, number, boolean, date)
                                operator:
                                  type: string
                                  enum:
                                    - equals
                                    - not_equals
                                    - greater_than
                                    - less_than
                                    - exists
                                    - not_exists
                                    - equals_month_day
                                    - equals_month_day_year
                                    - between_month_day
                                    - between_month_day_year
                                    - array_contains
                                    - contains
                                    - not_contains
                                    - in
                              required:
                                - field
                                - value
                                - operator
                        required:
                          - type
                          - relatedResource
                          - countOperator
                          - countValue
                          - conditions
                  description: The conditions to include in the segment (legacy format)
                conditionGroups:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - group
                        default: group
                      logic:
                        type: string
                        enum:
                          - and
                          - or
                      conditions:
                        type: array
                        items:
                          anyOf:
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - property
                                field:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - userId
                                        - email
                                        - phone
                                        - firstName
                                        - lastName
                                        - hipaaConsent
                                    - type: string
                                value:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                      - type: boolean
                                      - type: string
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - relative
                                          value:
                                            type: number
                                            description: >-
                                              Number of days to add/subtract from
                                              today
                                          unit:
                                            type: string
                                            enum:
                                              - days
                                          direction:
                                            type: string
                                            enum:
                                              - before
                                              - after
                                        required:
                                          - type
                                          - value
                                          - unit
                                          - direction
                                      - type: object
                                        properties:
                                          startDate:
                                            anyOf:
                                              - type: string
                                                nullable: true
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - relative
                                                  value:
                                                    type: number
                                                    description: >-
                                                      Number of days to add/subtract from
                                                      today
                                                  unit:
                                                    type: string
                                                    enum:
                                                      - days
                                                  direction:
                                                    type: string
                                                    enum:
                                                      - before
                                                      - after
                                                required:
                                                  - type
                                                  - value
                                                  - unit
                                                  - direction
                                              - nullable: true
                                          endDate:
                                            anyOf:
                                              - type: string
                                                nullable: true
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - relative
                                                  value:
                                                    type: number
                                                    description: >-
                                                      Number of days to add/subtract from
                                                      today
                                                  unit:
                                                    type: string
                                                    enum:
                                                      - days
                                                  direction:
                                                    type: string
                                                    enum:
                                                      - before
                                                      - after
                                                required:
                                                  - type
                                                  - value
                                                  - unit
                                                  - direction
                                              - nullable: true
                                        required:
                                          - startDate
                                          - endDate
                                  description: >-
                                    The value to compare the field against
                                    (string, number, boolean, date)
                                operator:
                                  type: string
                                  enum:
                                    - equals
                                    - not_equals
                                    - greater_than
                                    - less_than
                                    - exists
                                    - not_exists
                                    - equals_month_day
                                    - equals_month_day_year
                                    - between_month_day
                                    - between_month_day_year
                                    - array_contains
                                    - contains
                                    - not_contains
                                    - in
                              required:
                                - field
                                - value
                                - operator
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - related_resource
                                relatedResource:
                                  type: object
                                  properties:
                                    schemaId:
                                      type: string
                                    foreignKeyPath:
                                      type: string
                                  required:
                                    - schemaId
                                    - foreignKeyPath
                                countOperator:
                                  type: string
                                  enum:
                                    - eq
                                    - gt
                                    - gte
                                    - lt
                                    - lte
                                countValue:
                                  type: integer
                                  minimum: 0
                                conditions:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - property
                                      field:
                                        anyOf:
                                          - type: string
                                            enum:
                                              - userId
                                              - email
                                              - phone
                                              - firstName
                                              - lastName
                                              - hipaaConsent
                                          - type: string
                                      value:
                                        type: array
                                        items:
                                          anyOf:
                                            - type: string
                                            - type: number
                                            - type: boolean
                                            - type: string
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - relative
                                                value:
                                                  type: number
                                                  description: >-
                                                    Number of days to add/subtract from
                                                    today
                                                unit:
                                                  type: string
                                                  enum:
                                                    - days
                                                direction:
                                                  type: string
                                                  enum:
                                                    - before
                                                    - after
                                              required:
                                                - type
                                                - value
                                                - unit
                                                - direction
                                            - type: object
                                              properties:
                                                startDate:
                                                  anyOf:
                                                    - type: string
                                                      nullable: true
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - relative
                                                        value:
                                                          type: number
                                                          description: >-
                                                            Number of days to add/subtract from
                                                            today
                                                        unit:
                                                          type: string
                                                          enum:
                                                            - days
                                                        direction:
                                                          type: string
                                                          enum:
                                                            - before
                                                            - after
                                                      required:
                                                        - type
                                                        - value
                                                        - unit
                                                        - direction
                                                    - nullable: true
                                                endDate:
                                                  anyOf:
                                                    - type: string
                                                      nullable: true
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - relative
                                                        value:
                                                          type: number
                                                          description: >-
                                                            Number of days to add/subtract from
                                                            today
                                                        unit:
                                                          type: string
                                                          enum:
                                                            - days
                                                        direction:
                                                          type: string
                                                          enum:
                                                            - before
                                                            - after
                                                      required:
                                                        - type
                                                        - value
                                                        - unit
                                                        - direction
                                                    - nullable: true
                                              required:
                                                - startDate
                                                - endDate
                                        description: >-
                                          The value to compare the field against
                                          (string, number, boolean, date)
                                      operator:
                                        type: string
                                        enum:
                                          - equals
                                          - not_equals
                                          - greater_than
                                          - less_than
                                          - exists
                                          - not_exists
                                          - equals_month_day
                                          - equals_month_day_year
                                          - between_month_day
                                          - between_month_day_year
                                          - array_contains
                                          - contains
                                          - not_contains
                                          - in
                                    required:
                                      - field
                                      - value
                                      - operator
                              required:
                                - type
                                - relatedResource
                                - countOperator
                                - countValue
                                - conditions
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - group
                                  default: group
                                logic:
                                  type: string
                                  enum:
                                    - and
                                    - or
                                conditions:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - property
                                          field:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - userId
                                                  - email
                                                  - phone
                                                  - firstName
                                                  - lastName
                                                  - hipaaConsent
                                              - type: string
                                          value:
                                            type: array
                                            items:
                                              anyOf:
                                                - type: string
                                                - type: number
                                                - type: boolean
                                                - type: string
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - relative
                                                    value:
                                                      type: number
                                                      description: >-
                                                        Number of days to add/subtract from
                                                        today
                                                    unit:
                                                      type: string
                                                      enum:
                                                        - days
                                                    direction:
                                                      type: string
                                                      enum:
                                                        - before
                                                        - after
                                                  required:
                                                    - type
                                                    - value
                                                    - unit
                                                    - direction
                                                - type: object
                                                  properties:
                                                    startDate:
                                                      anyOf:
                                                        - type: string
                                                          nullable: true
                                                        - type: object
                                                          properties:
                                                            type:
                                                              type: string
                                                              enum:
                                                                - relative
                                                            value:
                                                              type: number
                                                              description: >-
                                                                Number of days to add/subtract from
                                                                today
                                                            unit:
                                                              type: string
                                                              enum:
                                                                - days
                                                            direction:
                                                              type: string
                                                              enum:
                                                                - before
                                                                - after
                                                          required:
                                                            - type
                                                            - value
                                                            - unit
                                                            - direction
                                                        - nullable: true
                                                    endDate:
                                                      anyOf:
                                                        - type: string
                                                          nullable: true
                                                        - type: object
                                                          properties:
                                                            type:
                                                              type: string
                                                              enum:
                                                                - relative
                                                            value:
                                                              type: number
                                                              description: >-
                                                                Number of days to add/subtract from
                                                                today
                                                            unit:
                                                              type: string
                                                              enum:
                                                                - days
                                                            direction:
                                                              type: string
                                                              enum:
                                                                - before
                                                                - after
                                                          required:
                                                            - type
                                                            - value
                                                            - unit
                                                            - direction
                                                        - nullable: true
                                                  required:
                                                    - startDate
                                                    - endDate
                                            description: >-
                                              The value to compare the field against
                                              (string, number, boolean, date)
                                          operator:
                                            type: string
                                            enum:
                                              - equals
                                              - not_equals
                                              - greater_than
                                              - less_than
                                              - exists
                                              - not_exists
                                              - equals_month_day
                                              - equals_month_day_year
                                              - between_month_day
                                              - between_month_day_year
                                              - array_contains
                                              - contains
                                              - not_contains
                                              - in
                                        required:
                                          - field
                                          - value
                                          - operator
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - related_resource
                                          relatedResource:
                                            type: object
                                            properties:
                                              schemaId:
                                                type: string
                                              foreignKeyPath:
                                                type: string
                                            required:
                                              - schemaId
                                              - foreignKeyPath
                                          countOperator:
                                            type: string
                                            enum:
                                              - eq
                                              - gt
                                              - gte
                                              - lt
                                              - lte
                                          countValue:
                                            type: integer
                                            minimum: 0
                                          conditions:
                                            type: array
                                            items:
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - property
                                                field:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - userId
                                                        - email
                                                        - phone
                                                        - firstName
                                                        - lastName
                                                        - hipaaConsent
                                                    - type: string
                                                value:
                                                  type: array
                                                  items:
                                                    anyOf:
                                                      - type: string
                                                      - type: number
                                                      - type: boolean
                                                      - type: string
                                                      - type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - relative
                                                          value:
                                                            type: number
                                                            description: >-
                                                              Number of days to add/subtract from
                                                              today
                                                          unit:
                                                            type: string
                                                            enum:
                                                              - days
                                                          direction:
                                                            type: string
                                                            enum:
                                                              - before
                                                              - after
                                                        required:
                                                          - type
                                                          - value
                                                          - unit
                                                          - direction
                                                      - type: object
                                                        properties:
                                                          startDate:
                                                            anyOf:
                                                              - type: string
                                                                nullable: true
                                                              - type: object
                                                                properties:
                                                                  type:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                  value:
                                                                    type: number
                                                                    description: >-
                                                                      Number of days to add/subtract from
                                                                      today
                                                                  unit:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                  direction:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                      - {}
                                                                required:
                                                                  - type
                                                                  - value
                                                                  - unit
                                                                  - direction
                                                              - nullable: true
                                                          endDate:
                                                            anyOf:
                                                              - type: string
                                                                nullable: true
                                                              - type: object
                                                                properties:
                                                                  type:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                  value:
                                                                    type: number
                                                                    description: >-
                                                                      Number of days to add/subtract from
                                                                      today
                                                                  unit:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                  direction:
                                                                    type: string
                                                                    enum:
                                                                      - {}
                                                                      - {}
                                                                required:
                                                                  - type
                                                                  - value
                                                                  - unit
                                                                  - direction
                                                              - nullable: true
                                                        required:
                                                          - startDate
                                                          - endDate
                                                  description: >-
                                                    The value to compare the field against
                                                    (string, number, boolean, date)
                                                operator:
                                                  type: string
                                                  enum:
                                                    - equals
                                                    - not_equals
                                                    - greater_than
                                                    - less_than
                                                    - exists
                                                    - not_exists
                                                    - equals_month_day
                                                    - equals_month_day_year
                                                    - between_month_day
                                                    - between_month_day_year
                                                    - array_contains
                                                    - contains
                                                    - not_contains
                                                    - in
                                              required:
                                                - field
                                                - value
                                                - operator
                                        required:
                                          - type
                                          - relatedResource
                                          - countOperator
                                          - countValue
                                          - conditions
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - group
                                            default: group
                                          logic:
                                            type: string
                                            enum:
                                              - and
                                              - or
                                          conditions:
                                            type: array
                                            items:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - property
                                                    field:
                                                      anyOf:
                                                        - type: string
                                                          enum:
                                                            - userId
                                                            - email
                                                            - phone
                                                            - firstName
                                                            - lastName
                                                            - hipaaConsent
                                                        - type: string
                                                    value:
                                                      type: array
                                                      items:
                                                        anyOf:
                                                          - type: string
                                                          - type: number
                                                          - type: boolean
                                                          - type: string
                                                          - type: object
                                                            properties:
                                                              type:
                                                                type: string
                                                                enum:
                                                                  - relative
                                                              value:
                                                                type: number
                                                                description: >-
                                                                  Number of days to add/subtract from
                                                                  today
                                                              unit:
                                                                type: string
                                                                enum:
                                                                  - days
                                                              direction:
                                                                type: string
                                                                enum:
                                                                  - before
                                                                  - after
                                                            required:
                                                              - type
                                                              - value
                                                              - unit
                                                              - direction
                                                          - type: object
                                                            properties:
                                                              startDate:
                                                                anyOf:
                                                                  - type: string
                                                                    nullable: true
                                                                  - type: object
                                                                    properties:
                                                                      type: {}
                                                                      value: {}
                                                                      unit: {}
                                                                      direction: {}
                                                                    required:
                                                                      - {}
                                                                      - {}
                                                                      - {}
                                                                      - {}
                                                                  - nullable: true
                                                              endDate:
                                                                anyOf:
                                                                  - type: string
                                                                    nullable: true
                                                                  - type: object
                                                                    properties:
                                                                      type: {}
                                                                      value: {}
                                                                      unit: {}
                                                                      direction: {}
                                                                    required:
                                                                      - {}
                                                                      - {}
                                                                      - {}
                                                                      - {}
                                                                  - nullable: true
                                                            required:
                                                              - startDate
                                                              - endDate
                                                      description: >-
                                                        The value to compare the field against
                                                        (string, number, boolean, date)
                                                    operator:
                                                      type: string
                                                      enum:
                                                        - equals
                                                        - not_equals
                                                        - greater_than
                                                        - less_than
                                                        - exists
                                                        - not_exists
                                                        - equals_month_day
                                                        - equals_month_day_year
                                                        - between_month_day
                                                        - between_month_day_year
                                                        - array_contains
                                                        - contains
                                                        - not_contains
                                                        - in
                                                  required:
                                                    - field
                                                    - value
                                                    - operator
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - related_resource
                                                    relatedResource:
                                                      type: object
                                                      properties:
                                                        schemaId:
                                                          type: string
                                                        foreignKeyPath:
                                                          type: string
                                                      required:
                                                        - schemaId
                                                        - foreignKeyPath
                                                    countOperator:
                                                      type: string
                                                      enum:
                                                        - eq
                                                        - gt
                                                        - gte
                                                        - lt
                                                        - lte
                                                    countValue:
                                                      type: integer
                                                      minimum: 0
                                                    conditions:
                                                      type: array
                                                      items:
                                                        type: object
                                                        properties:
                                                          type:
                                                            type: string
                                                            enum:
                                                              - property
                                                          field:
                                                            anyOf:
                                                              - type: string
                                                                enum:
                                                                  - userId
                                                                  - email
                                                                  - phone
                                                                  - firstName
                                                                  - lastName
                                                                  - hipaaConsent
                                                              - type: string
                                                          value:
                                                            type: array
                                                            items:
                                                              anyOf:
                                                                - type: string
                                                                - type: number
                                                                - type: boolean
                                                                - type: string
                                                                - type: object
                                                                  properties:
                                                                    type: {}
                                                                    value: {}
                                                                    unit: {}
                                                                    direction: {}
                                                                  required:
                                                                    - type
                                                                    - value
                                                                    - unit
                                                                    - direction
                                                                - type: object
                                                                  properties:
                                                                    startDate: {}
                                                                    endDate: {}
                                                                  required:
                                                                    - startDate
                                                                    - endDate
                                                            description: >-
                                                              The value to compare the field against
                                                              (string, number, boolean, date)
                                                          operator:
                                                            type: string
                                                            enum:
                                                              - equals
                                                              - not_equals
                                                              - greater_than
                                                              - less_than
                                                              - exists
                                                              - not_exists
                                                              - equals_month_day
                                                              - equals_month_day_year
                                                              - between_month_day
                                                              - between_month_day_year
                                                              - array_contains
                                                              - contains
                                                              - not_contains
                                                              - in
                                                        required:
                                                          - field
                                                          - value
                                                          - operator
                                                  required:
                                                    - type
                                                    - relatedResource
                                                    - countOperator
                                                    - countValue
                                                    - conditions
                                        required:
                                          - logic
                                          - conditions
                              required:
                                - logic
                                - conditions
                    required:
                      - logic
                      - conditions
                  description: >-
                    Condition groups with AND/OR logic and related resource
                    support (new format)
      responses:
        '200':
          description: Status 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The id of the segment
                      name:
                        type: string
                        description: A friendly name for the segment
                      description:
                        type: string
                        description: A friendly description for the segment
                      createdAt:
                        type: string
                        nullable: true
                        description: The date and time the segment was created
                      type:
                        type: string
                        enum:
                          - all_users
                          - managed
                          - custom
                          - one_off
                          - sql
                        description: The type of segment
                    required:
                      - id
                      - name
                      - createdAt
                      - type
                required:
                  - success
        '400':
          description: Bad Request - Validation or request error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
                  message:
                    type: string
                    description: Error message describing what went wrong
                  errors:
                    type: array
                    items:
                      type: string
                    description: Optional array of specific validation errors
                required:
                  - message

````