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

# PUT /api/admin/segments/

> Create or update a user segment.



## OpenAPI

````yaml put /api/admin/segments/
openapi: 3.1.0
info:
  title: Dittofeed API
  description: Dittofeed API Swagger Documentation
  version: 0.0.1
servers: []
security: []
paths:
  /api/admin/segments/:
    put:
      tags:
        - Segments
      description: Create or update a user segment.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - type: object
                  properties:
                    id:
                      type: string
                    definition:
                      type: object
                      properties:
                        entryNode:
                          anyOf:
                            - anyOf:
                                - 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:
                                                - AbsoluteTimestamp
                                            absoluteTimestamp:
                                              type: string
                                            direction:
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - after
                                                - type: string
                                                  enum:
                                                    - before
                                          required:
                                            - type
                                            - absoluteTimestamp
                                            - direction
                                        - 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:
                                                - NotExists
                                          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:
                                    - 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:
                                        - Performed
                                    id:
                                      type: string
                                    event:
                                      type: string
                                    times:
                                      type: number
                                    timesOperator:
                                      anyOf:
                                        - type: string
                                          enum:
                                            - '='
                                        - type: string
                                          enum:
                                            - '>='
                                        - type: string
                                          enum:
                                            - <
                                    timeOperator:
                                      anyOf:
                                        - type: string
                                          enum:
                                            - Within
                                        - type: string
                                          enum:
                                            - AfterAbsolute
                                        - type: string
                                          enum:
                                            - BeforeAbsolute
                                    withinSeconds:
                                      type: number
                                    absoluteTimestamp:
                                      type: string
                                    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:
                                                      - AbsoluteTimestamp
                                                  absoluteTimestamp:
                                                    type: string
                                                  direction:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - after
                                                      - type: string
                                                        enum:
                                                          - before
                                                required:
                                                  - type
                                                  - absoluteTimestamp
                                                  - direction
                                              - 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:
                                                      - NotExists
                                                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
                                - 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:
                                                      - AbsoluteTimestamp
                                                  absoluteTimestamp:
                                                    type: string
                                                  direction:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - after
                                                      - type: string
                                                        enum:
                                                          - before
                                                required:
                                                  - type
                                                  - absoluteTimestamp
                                                  - direction
                                              - 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:
                                                      - NotExists
                                                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
                                    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:
                                                      - AbsoluteTimestamp
                                                  absoluteTimestamp:
                                                    type: string
                                                  direction:
                                                    anyOf:
                                                      - type: string
                                                        enum:
                                                          - after
                                                      - type: string
                                                        enum:
                                                          - before
                                                required:
                                                  - type
                                                  - absoluteTimestamp
                                                  - direction
                                              - 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:
                                                      - NotExists
                                                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
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - Email
                                    id:
                                      type: string
                                    event:
                                      anyOf:
                                        - type: string
                                          enum:
                                            - DFInternalMessageSent
                                        - type: string
                                          enum:
                                            - DFEmailDropped
                                        - type: string
                                          enum:
                                            - DFEmailDelivered
                                        - type: string
                                          enum:
                                            - DFEmailOpened
                                        - type: string
                                          enum:
                                            - DFEmailClicked
                                        - type: string
                                          enum:
                                            - DFEmailBounced
                                        - type: string
                                          enum:
                                            - DFEmailMarkedSpam
                                    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:
                                        - Includes
                                    id:
                                      type: string
                                    path:
                                      type: string
                                    item:
                                      type: string
                                  required:
                                    - type
                                    - id
                                    - path
                                    - item
                            - 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:
                                                  - NotEquals
                                              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:
                              - 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:
                                              - AbsoluteTimestamp
                                          absoluteTimestamp:
                                            type: string
                                          direction:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - after
                                              - type: string
                                                enum:
                                                  - before
                                        required:
                                          - type
                                          - absoluteTimestamp
                                          - direction
                                      - 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:
                                              - NotExists
                                        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:
                                  - 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:
                                      - Performed
                                  id:
                                    type: string
                                  event:
                                    type: string
                                  times:
                                    type: number
                                  timesOperator:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - '='
                                      - type: string
                                        enum:
                                          - '>='
                                      - type: string
                                        enum:
                                          - <
                                  timeOperator:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - Within
                                      - type: string
                                        enum:
                                          - AfterAbsolute
                                      - type: string
                                        enum:
                                          - BeforeAbsolute
                                  withinSeconds:
                                    type: number
                                  absoluteTimestamp:
                                    type: string
                                  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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                              - 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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                                  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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Email
                                  id:
                                    type: string
                                  event:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - DFInternalMessageSent
                                      - type: string
                                        enum:
                                          - DFEmailDropped
                                      - type: string
                                        enum:
                                          - DFEmailDelivered
                                      - type: string
                                        enum:
                                          - DFEmailOpened
                                      - type: string
                                        enum:
                                          - DFEmailClicked
                                      - type: string
                                        enum:
                                          - DFEmailBounced
                                      - type: string
                                        enum:
                                          - DFEmailMarkedSpam
                                  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:
                                      - Includes
                                  id:
                                    type: string
                                  path:
                                    type: string
                                  item:
                                    type: string
                                required:
                                  - type
                                  - id
                                  - path
                                  - item
                      required:
                        - entryNode
                        - nodes
                    subscriptionGroupId:
                      type: string
                    updatedAt:
                      type: number
                    lastRecomputed:
                      type: number
                    resourceType:
                      anyOf:
                        - type: string
                          enum:
                            - Declarative
                        - type: string
                          enum:
                            - Internal
                    status:
                      anyOf:
                        - type: string
                          enum:
                            - NotStarted
                        - type: string
                          enum:
                            - Running
                        - type: string
                          enum:
                            - Paused
                - type: object
                  properties:
                    workspaceId:
                      type: string
                    name:
                      type: string
                  required:
                    - workspaceId
                    - name
                - type: object
                  properties:
                    createOnly:
                      type: boolean
      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:
                              - 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:
                                              - AbsoluteTimestamp
                                          absoluteTimestamp:
                                            type: string
                                          direction:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - after
                                              - type: string
                                                enum:
                                                  - before
                                        required:
                                          - type
                                          - absoluteTimestamp
                                          - direction
                                      - 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:
                                              - NotExists
                                        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:
                                  - 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:
                                      - Performed
                                  id:
                                    type: string
                                  event:
                                    type: string
                                  times:
                                    type: number
                                  timesOperator:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - '='
                                      - type: string
                                        enum:
                                          - '>='
                                      - type: string
                                        enum:
                                          - <
                                  timeOperator:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - Within
                                      - type: string
                                        enum:
                                          - AfterAbsolute
                                      - type: string
                                        enum:
                                          - BeforeAbsolute
                                  withinSeconds:
                                    type: number
                                  absoluteTimestamp:
                                    type: string
                                  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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                              - 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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                                  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:
                                                    - AbsoluteTimestamp
                                                absoluteTimestamp:
                                                  type: string
                                                direction:
                                                  anyOf:
                                                    - type: string
                                                      enum:
                                                        - after
                                                    - type: string
                                                      enum:
                                                        - before
                                              required:
                                                - type
                                                - absoluteTimestamp
                                                - direction
                                            - 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:
                                                    - NotExists
                                              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
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - Email
                                  id:
                                    type: string
                                  event:
                                    anyOf:
                                      - type: string
                                        enum:
                                          - DFInternalMessageSent
                                      - type: string
                                        enum:
                                          - DFEmailDropped
                                      - type: string
                                        enum:
                                          - DFEmailDelivered
                                      - type: string
                                        enum:
                                          - DFEmailOpened
                                      - type: string
                                        enum:
                                          - DFEmailClicked
                                      - type: string
                                        enum:
                                          - DFEmailBounced
                                      - type: string
                                        enum:
                                          - DFEmailMarkedSpam
                                  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:
                                      - Includes
                                  id:
                                    type: string
                                  path:
                                    type: string
                                  item:
                                    type: string
                                required:
                                  - type
                                  - id
                                  - path
                                  - item
                          - 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:
                                                - NotEquals
                                            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:
                            - 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:
                                            - AbsoluteTimestamp
                                        absoluteTimestamp:
                                          type: string
                                        direction:
                                          anyOf:
                                            - type: string
                                              enum:
                                                - after
                                            - type: string
                                              enum:
                                                - before
                                      required:
                                        - type
                                        - absoluteTimestamp
                                        - direction
                                    - 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:
                                            - NotExists
                                      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:
                                - 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:
                                    - Performed
                                id:
                                  type: string
                                event:
                                  type: string
                                times:
                                  type: number
                                timesOperator:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - '='
                                    - type: string
                                      enum:
                                        - '>='
                                    - type: string
                                      enum:
                                        - <
                                timeOperator:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - Within
                                    - type: string
                                      enum:
                                        - AfterAbsolute
                                    - type: string
                                      enum:
                                        - BeforeAbsolute
                                withinSeconds:
                                  type: number
                                absoluteTimestamp:
                                  type: string
                                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:
                                                  - AbsoluteTimestamp
                                              absoluteTimestamp:
                                                type: string
                                              direction:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - after
                                                  - type: string
                                                    enum:
                                                      - before
                                            required:
                                              - type
                                              - absoluteTimestamp
                                              - direction
                                          - 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:
                                                  - NotExists
                                            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
                            - 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:
                                                  - AbsoluteTimestamp
                                              absoluteTimestamp:
                                                type: string
                                              direction:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - after
                                                  - type: string
                                                    enum:
                                                      - before
                                            required:
                                              - type
                                              - absoluteTimestamp
                                              - direction
                                          - 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:
                                                  - NotExists
                                            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
                                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:
                                                  - AbsoluteTimestamp
                                              absoluteTimestamp:
                                                type: string
                                              direction:
                                                anyOf:
                                                  - type: string
                                                    enum:
                                                      - after
                                                  - type: string
                                                    enum:
                                                      - before
                                            required:
                                              - type
                                              - absoluteTimestamp
                                              - direction
                                          - 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:
                                                  - NotExists
                                            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
                            - type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - Email
                                id:
                                  type: string
                                event:
                                  anyOf:
                                    - type: string
                                      enum:
                                        - DFInternalMessageSent
                                    - type: string
                                      enum:
                                        - DFEmailDropped
                                    - type: string
                                      enum:
                                        - DFEmailDelivered
                                    - type: string
                                      enum:
                                        - DFEmailOpened
                                    - type: string
                                      enum:
                                        - DFEmailClicked
                                    - type: string
                                      enum:
                                        - DFEmailBounced
                                    - type: string
                                      enum:
                                        - DFEmailMarkedSpam
                                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:
                                    - Includes
                                id:
                                  type: string
                                path:
                                  type: string
                                item:
                                  type: string
                              required:
                                - type
                                - id
                                - path
                                - item
                    required:
                      - entryNode
                      - nodes
                  subscriptionGroupId:
                    type: string
                  updatedAt:
                    allOf:
                      - type: number
                      - type: number
                  lastRecomputed:
                    type: number
                  resourceType:
                    anyOf:
                      - type: string
                        enum:
                          - Declarative
                      - type: string
                        enum:
                          - Internal
                  status:
                    anyOf:
                      - type: string
                        enum:
                          - NotStarted
                      - type: string
                        enum:
                          - Running
                      - type: string
                        enum:
                          - Paused
                  createdAt:
                    type: number
                  definitionUpdatedAt:
                    type: number
                required:
                  - id
                  - workspaceId
                  - name
                  - definition
                  - updatedAt
                  - createdAt
                  - definitionUpdatedAt
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - IdError
                      message:
                        type: string
                    required:
                      - type
                      - message
                  - type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - UniqueConstraintViolation
                      message:
                        type: string
                    required:
                      - type
                      - message

````