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

# Get a segment

> Get a single segment.



## OpenAPI

````yaml get /api/admin/segments/{segmentId}
openapi: 3.1.0
info:
  title: Tranthor API
  description: Tranthor API Swagger Documentation
  version: 0.0.1
servers: []
security: []
paths:
  /api/admin/segments/{segmentId}:
    get:
      tags:
        - Segments
      description: Get a single segment.
      parameters:
        - schema:
            type: string
          in: query
          name: workspaceId
          required: true
        - schema:
            type: string
          in: path
          name: segmentId
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  workspaceId:
                    type: string
                  name:
                    type: string
                  definition:
                    type: object
                    properties:
                      entryNode:
                        anyOf:
                          - anyOf:
                              - allOf:
                                  - type: object
                                    properties:
                                      type:
                                        type: string
                                        enum:
                                          - CustomerInsight
                                      id:
                                        type: string
                                    required:
                                      - type
                                      - id
                                  - anyOf:
                                      - type: object
                                        properties:
                                          field:
                                            type: string
                                            enum:
                                              - rfm.segment
                                          modelVersion:
                                            type: string
                                            enum:
                                              - rfm_engagement_v1
                                          operator:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - Equals
                                                  value:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - Champions
                                                      - type: string
                                                        enum:
                                                          - Loyal Customers
                                                      - type: string
                                                        enum:
                                                          - Potential Loyalists
                                                      - type: string
                                                        enum:
                                                          - At-Risk
                                                      - type: string
                                                        enum:
                                                          - Lost
                                                      - type: string
                                                        enum:
                                                          - New
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - NotEquals
                                                  value:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - Champions
                                                      - type: string
                                                        enum:
                                                          - Loyal Customers
                                                      - type: string
                                                        enum:
                                                          - Potential Loyalists
                                                      - type: string
                                                        enum:
                                                          - At-Risk
                                                      - type: string
                                                        enum:
                                                          - Lost
                                                      - type: string
                                                        enum:
                                                          - New
                                                required:
                                                  - type
                                                  - value
                                              - additionalProperties: false
                                                type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - IsUnavailable
                                                required:
                                                  - type
                                        required:
                                          - field
                                          - modelVersion
                                          - operator
                                      - type: object
                                        properties:
                                          field:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - rfm.recencyScore
                                              - type: string
                                                enum:
                                                  - rfm.frequencyScore
                                              - type: string
                                                enum:
                                                  - rfm.monetaryScore
                                          modelVersion:
                                            type: string
                                            enum:
                                              - rfm_engagement_v1
                                          operator:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - Equals
                                                  value:
                                                    minimum: 1
                                                    maximum: 5
                                                    type: integer
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - GreaterThanOrEqual
                                                  value:
                                                    minimum: 1
                                                    maximum: 5
                                                    type: integer
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - LessThan
                                                  value:
                                                    minimum: 1
                                                    maximum: 5
                                                    type: integer
                                                required:
                                                  - type
                                                  - value
                                              - additionalProperties: false
                                                type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - IsUnavailable
                                                required:
                                                  - type
                                        required:
                                          - field
                                          - modelVersion
                                          - operator
                                      - type: object
                                        properties:
                                          field:
                                            type: string
                                            enum:
                                              - lifecycle.riskBucket
                                          modelVersion:
                                            type: string
                                            enum:
                                              - lifecycle_cadence_v1
                                          operator:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - Equals
                                                  value:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - healthy
                                                      - type: string
                                                        enum:
                                                          - on-cadence
                                                      - type: string
                                                        enum:
                                                          - approaching-lapse
                                                      - type: string
                                                        enum:
                                                          - lapsed
                                                      - type: string
                                                        enum:
                                                          - deep-lapse
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - NotEquals
                                                  value:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - healthy
                                                      - type: string
                                                        enum:
                                                          - on-cadence
                                                      - type: string
                                                        enum:
                                                          - approaching-lapse
                                                      - type: string
                                                        enum:
                                                          - lapsed
                                                      - type: string
                                                        enum:
                                                          - deep-lapse
                                                required:
                                                  - type
                                                  - value
                                              - additionalProperties: false
                                                type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - IsUnavailable
                                                required:
                                                  - type
                                        required:
                                          - field
                                          - modelVersion
                                          - operator
                                      - type: object
                                        properties:
                                          field:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - lifecycle.daysSinceLastOrder
                                              - type: string
                                                enum:
                                                  - lifecycle.expectedReorderDays
                                          modelVersion:
                                            type: string
                                            enum:
                                              - lifecycle_cadence_v1
                                          operator:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - Equals
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - GreaterThanOrEqual
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - LessThan
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - additionalProperties: false
                                                type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - IsUnavailable
                                                required:
                                                  - type
                                        required:
                                          - field
                                          - modelVersion
                                          - operator
                                      - type: object
                                        properties:
                                          field:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - purchase.orderCount
                                              - type: string
                                                enum:
                                                  - purchase.daysSinceLastOrder
                                          modelVersion:
                                            type: string
                                            enum:
                                              - completed_orders_v1
                                          operator:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - Equals
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - GreaterThanOrEqual
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - LessThan
                                                  value:
                                                    minimum: 0
                                                    type: number
                                                required:
                                                  - type
                                                  - value
                                              - additionalProperties: false
                                                type: object
                                                properties:
                                                  type:
                                                    type: string
                                                    enum:
                                                      - IsUnavailable
                                                required:
                                                  - type
                                        required:
                                          - field
                                          - modelVersion
                                          - operator
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Trait
                                  id:
                                    type: string
                                  path:
                                    type: string
                                  operator:
                                    anyOf:
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - Within
                                          windowSeconds:
                                            type: number
                                        required:
                                          - type
                                          - windowSeconds
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - Equals
                                          value:
                                            anyOf:
                                              - type: string
                                              - type: number
                                        required:
                                          - type
                                          - value
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - NotEquals
                                          value:
                                            anyOf:
                                              - type: string
                                              - type: number
                                        required:
                                          - type
                                          - value
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - HasBeen
                                          comparator:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - GTE
                                              - type: string
                                                enum:
                                                  - LT
                                          value:
                                            anyOf:
                                              - type: string
                                              - type: number
                                          windowSeconds:
                                            type: number
                                        required:
                                          - type
                                          - comparator
                                          - value
                                          - windowSeconds
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - Exists
                                        required:
                                          - type
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - GreaterThanOrEqual
                                          value:
                                            type: number
                                        required:
                                          - type
                                          - value
                                      - type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - LessThan
                                          value:
                                            type: number
                                        required:
                                          - type
                                          - value
                                      - type: object
                                        properties:
                                          type:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - Contains
                                              - type: string
                                                enum:
                                                  - NotContains
                                              - type: string
                                                enum:
                                                  - StartsWith
                                              - type: string
                                                enum:
                                                  - EndsWith
                                          value:
                                            type: string
                                        required:
                                          - type
                                          - value
                                required:
                                  - type
                                  - id
                                  - path
                                  - operator
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - And
                                  id:
                                    type: string
                                  children:
                                    type: array
                                    items:
                                      type: string
                                required:
                                  - type
                                  - id
                                  - children
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Or
                                  id:
                                    type: string
                                  children:
                                    type: array
                                    items:
                                      type: string
                                required:
                                  - type
                                  - id
                                  - children
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Not
                                  id:
                                    type: string
                                  child:
                                    type: string
                                required:
                                  - type
                                  - id
                                  - child
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Performed
                                  id:
                                    type: string
                                  event:
                                    type: string
                                  times:
                                    type: number
                                  timesOperator:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - '='
                                      - type: string
                                        enum:
                                          - '>='
                                      - type: string
                                        enum:
                                          - <
                                  withinSeconds:
                                    type: number
                                  properties:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        path:
                                          type: string
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Within
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - NotEquals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - HasBeen
                                                comparator:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - GTE
                                                    - type: string
                                                      enum:
                                                        - LT
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - comparator
                                                - value
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Exists
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - Contains
                                                    - type: string
                                                      enum:
                                                        - NotContains
                                                    - type: string
                                                      enum:
                                                        - StartsWith
                                                    - type: string
                                                      enum:
                                                        - EndsWith
                                                value:
                                                  type: string
                                              required:
                                                - type
                                                - value
                                      required:
                                        - path
                                        - operator
                                required:
                                  - type
                                  - id
                                  - event
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - LastPerformed
                                  id:
                                    type: string
                                  event:
                                    type: string
                                  whereProperties:
                                    description: >-
                                      Used to select which events are eligible
                                      to be considered.
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        path:
                                          type: string
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Within
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - NotEquals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - HasBeen
                                                comparator:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - GTE
                                                    - type: string
                                                      enum:
                                                        - LT
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - comparator
                                                - value
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Exists
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - Contains
                                                    - type: string
                                                      enum:
                                                        - NotContains
                                                    - type: string
                                                      enum:
                                                        - StartsWith
                                                    - type: string
                                                      enum:
                                                        - EndsWith
                                                value:
                                                  type: string
                                              required:
                                                - type
                                                - value
                                      required:
                                        - path
                                        - operator
                                  hasProperties:
                                    description: >-
                                      Used to evaluate whether the user is in
                                      the segment based on the properties of the
                                      selected event.
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        path:
                                          type: string
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Within
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - NotEquals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - HasBeen
                                                comparator:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - GTE
                                                    - type: string
                                                      enum:
                                                        - LT
                                                value:
                                                  anyOf:
                                                    - type: string
                                                    - type: number
                                                windowSeconds:
                                                  type: number
                                              required:
                                                - type
                                                - comparator
                                                - value
                                                - windowSeconds
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Exists
                                              required:
                                                - type
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - Contains
                                                    - type: string
                                                      enum:
                                                        - NotContains
                                                    - type: string
                                                      enum:
                                                        - StartsWith
                                                    - type: string
                                                      enum:
                                                        - EndsWith
                                                value:
                                                  type: string
                                              required:
                                                - type
                                                - value
                                      required:
                                        - path
                                        - operator
                                required:
                                  - type
                                  - id
                                  - event
                                  - hasProperties
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Email
                                  id:
                                    type: string
                                  event:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - TRInternalMessageSent
                                      - type: string
                                        enum:
                                          - TREmailAccepted
                                      - type: string
                                        enum:
                                          - TREmailDropped
                                      - type: string
                                        enum:
                                          - TREmailDelivered
                                      - type: string
                                        enum:
                                          - TREmailOpened
                                      - type: string
                                        enum:
                                          - TREmailClicked
                                      - type: string
                                        enum:
                                          - TREmailBounced
                                      - type: string
                                        enum:
                                          - TREmailMarkedSpam
                                  times:
                                    type: number
                                  templateId:
                                    type: string
                                required:
                                  - type
                                  - id
                                  - event
                                  - templateId
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Broadcast
                                  id:
                                    type: string
                                required:
                                  - type
                                  - id
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - SubscriptionGroup
                                  id:
                                    type: string
                                  subscriptionGroupId:
                                    type: string
                                  subscriptionGroupType:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - OptIn
                                      - type: string
                                        enum:
                                          - OptOut
                                required:
                                  - type
                                  - id
                                  - subscriptionGroupId
                                  - subscriptionGroupType
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - RandomBucket
                                  id:
                                    type: string
                                  percent:
                                    description: >-
                                      The percentage of users to be randomly
                                      assigned to be in the segment. Expressed
                                      as a number between 0 and 1.
                                    type: number
                                required:
                                  - type
                                  - id
                                  - percent
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Everyone
                                  id:
                                    type: string
                                required:
                                  - type
                                  - id
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - Manual
                              version:
                                type: number
                              id:
                                type: string
                            required:
                              - type
                              - version
                              - id
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - Everyone
                              id:
                                type: string
                            required:
                              - type
                              - id
                          - type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - KeyedPerformed
                              id:
                                type: string
                              event:
                                type: string
                              key:
                                type: string
                              times:
                                type: number
                              timesOperator:
                                anyOf:
                                  - type: string
                                    enum:
                                      - '='
                                  - type: string
                                    enum:
                                      - '>='
                                  - type: string
                                    enum:
                                      - <
                              properties:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    path:
                                      type: string
                                    operator:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - Equals
                                            value:
                                              anyOf:
                                                - type: string
                                                - type: number
                                          required:
                                            - type
                                            - value
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - Exists
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - GreaterThanOrEqual
                                            value:
                                              type: number
                                          required:
                                            - type
                                            - value
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - LessThan
                                            value:
                                              type: number
                                          required:
                                            - type
                                            - value
                                  required:
                                    - path
                                    - operator
                            required:
                              - type
                              - id
                              - event
                              - key
                      nodes:
                        type: array
                        items:
                          anyOf:
                            - allOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - CustomerInsight
                                    id:
                                      type: string
                                  required:
                                    - type
                                    - id
                                - anyOf:
                                    - type: object
                                      properties:
                                        field:
                                          type: string
                                          enum:
                                            - rfm.segment
                                        modelVersion:
                                          type: string
                                          enum:
                                            - rfm_engagement_v1
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - Champions
                                                    - type: string
                                                      enum:
                                                        - Loyal Customers
                                                    - type: string
                                                      enum:
                                                        - Potential Loyalists
                                                    - type: string
                                                      enum:
                                                        - At-Risk
                                                    - type: string
                                                      enum:
                                                        - Lost
                                                    - type: string
                                                      enum:
                                                        - New
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - NotEquals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - Champions
                                                    - type: string
                                                      enum:
                                                        - Loyal Customers
                                                    - type: string
                                                      enum:
                                                        - Potential Loyalists
                                                    - type: string
                                                      enum:
                                                        - At-Risk
                                                    - type: string
                                                      enum:
                                                        - Lost
                                                    - type: string
                                                      enum:
                                                        - New
                                              required:
                                                - type
                                                - value
                                            - additionalProperties: false
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - IsUnavailable
                                              required:
                                                - type
                                      required:
                                        - field
                                        - modelVersion
                                        - operator
                                    - type: object
                                      properties:
                                        field:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - rfm.recencyScore
                                            - type: string
                                              enum:
                                                - rfm.frequencyScore
                                            - type: string
                                              enum:
                                                - rfm.monetaryScore
                                        modelVersion:
                                          type: string
                                          enum:
                                            - rfm_engagement_v1
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  minimum: 1
                                                  maximum: 5
                                                  type: integer
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  minimum: 1
                                                  maximum: 5
                                                  type: integer
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  minimum: 1
                                                  maximum: 5
                                                  type: integer
                                              required:
                                                - type
                                                - value
                                            - additionalProperties: false
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - IsUnavailable
                                              required:
                                                - type
                                      required:
                                        - field
                                        - modelVersion
                                        - operator
                                    - type: object
                                      properties:
                                        field:
                                          type: string
                                          enum:
                                            - lifecycle.riskBucket
                                        modelVersion:
                                          type: string
                                          enum:
                                            - lifecycle_cadence_v1
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - healthy
                                                    - type: string
                                                      enum:
                                                        - on-cadence
                                                    - type: string
                                                      enum:
                                                        - approaching-lapse
                                                    - type: string
                                                      enum:
                                                        - lapsed
                                                    - type: string
                                                      enum:
                                                        - deep-lapse
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - NotEquals
                                                value:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - healthy
                                                    - type: string
                                                      enum:
                                                        - on-cadence
                                                    - type: string
                                                      enum:
                                                        - approaching-lapse
                                                    - type: string
                                                      enum:
                                                        - lapsed
                                                    - type: string
                                                      enum:
                                                        - deep-lapse
                                              required:
                                                - type
                                                - value
                                            - additionalProperties: false
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - IsUnavailable
                                              required:
                                                - type
                                      required:
                                        - field
                                        - modelVersion
                                        - operator
                                    - type: object
                                      properties:
                                        field:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - lifecycle.daysSinceLastOrder
                                            - type: string
                                              enum:
                                                - lifecycle.expectedReorderDays
                                        modelVersion:
                                          type: string
                                          enum:
                                            - lifecycle_cadence_v1
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - additionalProperties: false
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - IsUnavailable
                                              required:
                                                - type
                                      required:
                                        - field
                                        - modelVersion
                                        - operator
                                    - type: object
                                      properties:
                                        field:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - purchase.orderCount
                                            - type: string
                                              enum:
                                                - purchase.daysSinceLastOrder
                                        modelVersion:
                                          type: string
                                          enum:
                                            - completed_orders_v1
                                        operator:
                                          anyOf:
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - Equals
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - GreaterThanOrEqual
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - LessThan
                                                value:
                                                  minimum: 0
                                                  type: number
                                              required:
                                                - type
                                                - value
                                            - additionalProperties: false
                                              type: object
                                              properties:
                                                type:
                                                  type: string
                                                  enum:
                                                    - IsUnavailable
                                              required:
                                                - type
                                      required:
                                        - field
                                        - modelVersion
                                        - operator
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Trait
                                id:
                                  type: string
                                path:
                                  type: string
                                operator:
                                  anyOf:
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - Within
                                        windowSeconds:
                                          type: number
                                      required:
                                        - type
                                        - windowSeconds
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - Equals
                                        value:
                                          anyOf:
                                            - type: string
                                            - type: number
                                      required:
                                        - type
                                        - value
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - NotEquals
                                        value:
                                          anyOf:
                                            - type: string
                                            - type: number
                                      required:
                                        - type
                                        - value
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - HasBeen
                                        comparator:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - GTE
                                            - type: string
                                              enum:
                                                - LT
                                        value:
                                          anyOf:
                                            - type: string
                                            - type: number
                                        windowSeconds:
                                          type: number
                                      required:
                                        - type
                                        - comparator
                                        - value
                                        - windowSeconds
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - Exists
                                      required:
                                        - type
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - GreaterThanOrEqual
                                        value:
                                          type: number
                                      required:
                                        - type
                                        - value
                                    - type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - LessThan
                                        value:
                                          type: number
                                      required:
                                        - type
                                        - value
                                    - type: object
                                      properties:
                                        type:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - Contains
                                            - type: string
                                              enum:
                                                - NotContains
                                            - type: string
                                              enum:
                                                - StartsWith
                                            - type: string
                                              enum:
                                                - EndsWith
                                        value:
                                          type: string
                                      required:
                                        - type
                                        - value
                              required:
                                - type
                                - id
                                - path
                                - operator
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - And
                                id:
                                  type: string
                                children:
                                  type: array
                                  items:
                                    type: string
                              required:
                                - type
                                - id
                                - children
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Or
                                id:
                                  type: string
                                children:
                                  type: array
                                  items:
                                    type: string
                              required:
                                - type
                                - id
                                - children
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Not
                                id:
                                  type: string
                                child:
                                  type: string
                              required:
                                - type
                                - id
                                - child
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Performed
                                id:
                                  type: string
                                event:
                                  type: string
                                times:
                                  type: number
                                timesOperator:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - '='
                                    - type: string
                                      enum:
                                        - '>='
                                    - type: string
                                      enum:
                                        - <
                                withinSeconds:
                                  type: number
                                properties:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      path:
                                        type: string
                                      operator:
                                        anyOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Within
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Equals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - NotEquals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - HasBeen
                                              comparator:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - GTE
                                                  - type: string
                                                    enum:
                                                      - LT
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - comparator
                                              - value
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Exists
                                            required:
                                              - type
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - GreaterThanOrEqual
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - LessThan
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - Contains
                                                  - type: string
                                                    enum:
                                                      - NotContains
                                                  - type: string
                                                    enum:
                                                      - StartsWith
                                                  - type: string
                                                    enum:
                                                      - EndsWith
                                              value:
                                                type: string
                                            required:
                                              - type
                                              - value
                                    required:
                                      - path
                                      - operator
                              required:
                                - type
                                - id
                                - event
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - LastPerformed
                                id:
                                  type: string
                                event:
                                  type: string
                                whereProperties:
                                  description: >-
                                    Used to select which events are eligible to
                                    be considered.
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      path:
                                        type: string
                                      operator:
                                        anyOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Within
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Equals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - NotEquals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - HasBeen
                                              comparator:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - GTE
                                                  - type: string
                                                    enum:
                                                      - LT
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - comparator
                                              - value
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Exists
                                            required:
                                              - type
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - GreaterThanOrEqual
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - LessThan
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - Contains
                                                  - type: string
                                                    enum:
                                                      - NotContains
                                                  - type: string
                                                    enum:
                                                      - StartsWith
                                                  - type: string
                                                    enum:
                                                      - EndsWith
                                              value:
                                                type: string
                                            required:
                                              - type
                                              - value
                                    required:
                                      - path
                                      - operator
                                hasProperties:
                                  description: >-
                                    Used to evaluate whether the user is in the
                                    segment based on the properties of the
                                    selected event.
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      path:
                                        type: string
                                      operator:
                                        anyOf:
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Within
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Equals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - NotEquals
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - HasBeen
                                              comparator:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - GTE
                                                  - type: string
                                                    enum:
                                                      - LT
                                              value:
                                                anyOf:
                                                  - type: string
                                                  - type: number
                                              windowSeconds:
                                                type: number
                                            required:
                                              - type
                                              - comparator
                                              - value
                                              - windowSeconds
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - Exists
                                            required:
                                              - type
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - GreaterThanOrEqual
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                type: string
                                                enum:
                                                  - LessThan
                                              value:
                                                type: number
                                            required:
                                              - type
                                              - value
                                          - type: object
                                            properties:
                                              type:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - Contains
                                                  - type: string
                                                    enum:
                                                      - NotContains
                                                  - type: string
                                                    enum:
                                                      - StartsWith
                                                  - type: string
                                                    enum:
                                                      - EndsWith
                                              value:
                                                type: string
                                            required:
                                              - type
                                              - value
                                    required:
                                      - path
                                      - operator
                              required:
                                - type
                                - id
                                - event
                                - hasProperties
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Email
                                id:
                                  type: string
                                event:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - TRInternalMessageSent
                                    - type: string
                                      enum:
                                        - TREmailAccepted
                                    - type: string
                                      enum:
                                        - TREmailDropped
                                    - type: string
                                      enum:
                                        - TREmailDelivered
                                    - type: string
                                      enum:
                                        - TREmailOpened
                                    - type: string
                                      enum:
                                        - TREmailClicked
                                    - type: string
                                      enum:
                                        - TREmailBounced
                                    - type: string
                                      enum:
                                        - TREmailMarkedSpam
                                times:
                                  type: number
                                templateId:
                                  type: string
                              required:
                                - type
                                - id
                                - event
                                - templateId
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Broadcast
                                id:
                                  type: string
                              required:
                                - type
                                - id
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - SubscriptionGroup
                                id:
                                  type: string
                                subscriptionGroupId:
                                  type: string
                                subscriptionGroupType:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - OptIn
                                    - type: string
                                      enum:
                                        - OptOut
                              required:
                                - type
                                - id
                                - subscriptionGroupId
                                - subscriptionGroupType
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - RandomBucket
                                id:
                                  type: string
                                percent:
                                  description: >-
                                    The percentage of users to be randomly
                                    assigned to be in the segment. Expressed as
                                    a number between 0 and 1.
                                  type: number
                              required:
                                - type
                                - id
                                - percent
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Everyone
                                id:
                                  type: string
                              required:
                                - type
                                - id
                    required:
                      - entryNode
                      - nodes
                  subscriptionGroupId:
                    type: string
                  updatedAt:
                    allOf:
                      - type: number
                      - type: number
                  lastRecomputed:
                    type: number
                  recomputePending:
                    type: boolean
                  createdAt:
                    type: number
                  definitionUpdatedAt:
                    type: number
                  createdBy:
                    type: object
                    properties:
                      name:
                        type: string
                      viaAssistantConnectionId:
                        type: string
                      viaAssistant:
                        type: string
                    required:
                      - name
                required:
                  - id
                  - workspaceId
                  - name
                  - definition
                  - updatedAt
                  - recomputePending
                  - createdAt
                  - definitionUpdatedAt
        '404':
          description: An empty String
          content:
            application/json:
              schema:
                description: An empty String
                type: string
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - adminApiKey: []
components:
  securitySchemes:
    adminApiKey:
      type: http
      scheme: bearer
      description: >-
        An Admin API key, sent as `Authorization: Bearer <key>`. Create one in
        Settings.

````

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