openapi: 3.0.1
info:
  title: cdp-api
  description: >-
    All of the CDP APIs are organized around REST - if you've interacted with a
    RESTful API already, many of the concepts will be familiar to you. All API
    calls to CDP API should be made to the following endpoints depending on the
    [region](https://docs.treasuredata.com/display/public/PD/Sites+and+Endpoints#SitesandEndpoints-Endpoints).
    For historical reasons there are REST API endpoints and JSON:API endpoints.
    JSON:API endpoints are located under "/entities".
  termsOfService: https://www.treasuredata.com/terms/
  version: 1.0.0
externalDocs:
  description: Treasure Data Support Site
  url: https://support.treasuredata.com/hc/en-us
servers:
  - url: https://api-cdp.treasuredata.com
  - url: https://api-cdp.treasuredata.co.jp
  - url: https://api-cdp.eu01.treasuredata.com
  - url: https://api-cdp.ap02.treasuredata.com
  - url: https://api-cdp.ap03.treasuredata.com
tags:
  - name: Parent Segment Configurations
    description: >-
      Defining a data model for customer data is done by defining parent
      segments. Parent segments give you an ability to build a single view of a
      customer, including capturing all interactions, such as attributes and
      behaviors associated with your brand. In parent segments, you unify your
      customer data. When the customer data is unified, you can create customer
      segments without writing any SQL queries. You can personalize customer
      communications and conversations of any size and in any channel.<br> <br>
      <br>_Treasure Data is making an effort to use more inclusive language in
      its product, content, and customer solutions. As we gradually make the
      move to replace insensitive language beginning in our UI, you may continue
      to see parent segments in the UI, for example, referenced as master
      segment in portions of Treasure Data APIs._
  - name: Parent Segments
    description: >-
      After you have created the parent segment, you can view data about the
      parent segment, such as details about a single segment, audience data, the
      list of segment folders it contains, or a list of parent segments
      available.
  - name: Segments
    description: >-
      In marketing, a segment is a container that groups profiles (usually
      people) who share one or more common characteristics. In Treasure Data,
      the parent segment is your total population of people, accounts, or other
      type of collection and can be both existing and potential customers. <br>
      <br>You create segments to divide the population into subgroups of
      consumers based on some type of shared characteristics. Segments and
      subsegments enable more specific targeting for your marketing campaigns.
      <br> <br> <br>_Treasure Data is making an effort to use more inclusive
      language in its product, content, and customer solutions. As we gradually
      make the move to replace insensitive language beginning in our UI, you may
      continue to see parent segments in the UI, for example, referenced as
      master segment in portions of Treasure Data APIs._
  - name: Folders
    description: >-
      Folders are containers in which you can organize information. Nested
      folders offer flexible organization controls. Large volumes of data and
      application assets can be organized into multi-nested folders by
      categories such as geographical markets, brands, and business functions.
      Granular permissions can be set for each folder to ensure security.
  - name: Activations
    description: >-
      Activation is the process that allows marketers to personalize
      communication to users interested in your brand. <br> <ul> <li> **Funnel
      activation** &mdash; Create a funnel activation for each funnel stage. The
      activation exports to external marketing tools for campaigns or BI tools
      for analysis and reporting.</li> <li> **Segment activation** &mdash;
      Activate the segment data (export) to external tools for activities such
      as marketing campaigns, business analysis, and social media. Targets
      include Email Marketing Systems, Marketing Automation Systems, Advertising
      Platforms, CRM, ERP, Cloud Services, and SFTP.</li> </ul><br>_Known
      formerly as syndication in Audience Studio Legacy. You may continue to see
      syndication referenced in Treasure Data APIs._
  - name: Tokens
    description: >-
      The Profiles API Token enables your ability to increase personalized
      content based on detailed customer information. This REST API returns
      customer data in real-time and updates your segment information. The
      ability to create a Profiles API token is based on your <a
      href="https://docs.treasuredata.com/display/public/PD/Folder-based+Permissions">folder
      permissions.</a> <br> <br> You can also use Profiles API Token to
      personalize your customers' experience on your website. You can combine
      Treasure Data’s personalization feature with A/B Testing tools such as
      Adobe Target, Optimizely, or Google Optimize, to determine the version of
      your website that yields results. <br> <br> When the underlying
      personalization workflow completes, the personalization data set is
      refreshed. You can see a current list of the segments to which a specific
      profile belongs. You can also see a list of attributes associated with the
      specific profile.<br> <br> The parent segment must already exist. The
      parent segment is the basis for all data accessed by Profiles API Tokens.
      <br> <br> The use of the Profiles API Token with your tools requires the
      use of the Treasure Data JavaScript SDK and support or services
      consultation.
  - name: Funnels
    description: >-
      One of the challenges of targeting customers with relevant campaigns is
      understanding where they are in their customer journey. Many organizations
      use the traditional marketing funnel to understand where their customers
      are in the buying process. Knowing where customers are in the marketing
      funnel allows organizations to create campaigns and analyze customer
      behaviors that are specific to individual customers or customer groups.
      Being able to use all available customer data to accurately identify
      exactly in which stage customers are in gives marketers a clear advantage.
      <br> <br> Treasure Data offers Funnels, a premium subscription feature in
      Audience Studio, which provides this advantage to its users. Funnels make
      it easier for marketers to see exactly where their customers are in the
      buying process, allowing them to create more customer-tailored marketing
      campaigns using multi-channel activations.<br> <br> Funnels enables
      marketers to create and customize a marketing funnel with up to eight
      stages in the Audience Studio to reflect the exact buying experience of
      their customers. After the Funnel stages have been created, marketers can
      further analyze and refine the stages and activate specific stages for
      campaigns.
  - name: Predictive Segments
    description: >-
      Using Treasure Data’s predictive scoring model, based on predictive
      segments, marketers can predict profile behavior such as who is likely to
      churn, purchase, click, or convert in the near future. <br> <br> A
      predictive model is a set of rules that makes it possible to predict an
      unmeasured value from other, known values. The form of the rules is
      suggested by reviewing the data collected. Training is then used to make
      some predictions. Predictive modeling uses statistics to predict outcomes.
      <br><br>Predictive modeling is a typically used statistical technique to
      predict future behavior. Predictive modeling solutions analyze historical
      and current data and the generated model helps predict future outcomes. In
      predictive modeling, data is collected, a statistical model is formulated,
      predictions are made, and the model is validated (or revised) as
      additional data becomes available. For example, risk models can be created
      to combine member information in complex ways with demographic and
      lifestyle information from external sources to improve underwriting
      accuracy. Predictive models analyze past performance to assess how likely
      a customer is to exhibit a specific behavior in the future. This category
      also encompasses models that seek out subtle data patterns to answer
      questions about customer performance, such as fraud detection models.
      Predictive models often perform calculations during live transactions—for
      example, to evaluate the risk or opportunity of a given customer or
      transaction to guide a decision. <br> <br> Treasure Data’s predictive
      scoring model uses predictive segments to customize predictive scoring
      models for a particular segment.
  - name: Journeys
    description: >-
      In Audience Studio, a journey represents a timeline of events that can
      help you motivate a customer’s behavior about your product. After
      marketers create journey stages, they can further analyze and refine the
      stages and activate specific stages for campaigns. <br><br> _Journeys is a
      premium feature. Contact your Customer Success Representative for more
      information._
  - name: Activation Templates
    description: >-
      Marketers find creating an activation challenging because they have to
      enter technical information they might not understand, which can lead to
      activations failing due to misconfigurations. Treasure Data solves this
      problem with the Activation Template. The Activation Template allows data
      engineers to create templates with pre-populated fields so that the
      marketer can confidently create an activation.
paths:
  /audiences:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve list of parent segment configurations
      description: >-
        Retrieve a list of parent segment configurations by name. You can get
        the parent segment's schedules, created_by, the parent database name and
        tables, its attributes and behaviors, as well as the population for the
        retrieved Parent Segment.
      operationId: audiences#index
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Audience'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Parent Segment Configurations
      summary: Create new parent segment configuration
      description: Create a new parent segment configuration.
      operationId: audiences#create
      requestBody:
        description: Create a new Master Segment Config
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Audience'
        required: true
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve parent segment configuration by ID
      description: >-
        Search and find a specified parent segment configuration by its
        identifier.
      operationId: audiences#show
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    put:
      tags:
        - Parent Segment Configurations
      summary: Update parent segment configuration
      description: Update the specified parent segment configuration by its identifier.
      operationId: audiences#update
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config that needs to be updated
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Audience'
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Parent Segment Configurations
      summary: Delete parent segment configuration
      description: Delete a previously created parent segment configuration.
      operationId: audiences#delete
      parameters:
        - name: audienceId
          in: path
          description: Master Segment Config id to delete
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '404':
          description: Master Segment Config not found
          content: {}
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/attributes:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve list of audience attributes
      description: >-
        Retrieve a list of parent segment attributes. You can also specify the
        visibility level for sensitive attributes.
      operationId: audience_attributes#index
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/AudienceAttributeWithVisibility'
                    - $ref: '#/components/schemas/AudienceMasterAttribute'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/behaviors:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve list of audience behaviors
      description: Retrieve a list of parent segment behaviors.
      operationId: audience_behaviors#index
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config to return
          required: true
          schema:
            type: integer
            format: int64
        - name: realtime
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AudienceBehaviorWithVisibility'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/run:
    x-external: true
    post:
      tags:
        - Parent Segment Configurations
      summary: Run workflow to (re)generate parent segment
      description: Run the workflow to generate or regenerate a parent segment.
      operationId: audiences#run
      parameters:
        - name: audienceId
          in: path
          description: Master Segment Config id to delete
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the workflow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudienceExecution'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/folders:
    x-external: true
    get:
      tags:
        - Parent Segments
      summary: Retrieve list of segment folders
      description: >-
        Retrieve a list of segment folders based on a parent segment's
        identifier.
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: |
            Retrieves a list of segment folders.

            N.B. that `createdAt` can be `null`, meaning that it is not known
            which user created the folder.

            N.B. that `updatedAt` can be `null`, meaning that is is not known
            which user last updated the folder.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SegmentFolderReadRepresentation'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Folders
      summary: Create new segment folder
      description: Create a new parent segment folder.
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Segment Folder to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentFolderCreateRepresentation'
      responses:
        '200':
          description: Returns the segment folder which was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentFolderReadRepresentation'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/folders/{folderId}:
    x-external: true
    get:
      tags:
        - Folders
      summary: Retrieve single segment folder
      description: Retrieve a single segment folder based on a parent segment identifier.
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment Folder ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: |
            Retrieves a single segment folder.

            N.B. that `createdAt` can be `null`, meaning that it is not known
            which user created the folder.

            N.B. that `updatedAt` can be `null`, meaning that is is not known
            which user last updated the folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentFolderReadRepresentation'
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Folders
      summary: Update segment folder (legacy)
      description: >-
        Update a segment folder. <br> <br> <br> _This endpoint is for Audience
        Studio legacy. For the latest Audience Studio, contact your Customer
        Success Representative._
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment folder to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Segment Folder to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentFolderUpdateRepresentation'
      responses:
        '200':
          description: |
            Retrieves the segment folder which was updated

            N.B. that `createdAt` can be `null`, meaning that it is not known
            which user created the folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentFolderReadRepresentation'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Folders
      summary: Delete segment folder (legacy)
      description: >-
        Delete a segment folder.<br> <br> <br> _This endpoint is for Audience
        Studio legacy. For the latest Audience Studio, contact your Customer
        Success Representative._
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment folder to update
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: The segment folder was deleted successfully
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/folders/{folderId}/put_in:
    x-external: true
    post:
      tags:
        - Folders
      summary: Move segment into folder (legacy)
      description: >-
        Move a segment or segments into an existing folder. <br> <br> <br> _This
        endpoint is for Audience Studio legacy. For the latest Audience Studio,
        contact your Customer Success Representative._
      parameters:
        - name: audienceId
          in: path
          description: Master segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment folder to put segments in
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Segment ids to move
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/executions:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve list of executions using audienceId
      description: >-
        Retrieve a list of workflow executions, whether they were succesful or
        not, and their status.
      operationId: audiences#executions
      parameters:
        - name: audienceId
          in: path
          description: Master Segment Config id to delete
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the workflow
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AudienceExecution'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/statistics:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve population statistics audience
      description: >-
        Retrieve the population history of the audience. The history is returned
        per day and those days are calculated in the timezone of the audience.
      operationId: audiences#statistics
      parameters:
        - name: audienceId
          in: path
          description: Master Segment Config id to delete
          required: true
          schema:
            type: integer
            format: int64
            example: 1234
        - name: from
          in: query
          description: from date
          schema:
            type: string
            format: date
            example: '2019-01-01'
        - name: to
          in: query
          description: to date (inclusive)
          schema:
            type: string
            format: date
            example: '2019-04-30'
      responses:
        '200':
          description: array of tuple of statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statistic'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve list of segments
      description: Retrieve a list of segments.
      operationId: segments#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Segments
      summary: Create new segment
      description: Create a new segment.
      operationId: segments#create
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Segment parameters to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentParameters'
        required: true
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/folders/{folderId}/segments:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve list of segments in a folder
      description: Retrieve a list of segments in a folder.
      operationId: segment_folders#segments
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment Folder ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/folders/{folderId}/syndications:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve list of activations recursively under a folder
      description: >-
        Retrieve a list of activations (formerly syndications) recursively under
        a folder.
      operationId: segment_folders#syndications
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the syndications
          required: true
          schema:
            type: integer
            format: int64
        - name: folderId
          in: path
          description: Segment Folder ID
          required: true
          schema:
            type: integer
            format: int64
        - name: sorted_by
          in: query
          required: false
          description: a sort key with an option
          schema:
            type: string
            format: '{sort_key}:{option}'
          examples:
            connection_type_asc:
              value: connection_type:asc
              summary: >-
                Sorted by connection_type in an ascending order (Note that
                Pagination parameters page[size] and page[after] are ignored if
                sorted by connection_type)
            segment_id_asc:
              value: segment_id:asc
              summary: Sorted by segment_id in an ascending order
            segment_name_desc:
              value: segment_name:desc
              summary: Sorted by segment_name in an descending order
            activation_template_id_desc:
              value: activation_template_id:desc
              summary: Sorted by activation_template_id in an descending order
            activation_template_name_asc:
              value: activation_template_name:asc
              summary: Sorted by activation_template_name in an ascending order
            start_at_desc:
              value: start_at:desc
              summary: Sorted by start_at in an descending order
            repeat_unit_asc:
              value: repeat_unit:asc
              summary: Sorted by repeat_unit in an ascending alphabetical order
            created_by_td_user_id_asc:
              value: created_by_td_user_id:asc
              summary: Sorted by the User ID of created_by in an ascending order
            created_by_user_name_desc:
              value: created_by_user_name:desc
              summary: Sorted by the User Name of created_by in an descending order
            updated_at_desc:
              value: updated_at:desc
              summary: Sorted by updated_at in an descending order
            created_at_desc:
              value: created_at:desc
              summary: Sorted by created_at in an descending order
        - name: name_include
          in: query
          required: false
          description: >-
            filter by Activation's name to return only Activations whose name
            includes the value
          schema:
            type: string
        - name: segment_name_include
          in: query
          required: false
          description: >-
            filter by Segment's name to return only Activations whose Segment
            name includes the value
          schema:
            type: string
        - name: start_after
          in: query
          required: false
          description: filter by start_at to return only Activations that starts after
          schema:
            type: string
            format: date-time
        - name: start_before
          in: query
          required: false
          description: filter by start_at to return only Activations that starts before
          schema:
            type: string
            format: date-time
        - name: connection_type
          in: query
          required: false
          description: >-
            filter by Connection Type return only Activations whose Connection
            Types match (Note that Pagination parameters page[size] and
            page[after] are ignored if connection_type is specified)
          schema:
            type: array
            items:
              type: string
        - name: schedule_status
          in: query
          required: false
          description: filter by schedule_status
          schema:
            type: array
            items:
              type: string
              enum:
                - none
                - inactive
                - scheduled
                - active
          style: form
          explode: false
        - name: created_by_td_user_id
          in: query
          required: false
          description: filter by the User ID of created_by
          schema:
            type: array
            items:
              type: integer
              format: int64
          style: form
          explode: false
        - name: activation_template_id
          in: query
          required: false
          description: >-
            filter by activation_template_id, "none" matches with an Activation
            that has no Activation Template, but it does not match with an
            Activation that has a deleted Activation Template
          schema:
            type: array
            items:
              oneOf:
                - type: integer
                  format: int64
                - type: string
                  enum:
                    - none
          style: form
          explode: false
        - name: repeat_unit
          in: query
          required: false
          description: filter by repeat_unit
          schema:
            type: array
            items:
              type: string
              enum:
                - hour
                - day
                - week
                - month
                - minute
                - once
                - none
          style: form
          explode: false
        - name: page[after]
          in: query
          description: An opaque cursor to get the next syndications
          schema:
            type: string
        - name: page[size]
          in: query
          description: The paginated number of syndications to get
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  syndications:
                    type: array
                    items:
                      $ref: '#/components/schemas/SyndicationOverview'
                  pagination:
                    type: object
                    additionalProperties: true
                    properties:
                      hasNext:
                        type: boolean
                      nextPage:
                        type: string
                      approximateCount:
                        type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/query:
    x-external: true
    post:
      tags:
        - Segments
      summary: Retrieve SQL from segment rule
      description: Retrieve a SQL from a segment rule.
      operationId: segments#query
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Segment parameters to create
        content:
          application/json:
            schema:
              type: object
              properties:
                format:
                  type: string
                  enum:
                    - sql
                realtime:
                  type: boolean
                  deprecated: true
                  description: use `kind` instead
                kind:
                  type: integer
                  description: '0: batch, 1: realtime, 2: funnel_stage'
                rule:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
                funnel_stage:
                  type: object
                  properties:
                    funnel_id:
                      type: integer
                      format: int64
                    stage_id:
                      type: integer
                      format: int64
                  description: required if creating segment as a rule of funnel_stage
        required: true
      responses:
        '200':
          description: batch segment query
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: >-
                      batch segment query; return if the requestBody is
                      realtime=false
                    additionalProperties: false
                    properties:
                      sql:
                        type: string
                  - type: object
                    description: >-
                      realtime segment query; return if the requestBody is
                      realtime=true
                    required:
                      - sql
                      - statement
                      - batch_workflows
                    properties:
                      sql:
                        type: string
                      statement:
                        type: object
                        description: an object tree which will be sent to cdp-kvs-server
                      batch_workflows:
                        type: object
                        description: >-
                          workflow definition; key is file namd and value is
                          file content of the generating workflow.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/queries:
    x-external: true
    post:
      tags:
        - Segments
      summary: Retrieve number of profiles based on set of segment rules
      description: Retrieve the number of profiles produced by a set of segment rules.
      operationId: segments#new_query
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                columns:
                  type: array
                  items:
                    type: string
                realtime:
                  type: boolean
                  deprecated: true
                  description: use `kind` instead
                kind:
                  type: integer
                  description: '0: batch, 1: realtime, 2: funnel_stage'
                rule:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
                funnel_stage:
                  type: object
                  properties:
                    funnel_id:
                      type: integer
                      format: int64
                    stage_id:
                      type: integer
                      format: int64
                  description: required if creating segment as a rule of funnel_stage
                pageSize:
                  type: integer
                maxPage:
                  type: integer
                enableMv:
                  type: string
                  description: '"true", "false"'
                filterString:
                  type: string
                  example: Alex
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentQueryStatus'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/{segmentId}:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve segment by ID
      description: Retrieve a segment based on its identifier.
      operationId: segments#show
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: ID of Segment to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    put:
      tags:
        - Segments
      summary: Update segment
      description: Update a segment.
      operationId: segments#update
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: ID of Segment that needs to be updated
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SegmentParameters'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Segments
      summary: Delete segment (legacy)
      description: >-
        Delete a segment. <br> <br> <br> _This endpoint is for Audience Studio
        legacy. For the latest Audience Studio, contact your Customer Success
        Representative._
      operationId: segments#delete
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment id to delete
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/queries/{queryId}:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve status of query
      description: Retrieve the status of a query.
      operationId: segments#query_status
      parameters:
        - name: audienceId
          in: path
          description: Audience ID of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: queryId
          in: path
          description: ID of query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentQueryStatus'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/queries/{queryId}/kill:
    x-external: true
    post:
      tags:
        - Segments
      summary: Kill current running query of segment
      description: Kill the current running query associated with the segment.
      operationId: segments#kill_query
      parameters:
        - name: audienceId
          in: path
          description: Audience ID of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: queryId
          in: path
          description: ID of query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A message indicates canceling query didn't complete
                      successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/queries/{queryId}/customers:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve profiles of query
      description: Retrieve the profiles of a query.
      operationId: segments#index_query_customers
      parameters:
        - name: audienceId
          in: path
          description: Audience ID of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: queryId
          in: path
          description: ID of query
          required: true
          schema:
            type: string
        - name: page
          in: query
          schema:
            type: number
            minimum: 1
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SegmentQueryCustomers'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/{segmentId}/statistics:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve population statistics of segment
      description: >-
        Retrieve the population history of the segment. The history is returned
        per day and those days are calculated in the timezone of the audience.
        Note that funnel_stage kind doesn't have statistics via this endpoint.
      operationId: segments#statistics
      parameters:
        - name: audienceId
          in: path
          description: Audience ID of the segment
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: ID of Segment to return
          required: true
          schema:
            type: integer
            format: int64
        - name: from
          in: query
          description: from date
          schema:
            type: string
            format: date
            example: '2019-01-01'
        - name: to
          in: query
          description: to date (inclusive)
          schema:
            type: string
            format: date
            example: '2019-04-30'
      responses:
        '200':
          description: array of tuple of statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statistic'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/{segmentId}/syndications:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve list of activations in segment
      description: >-
        Retrieve a list of activations (formerly syndications) associated with a
        segment.
      operationId: syndications#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Syndication'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Activations
      summary: Create activation
      description: Create a new activation (formerly syndication).
      operationId: syndications#create
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Syndication parameters to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyndicationParameters'
        required: true
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/{segmentId}/syndications/{syndicationId}:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve activation by ID
      description: Retrieve an activation (formerly syndication) based on its identifier.
      operationId: syndications#show
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: syndicationId
          in: path
          description: ID of Syndication to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Syndication'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    put:
      tags:
        - Activations
      summary: Update activation
      description: Update an activation (formerly syndication).
      operationId: syndications#update
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: syndicationId
          in: path
          description: ID of Syndication to return
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyndicationParameters'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Syndication'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Activations
      summary: Delete activation
      description: Delete an activation (formerly syndication).
      operationId: syndications#delete
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: syndicationId
          in: path
          description: ID of Syndication to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/segments/{segmentId}/syndications/{syndicationId}/run:
    x-external: true
    post:
      tags:
        - Activations
      summary: Run activation (legacy)
      description: >-
        Run an activation (formerly syndication). <br> <br> <br> _This endpoint
        is for Audience Studio legacy. For the latest Audience Studio, contact
        your Customer Success Representative._
      operationId: syndications#run
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: syndicationId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the Syndication
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyndicationExecution'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/syndications:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve list of activations in audience
      description: >-
        Retrieve a list of activations (formerly syndications) associated with a
        parent segment ID and view their status and/or schedules.
      operationId: audience_syndications#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the syndication
          required: true
          schema:
            type: integer
            format: int64
        - name: without_detail
          in: query
          description: >-
            If true, the response does not include the detail of the
            syndication, such as valid, and executions.
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Syndication'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/tokens:
    x-external: true
    get:
      tags:
        - Tokens
      summary: Retrieve list of Profile API tokens
      description: >-
        Retrieve a list of Profile API tokens associated with a parent segment
        ID.
      operationId: tokens#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the token
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Token'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Tokens
      summary: Create new Profiles API token (legacy)
      description: >-
        Create a new Profiles API token. <br> <br> <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: tokens#create
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the token
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Token parameters to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenParameters'
        required: true
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/tokens/{tokenId}:
    x-external: true
    get:
      tags:
        - Tokens
      summary: Retrieve Profiles API token by ID
      description: Retrieve a specific Profiles API token by its identifier.
      operationId: tokens#show
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the token
          required: true
          schema:
            type: integer
            format: int64
        - name: tokenId
          in: path
          description: ID of Token to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    put:
      tags:
        - Tokens
      summary: Update Profiles API token (legacy)
      description: >-
        Update a Profiles API token. <br> <br> <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: tokens#update
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the token
          required: true
          schema:
            type: integer
            format: int64
        - name: tokenId
          in: path
          description: ID of Token to return
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenParameters'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Tokens
      summary: Delete a Profiles API token (legacy)
      description: >-
        Delete a Profiles API token. <br> <br> <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: tokens#delete
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID of the token
          required: true
          schema:
            type: integer
            format: int64
        - name: tokenId
          in: path
          description: ID of Token to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/funnels:
    x-external: true
    get:
      tags:
        - Funnels
      summary: List of funnels
      description: >-
        Retrieves a list of funnels associated with a parent segment identifier
        and its stages.
      operationId: funnels#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: succeeded to get
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Funnels
      summary: Create funnel (legacy)
      description: >-
        Create a new funnel, assign it a name and description matching your
        business needs. <br> <br> <br> _This endpoint is for Audience Studio
        legacy. For the latest Audience Studio, contact your Customer Success
        Representative._
      operationId: funnels#create
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Funnel parameters to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunnelParameters'
        required: true
      responses:
        '200':
          description: Succeeded to create funnel
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/funnels/{funnelId}:
    x-external: true
    get:
      tags:
        - Funnels
      summary: Retrieve funnel by ID
      description: Search and find a specific funnel by its identifier. <br> <br> <br>
      operationId: funnels#show
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: funnelId
          in: path
          description: Funnel ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: succeeded to get
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    put:
      tags:
        - Funnels
      summary: Update funnel (legacy)
      description: >-
        Update a funnel. <br> <br> <br> _This endpoint is for Audience Studio
        legacy. For the latest Audience Studio, contact your Customer Success
        Representative._
      operationId: funnels#update
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: funnelId
          in: path
          description: Funnel ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Funnel parameters to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunnelParameters'
        required: true
      responses:
        '200':
          description: Succeeded to update funnel
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Funnels
      summary: Delete funnel (legacy)
      description: >-
        Delete a funnel. <br> <br> <br> _This endpoint is for Audience Studio
        legacy. For the latest Audience Studio, contact your Customer Success
        Representative._
      operationId: funnels#delete
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: funnelId
          in: path
          description: Funnel ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to delete funnel
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/funnels/{funnelId}/clone:
    x-external: true
    post:
      tags:
        - Funnels
      summary: Clone funnel
      description: Make a copy of a funnel.
      operationId: funnels#clone
      parameters:
        - name: audienceId
          in: path
          description: Master Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: funnelId
          in: path
          description: Funnel ID to be cloned
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Funnel parameters to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FunnelCloneParameters'
        required: true
      responses:
        '200':
          description: Succeeded to update funnel
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Funnel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/funnels/{funnelId}/statistics:
    x-external: true
    get:
      tags:
        - Funnels
      summary: Retrieve the population statistics of a funnel and its funnel stages
      description: >-
        Retrieve the population history of a funnel. The history is returned per
        day and those days are calculated in the timezone of the audience.
      operationId: funnels#statistics
      parameters:
        - name: audienceId
          in: path
          description: Audience ID of the funnel
          required: true
          schema:
            type: integer
            format: int64
        - name: funnelId
          in: path
          description: ID of funnel to return
          required: true
          schema:
            type: integer
            format: int64
        - name: from
          in: query
          description: from date
          schema:
            type: string
            format: date
            example: '2019-01-01'
        - name: to
          in: query
          description: to date (inclusive)
          schema:
            type: string
            format: date
            example: '2019-04-30'
        - name: limit
          in: query
          description: number of days to fetch funnel statistics
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: array of tuple of statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunnelStatistic'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /master_segments:
    x-external: true
    get:
      tags:
        - Parent Segments
      summary: Retrieve audience data
      description: >-
        Retrieve the audiences for which the current user can view its produced
        data e.g. segments, profiles, activations.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    description:
                      type: string
                    population:
                      type: number
                      nullable: true
                    updatedAt:
                      type: string
                    updatedBy:
                      $ref: '#/components/schemas/User'
                    matrixUpdatedAt:
                      type: string
                      nullable: true
                    scheduleType:
                      $ref: '#/components/schemas/ScheduleType'
  /audiences/{audienceId}/sample_values:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: Retrieve list of values for a parent segment configuration's attribute
      description: >-
        Retrieve a list of sample values associated with the attributes of a
        parent segment configuration.
      operationId: audiences#sample_values
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config to return
          required: true
          schema:
            type: integer
            format: int64
        - in: query
          name: column
          required: true
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: number
            minimum: 1
        - in: query
          name: samples
          schema:
            type: number
            minimum: 1
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleValuesPayload'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/behaviors/{audienceBehaviorId}/sample_values:
    x-external: true
    get:
      tags:
        - Parent Segment Configurations
      summary: >-
        Retrieve list of sample values for a parent segment configuration's
        behavior
      description: >-
        Retrieve a list of sample values for a parent segment's behavior that
        are useful in understanding data syntax or patterns for further analysis
        or activation.
      operationId: audiences_behaviors#sample_values
      parameters:
        - name: audienceId
          in: path
          description: ID of Master Segment Config to operate on
          required: true
          schema:
            type: integer
            format: int64
        - name: audienceBehaviorId
          in: path
          description: ID of Master Segment Config behavior to operate on
          required: true
          schema:
            type: integer
            format: int64
        - in: query
          name: column
          required: true
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: number
            minimum: 1
        - in: query
          name: samples
          schema:
            type: number
            minimum: 1
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleValuesPayload'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve list of predictive scoring models
      description: >-
        Retrieve a list of predictive scoring models in the specified parent
        segment.
      operationId: predictive_segments#index
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the predictive segment
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PredictiveSegment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Predictive Segments
      summary: Create predictive scoring model (legacy)
      description: >-
        Create a new predictive scoring model. <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: predictive_segments#create
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the preditive segment
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Predictive Segment parameters to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictiveSegmentParameters'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveSegment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve predictive scoring model
      description: Retrieve a specific predictive scoring model's statistics.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveSegment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Predictive Segments
      summary: Update predictive scoring model (legacy)
      description: >-
        Update a predictive scoring model. <br> _This endpoint is for Audience
        Studio legacy. For the latest Audience Studio, contact your Customer
        Success Representative._
      operationId: predictive_segments#update
      parameters:
        - name: audienceId
          in: path
          description: Master Segment id of the predictive segment
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: Predictive Segment parameters to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PredictiveSegmentParameters'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveSegment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Predictive Segments
      summary: Delete predictive scoring model (legacy)
      description: >-
        Delete a predictive scoring model. <br> <br> <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: predictive_segments#destroy
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveSegment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}/executions:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve predictive scoring model executions
      description: Retrieve a list of predictive scoring model executions and their status.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PredictiveSegmentExecution'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/guess_rule_async:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve guessed rule
      description: >-
        Retrieve a list of guessed rules associated with a predictive scoring
        model.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: query
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                      - running
                  rule:
                    $ref: '#/components/schemas/PredictiveSegmentRule'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}/model/columns:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve column list
      description: Retrieve the column list used in a predictive scoring model.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  items:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}/model/features:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve column list of features
      description: Retrieve features associated with a predictive scoring model.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  description: a tuple
                  example:
                    - td_ip_subdivision_names#Maharashtra
                    - 0.4376903474330902
                  items:
                    oneOf:
                      - type: string
                      - type: number
                        format: float
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}/score_histogram:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve histogram
      description: Retrieve a histogram of the specified predictive scoring model.
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: with_positive_train
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  description: >-
                    a tuple. [negagtive(0)/positive(1), histogram] like [1,
                    {"50": 3, "60": 2}]
                  items:
                    oneOf:
                      - type: integer
                      - type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/predictive_segments/{predictiveSegmentId}/run:
    x-external: true
    post:
      tags:
        - Predictive Segments
      summary: Train predictive scoring model (legacy)
      description: >-
        Train a predictive scoring model. <br> <br> <br> _This endpoint is for
        Audience Studio legacy. For the latest Audience Studio, contact your
        Customer Success Representative._
      operationId: predictiveSegment#run
      parameters:
        - name: audienceId
          in: path
          required: true
          schema:
            type: integer
            format: int64
        - name: predictiveSegmentId
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the Predictive Segment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictiveSegmentExecution'
  /entities/by-folder/{folderId}:
    x-external: true
    get:
      tags:
        - Folders
      summary: Retrieve list of objects under specified folder
      description: >-
        Retrieve a list of objects under a specified folder, including child
        folders, segments, batch segments, predictive scoring models, funnels,
        Profile API tokens and Journeys.
      parameters:
        - name: folderId
          in: path
          description: Segment Folder ID
          required: true
          schema:
            type: integer
            format: int64
        - name: depth
          in: query
          description: Depth of retrieved folders
          required: true
          schema:
            type: integer
            format: int64
        - name: with_rule
          in: query
          description: Set false to ignore the segment rule
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: >-
            Returns a list of entities under the specified folder. The specified
            folder is also included.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetByFolderJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/folders:
    x-external: true
    post:
      tags:
        - Folders
      summary: Create folder
      description: Create a new folder.
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesFolderUpdateRepresentation'
      responses:
        '200':
          description: Create a folder
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFolderJsonApiResponse'
  /entities/folders/{id}:
    x-external: true
    get:
      tags:
        - Folders
      summary: Retrieve folder by ID
      description: Retrieve a folder by ID.
      parameters:
        - name: id
          in: path
          description: Folder ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a folder by ID.
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFolderJsonApiResponse'
    patch:
      tags:
        - Folders
      summary: Update folder
      description: Update a folder by ID.
      parameters:
        - name: id
          in: path
          description: Folder to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesFolderUpdateRepresentation'
      responses:
        '200':
          description: Folder to update
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFolderJsonApiResponse'
    delete:
      tags:
        - Folders
      summary: Delete folder
      description: Delete a folder by ID.
      parameters:
        - name: id
          in: path
          description: Delete a folder
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Delete a folder
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFolderJsonApiResponse'
        '400':
          $ref: '#/components/responses/JsonApiBadRequest'
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        '409':
          $ref: '#/components/responses/JsonApiConflictRequest'
  /entities/segments:
    x-external: true
    post:
      tags:
        - Segments
      summary: Create segment
      description: Create a new segment.
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesSegmentUpdateRepresentation'
      responses:
        '200':
          description: Create a segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSegmentJsonApiResponse'
  /entities/segments/{id}:
    x-external: true
    get:
      tags:
        - Segments
      summary: Retrieve segment by ID
      description: Retrieve a segment by ID.
      parameters:
        - name: id
          in: path
          description: Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a segment by ID
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSegmentJsonApiResponse'
    patch:
      tags:
        - Segments
      summary: Update segment
      description: Update a segment.
      parameters:
        - name: id
          in: path
          description: Segment to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesSegmentUpdateRepresentation'
      responses:
        '200':
          description: Update a segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSegmentJsonApiResponse'
    delete:
      tags:
        - Segments
      summary: Delete segment
      description: Delete a segment.
      parameters:
        - name: id
          in: path
          description: Delete a segment
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Delete a segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSegmentJsonApiResponse'
  /entities/segments/{segmentId}/syndications:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve list of activations
      description: Retrieve a list of activations for a particular segment ID.
      operationId: activation#index
      parameters:
        - name: segmentId
          in: path
          description: Segment to list Activation
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a list of Activations.
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesSyndicationIndexJsonApiResponse'
    post:
      tags:
        - Activations
      summary: Create activation
      description: Create an activation (formerly syndication).
      operationId: activation#create
      parameters:
        - name: segmentId
          in: path
          description: Segment to create Activation
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesSyndicationUpdateRepresentation'
      responses:
        '200':
          description: Created Activation
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSyndicationJsonApiResponse'
  /entities/segments/{segmentId}/syndications/{id}:
    x-external: true
    get:
      tags:
        - Activations
      summary: Retrieve list of activations
      description: Retrieve a list of activations for a segment ID.
      operationId: activation#show
      parameters:
        - name: segmentId
          in: path
          description: Segment associated with the Activation
          required: true
          schema:
            type: integer
            format: int64
        - name: id
          in: path
          description: Activation ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns an activation by ID
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSyndicationJsonApiResponse'
    patch:
      tags:
        - Activations
      summary: Update activation
      description: Update an activation.
      operationId: activation#update
      parameters:
        - name: id
          in: path
          description: Activation to update
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment associated with the Activation
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesSyndicationUpdateRepresentation'
      responses:
        '200':
          description: Updated Activation
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSyndicationJsonApiResponse'
    delete:
      tags:
        - Activations
      summary: Delete activation
      description: Delete an activation.
      operationId: activation#delete
      parameters:
        - name: id
          in: path
          description: Activation to delete
          required: true
          schema:
            type: integer
            format: int64
        - name: segmentId
          in: path
          description: Segment associated with the Activation
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Deleted Activation
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetSyndicationJsonApiResponse'
  /entities/segments/{segmentId}/syndications/{id}/run:
    x-external: true
    post:
      tags:
        - Activations
      summary: Run activation
      description: Run an activation by specifying its ID and segment ID.
      parameters:
        - name: segmentId
          in: path
          description: Segment to run Activation
          required: true
          schema:
            type: integer
            format: int64
        - name: id
          in: path
          description: Activation id
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the Syndication
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/SyndicationExecutionJsonApiResource'
  /entities/segments/{id}/predictive_segments/guess_rule_async:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve predictive scoring rules
      description: Retrieve predictive scoring rules.
      parameters:
        - name: id
          in: path
          description: the ID of the segment as a positive segment
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to start to fetch rules
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesSegmentPredictiveSegmentGuessRuleAsyncJsonApiResult
  /entities/funnels:
    x-external: true
    post:
      tags:
        - Funnels
      summary: Create funnel
      description: Create a funnel.
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesFunnelCreateRepresentation'
      responses:
        '200':
          description: Created funnel
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFunnelJsonApiResponse'
  /entities/funnels/{id}:
    x-external: true
    get:
      tags:
        - Funnels
      summary: Retrieve funnel by ID
      description: Retrieve a funnel by ID.
      parameters:
        - name: id
          in: path
          description: Funnel ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a funnel by ID
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFunnelJsonApiResponse'
    patch:
      tags:
        - Funnels
      summary: Update funnel
      description: Update a funnel.
      parameters:
        - name: id
          in: path
          description: Funnel to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesFunnelUpdateRepresentation'
      responses:
        '200':
          description: Updated funnel
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFunnelJsonApiResponse'
    delete:
      tags:
        - Funnels
      summary: Delete funnel
      description: Delete a funnel.
      parameters:
        - name: id
          in: path
          description: Delete a funnel
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Deleted funnel
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetFunnelJsonApiResponse'
  /entities/funnels/{funnelId}/stages/{id}/statistics:
    x-external: true
    get:
      tags:
        - Funnels
      summary: Retrieve population statistics of funnel stage
      description: >-
        Retrieve the population history of the audience. The history is returned
        per day and those days are calculated in the timezone of the audience.
      parameters:
        - name: id
          in: path
          description: Funnel Stage ID to get statistics
          required: true
          schema:
            type: integer
            format: int64
            example: 1234
        - name: funnelId
          in: path
          description: Funnel ID to get statistics
          required: true
          schema:
            type: integer
            format: int64
            example: 1234
        - name: from
          in: query
          description: from date
          schema:
            type: string
            format: date
            example: '2019-01-01'
        - name: to
          in: query
          description: to date (inclusive)
          schema:
            type: string
            format: date
            example: '2019-04-30'
      responses:
        '200':
          description: array of tuple of statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statistic'
  /entities/parent_segments:
    x-external: true
    get:
      tags:
        - Parent Segments
      summary: Retrieve list of parent segments
      description: Retrieve a list of parent segments.
      responses:
        '200':
          description: Returns a list of audiences (parent segments).
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EntitiesGetParentSegmentJsonApiResponse'
  /entities/parent_segments/{id}:
    x-external: true
    get:
      tags:
        - Parent Segments
      summary: Retrieve parent segment by ID
      description: Retrieve an parent segment by ID.
      parameters:
        - name: id
          in: path
          description: ID of an audience (parent segment) to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns an audience (parent segment).
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetParentSegmentJsonApiResponse'
  /entities/parent_segments/{parentSegmentId}/syndications:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Activations
      summary: Retrieve list of activations by parent segment
      description: Retrieve a list of activations based on a parent segment.
      responses:
        '200':
          description: Returns a list of Activations.
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesSyndicationIndexJsonApiResponse'
  /entities/parent_segments/{parentSegmentId}/funnels:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Funnels
      summary: Retrieve list of funnel by parent segment
      description: Retrieve a list of funnels based on a parent segment.
      responses:
        '200':
          description: Returns a list of Funnels.
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesFunnelIndexJsonApiResponse'
  /entities/predictive_segments:
    x-external: true
    post:
      tags:
        - Predictive Segments
      summary: Create predictive scoring model
      description: Create a new predictive scoring model.
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: >-
                #/components/schemas/EntitiesPredictiveSegmentUpdateRepresentation
      responses:
        '200':
          description: Create a predictive segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentJsonApiResponse
  /entities/parent_segments/{parentSegmentId}/user_defined_workflow_projects:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Activations
      summary: List of workflow project names
      description: Returns a list of workflow project names
      parameters:
        - name: namePattern
          in: query
          description: name pattern to filter user-defined workflow projects
          schema:
            type: string
        - name: lastId
          in: query
          description: >-
            fetch workflow projects whose id is greater than this ID for
            pagination
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to get workflow project names
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - $ref: >-
                      #/components/schemas/EntitiesGetWorkflowProjectsJsonApiResult
        '400':
          $ref: '#/components/responses/JsonApiBadRequest'
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
  /entities/parent_segments/{parentSegmentId}/user_defined_workflows:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Activations
      summary: List of workflow names
      description: Returns a list of workflow names
      parameters:
        - name: workflowProjectName
          in: query
          description: Workflow Project Name to filter
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Succeeded to get workflow names
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetWorkflowsJsonApiResult'
        '400':
          $ref: '#/components/responses/JsonApiBadRequest'
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
  /entities/predictive_segments/{id}:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve predictive scording model by ID
      description: Retrieve a predictive scording model by ID.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a predictive segment by ID
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentJsonApiResponse
    patch:
      tags:
        - Predictive Segments
      summary: Update predictive scoring model
      description: Update a predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Predictive segment to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: >-
                #/components/schemas/EntitiesPredictiveSegmentUpdateRepresentation
      responses:
        '200':
          description: Update a predictive segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentJsonApiResponse
    delete:
      tags:
        - Predictive Segments
      summary: Delete predictive scoring model
      description: Delete a predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Delete a predictive segment
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Delete a predictive segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentJsonApiResponse
  /entities/predictive_segments/{id}/run:
    x-external: true
    post:
      tags:
        - Predictive Segments
      summary: Run predictive scoring model
      description: Run a predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to run the Predictive Segment
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentExecutionJsonApiResponse
  /entities/predictive_segments/{id}/executions:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve executions of predictive scoring model
      description: Retrieve executions of the specified predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to fetch the executions
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentExecutionJsonApiResponse
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
  /entities/predictive_segments/{id}/model/features:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve features of predictive scoring model
      description: >-
        Retrieve the list of features used in the specified predictive scoring
        model.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: >-
            limit of features. With this option, features are sorted by the
            absolute value of weights so that a client can get top features.
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
      responses:
        '200':
          description: Succeeded to fetch the features
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentModelFeaturesJsonApiResult
  /entities/predictive_segments/{id}/model/columns:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve columns of predictive scoring model
      description: Retrieve the columns of the specified predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: limit of columns
          required: false
          schema:
            type: integer
            format: int64
            minimum: 1
      responses:
        '200':
          description: Succeeded to fetch the columns
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentModelColumnsJsonApiResult
  /entities/predictive_segments/{id}/model/score:
    x-external: true
    get:
      tags:
        - Predictive Segments
      summary: Retrieve scores of predictive scoring model
      description: Retrieve the scores of the specified predictive scoring model.
      parameters:
        - name: id
          in: path
          description: Predictive Segment ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Succeeded to fetch the scores
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetPredictiveSegmentModelScoresJsonApiResult
  /entities/tokens:
    x-external: true
    post:
      tags:
        - Tokens
      summary: Create Profiles API token
      description: Create a Profiles API token.
      requestBody:
        description: parameters to create a Token
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesTokenUpdateRepresentation'
        required: true
      responses:
        '200':
          description: Succeeded to create a Token
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetTokenJsonApiResponse'
  /entities/tokens/{id}:
    x-external: true
    get:
      tags:
        - Tokens
      summary: Retrieve Profiles API token by ID
      description: Retrieve the specified Profiles API token.
      parameters:
        - name: id
          in: path
          description: Token ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a token by ID
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetTokenJsonApiResponse'
    patch:
      tags:
        - Tokens
      summary: Update Profiles API token
      description: Update a Profiles API token.
      parameters:
        - name: id
          in: path
          description: Token to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/EntitiesTokenUpdateRepresentation'
      responses:
        '200':
          description: Update a token
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetTokenJsonApiResponse'
    delete:
      tags:
        - Tokens
      summary: Delete Profiles API token
      description: Delete the specified Profiles API token.
      parameters:
        - name: id
          in: path
          description: Delete a token
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Delete a token
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetTokenJsonApiResponse'
  /entities/journeys:
    x-external: true
    get:
      tags:
        - Journeys
      summary: List journeys
      description: List journeys under the specified folder.
      parameters:
        - name: folderId
          in: query
          description: Folder ID specifying the folder where journeys are listed
          required: true
          schema:
            type: integer
            format: int64
        - name: permission
          in: query
          description: Permission to filter
          required: false
          schema:
            type: string
            enum:
              - view
              - edit
      responses:
        '200':
          description: Returns the list of the journeys
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesIndexJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Journeys
      summary: Create journey
      description: Create a journey.
      requestBody:
        description: parameters to create a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve summary of specified journey
      description: Retrieve the summary of a specified journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Journeys
      summary: Update journey entity
      description: Update a journey entity.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a summary of the updated journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Journeys
      summary: Delete journey entity
      description: Delete a journey entity.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Empty if deletion is successful
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/detail:
    x-external: true
    post:
      tags:
        - Journeys
      summary: Update meta field
      description: Update the meta field of the journey in draft.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: parameters to validate a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyDetailJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/available_behaviors_for_step:
    x-external: true
    post:
      tags:
        - Journeys
      summary: Retrieve a list of available behavior table of specified step
      description: Retrieve a list of available behavior table of specified step.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
        - name: stepId
          in: query
          schema:
            type: string
            format: uuid
      requestBody:
        description: parameters to retrieve a list of available behavior table
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a list of available behavior table of specified journey
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesAudienceBehaviorIndexJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/activation_templates_for_step:
    x-external: true
    post:
      tags:
        - Journeys
      summary: Retrieve a list of journey activation templates of specified step
      description: Retrieve a list of journey activation templates of specified step.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
        - name: stepId
          in: query
          schema:
            type: string
            format: uuid
      requestBody:
        description: parameters to retrieve a list of available behavior table
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a list of available behavior table of specified journey
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesActivationTemplateIndexJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/duplicate:
    x-external: true
    post:
      tags:
        - Journeys
      summary: Create a duplicate of the specified journey
      description: Create a duplicate of the specified journey
      requestBody:
        description: parameters to duplicate a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyDuplicateJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/statistics:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve journey statistics
      description: Retrieve the specified journey statistics.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the statistical summary of the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyStatisticsJsonApiResponse
        '403':
          $ref: '#/components/responses/NonJsonApiForbiddenRequest'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/conversion_sankey_charts:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve the list of conversion sankey chart source data
      description: Retrieve the list of conversion sankey chart source data
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Retrieve the list of conversion sankey chart source data
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyConversionSankeyChartsJsonApiResponse
        '403':
          $ref: '#/components/responses/NonJsonApiForbiddenRequest'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/activation_sankey_charts:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve the list of activation sankey chart source data
      description: Retrieve the list of activation sankey chart source data
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Retrieve the list of conversion sankey chart source data
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyActivationSankeyChartsJsonApiResponse
        '403':
          $ref: '#/components/responses/NonJsonApiForbiddenRequest'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/customers:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve list of profiles in journey
      description: Retrieve a list of profiles in a journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of profiles in the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyCustomersJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/segment_rules:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve list of segment rules available in audience
      description: >-
        Retrieve a list of segment rules available in an audience. It returns
        the viewable journeys only.
      parameters:
        - name: audience_id
          in: query
          description: Audience the journey belongs to
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of segment rules available in the audience
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneySegmentRulesJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/activations:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve list of journey activations in journey
      description: Retrieve a list of journey activations for the specified journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of journey activation step in the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesListJourneyActivationStepJsonApiResponse
    post:
      tags:
        - Journeys
      summary: Create an activation step in journey
      description: Create an activation step in a journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: parameters to configure the journey activation step
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JourneyActivationStepJsonApiResource'
      responses:
        '200':
          description: Returns a summary of the activation step in the journey
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyActivationStepJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/activations/{journeyActivationStepId}:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve summary of activation node in journey
      description: Retrieve a summary of the activation node in a journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
        - name: journeyActivationStepId
          in: path
          description: JourneyActivationStep ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a summary of the activation node in the journey
          content:
            application/vnd.treasuredata.v1+json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyActivationStepJsonApiResponse
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Journeys
      summary: Update the configuration of the activation step in journey
      description: Update the configuration of the activation step in journey.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
        - name: journeyActivationStepId
          in: path
          description: JourneyActivationStep ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: parameters to edit the journey activation step
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: '#/components/schemas/JourneyActivationStepJsonApiResource'
      responses:
        '200':
          description: Returns a summary of the activation node in the journey
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetJourneyActivationStepJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/pause:
    x-external: true
    patch:
      tags:
        - Journeys
      summary: Pause journey and associated activations schedules.
      description: Pause journey and associated activations schedules.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/resume:
    x-external: true
    patch:
      tags:
        - Journeys
      summary: Resume journey and associated activations schedules.
      description: Resume journey and associated activations schedules.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journeys/{journeyId}/journey_stages/{journeyStageId}/customers:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Retrieve list of profiles in the journey stage
      description: Retrieve a list of profiles in a journey stage.
      parameters:
        - name: journeyId
          in: path
          description: Journey ID
          required: true
          schema:
            type: integer
            format: int64
        - name: journeyStageId
          in: path
          description: Journey stage ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of profiles in the journey stage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneyProfilesJsonApiResource'
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Return the journey bundle information
      description: >-
        Return the journey bundle information which contains the list of journey
        versions
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of the journeys
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleJsonApiResponse
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Journeys
      summary: Update the metadata of the journey bundle
      description: >
        Update the editable journey bundle information. The following fields are
        editable with this API.
          - name
          - description
          - latestJourneyId
        To update the latest journey, the following validation checks the
        validity of the operation.
          - The journey must exist and belong to this journey bundle
          - The journey must be launched
        The case when launching new journey as the latest is treated by the POST
        journey endpoint with the 

        journeyBundleId.
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: parameters to edit the name and description of the journey bundle
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleUpdateRepresentation
        required: true
      responses:
        '200':
          description: Returns the list of the journeys
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleJsonApiResponse
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Journeys
      summary: Delete the journey bundle
      description: Delete the journey bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Empty if deletion is successful
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleDestroyJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/latest:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Returns the latest journey in the bundle
      description: Returns the latest journey in the bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the latest journey in the bundle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/statistics:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Return the list of statistics of jouney under the bundle
      description: Return the statistics under the journey bundle.
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of the journey statistics
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleStatisticsJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/conversion_sankey_charts:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Return the list of conversion sankey charts of journey under the bundle
      description: Return the list of conversion sankey charts of journey under the bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of the journey statistics
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleConversionSankeyChartsJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/activation_sankey_charts:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Return the list of activation sankey charts of journey under the bundle
      description: Return the list of activation sankey charts of journey under the bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of the journey statistics
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleActivationSankeyChartsJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/activations:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Returns the list of activations associated with the journey bundle
      description: Returns the list of activations associated with the journey bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns the list of activations associated with the journey bundle
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleActivationsJsonApiResponse
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/journeys:
    x-external: true
    post:
      tags:
        - Journeys
      summary: Create the new journey under the bundle with copying the latest journey
      description: >-
        Return the journey bundle information which contains the list of journey
        versions
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: parameters to specify the source journey copy from
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/partial_journey.yaml-JourneyBundleNewJourneyAttributes
      responses:
        '200':
          description: Returns the journey
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EntitiesGetJourneyJsonApiResponse'
      security:
        - TdApikeyAuth: []
  /entities/journey_bundles/{journeyBundleId}/journeys_appendable:
    x-external: true
    get:
      tags:
        - Journeys
      summary: Validate the journey can be appended to the bundle
      description: Validate the journey can be appended to the bundle
      parameters:
        - name: journeyBundleId
          in: path
          description: Journey Bundle ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: New journey can be appendable
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleNewJourneyAppendableJsonApiResponse
        '400':
          description: New journey can not be appendable
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_journey.yaml-EntitiesJourneyBundleNewJourneyNotAppendableJsonApiResponse
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_setting:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    get:
      tags:
        - Realtime Journeys
      summary: Get realtime setting for the Audience
      description: Get realtime setting for the Audience
      responses:
        '200':
          description: Returns the realtime setting for the Audience
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeSetting
    patch:
      tags:
        - Realtime Journeys
      summary: Update realtime setting for the Audience
      description: Update realtime setting for the Audience
      requestBody:
        description: parameters to edit the realtime setting
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeSettingAttributes
        required: true
      responses:
        '200':
          description: Returns the realtime setting for the Audience
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeSetting
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_attributes:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    get:
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-SortedBy'
        - $ref: '#/components/parameters/NameInclude'
        - name: types
          in: query
          required: false
          description: filter by the resource's type
          schema:
            type: string
            description: comma separated types like "types=single,imported"
      tags:
        - Realtime Journeys
      summary: Return a list of Realtime Attributes for the Audience
      description: Return a list of Realtime Attributes for the Audience
      responses:
        '200':
          description: A list of Realtime Attributes for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          allOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                            - $ref: >-
                                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeAttributes
    post:
      tags:
        - Realtime Journeys
      summary: Create a Realtime Attribute
      description: Create a Realtime Attribute
      responses:
        '200':
          description: Create a Realtime Attribute
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      data:
                        allOf:
                          - type: object
                            properties:
                              id:
                                type: string
                          - $ref: >-
                              #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeAttributes
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeAttributes
                - type: object
                  properties:
                    name:
                      type: string
                    identifier:
                      type: string
                    description:
                      type: string
                      nullable: true
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_attributes/{realtimeAttributeId}:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - name: realtimeAttributeId
        in: path
        description: Realtime Attribute ID
        required: true
        schema:
          type: integer
          format: int64
    get:
      tags:
        - Realtime Journeys
      summary: Return the Realtime Attribute
      description: Return the Realtime Attribute
      responses:
        '200':
          description: Return the Realtime Attribute
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeAttributes
    patch:
      tags:
        - Realtime Journeys
      summary: Update the Realtime Attribute
      description: Update the Realtime Attribute
      responses:
        '200':
          description: Update the Realtime Attribute
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeAttributes
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                      nullable: true
                    duration:
                      $ref: >-
                        #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
                    fields:
                      $ref: >-
                        #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeFields
                    maxItems:
                      type: number
                      format: int64
                    actions:
                      $ref: >-
                        #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeActions
                    aggregations:
                      $ref: >-
                        #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeAggregations
                    subDurations:
                      type: array
                      items:
                        $ref: >-
                          #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
    delete:
      tags:
        - Realtime Journeys
      summary: Delete the Realtime Attribute
      description: Delete the Realtime Attribute
      responses:
        '200':
          description: Delete the Realtime Attribute
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_imported_attributes/bulk_update:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    post:
      tags:
        - Realtime Journeys
      summary: Bulk update imported attributes
      description: Bulk update imported attributes
      responses:
        '200':
          description: Bulk update imported attributes
          content:
            application/json:
              schema:
                type: object
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                columns:
                  type: array
                  items:
                    type: string
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_key_events:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    get:
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-SortedBy'
        - $ref: '#/components/parameters/NameInclude'
      tags:
        - Realtime Journeys
      summary: Return a list of Realtime Key Events for the Audience
      description: Return a list of Realtime Key Events for the Audience
      responses:
        '200':
          description: A list of Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          allOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                            - $ref: >-
                                #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Realtime Journeys
      summary: Create a Realtime Key Event for the Audience
      description: Create a Realtime Key Event for the Audience
      requestBody:
        description: parameters to create a realtime key event
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
        required: true
      responses:
        '200':
          description: A Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_key_events/{realtimeKeyEventId}:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeKeyEventId
    get:
      tags:
        - Realtime Journeys
      summary: Return the specified Realtime Key Event
      description: Return the specified Realtime Key Event
      responses:
        '200':
          description: The specified Realtime Key Event
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Realtime Journeys
      summary: Edit the specified Realtime Key Event
      description: Edit the specified Realtime Key Event
      requestBody:
        description: parameters to edit the realtime key event
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
        required: true
      responses:
        '200':
          description: A Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Realtime Journeys
      summary: Delete the specified Realtime Key Event
      description: Delete the specified Realtime Key Event
      responses:
        '200':
          description: A Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventAttributes
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_key_events/{realtimeKeyEventId}/columns:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeKeyEventId
    get:
      tags:
        - Realtime Journeys
      summary: Return a list of columns of the specified Realtime Key Event
      description: Return a list of columns of the specified Realtime Key Event
      responses:
        '200':
          description: A list of columns of the specified Realtime Key Event
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyEventColumn
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_personalization_services:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    get:
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-SortedBy'
        - $ref: '#/components/parameters/NameInclude'
      tags:
        - Realtime Personalization
      summary: Return a list of Realtime Personalization Services for the Audience
      description: Return a list of Realtime Personalization Services for the Audience
      responses:
        '200':
          description: A list of Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          allOf:
                            - type: object
                              properties:
                                id:
                                  type: string
                              required:
                                - id
                              additionalProperties: false
                            - $ref: >-
                                #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes
                            - $ref: >-
                                #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Realtime Personalization
      summary: Create a Realtime Personalization Service for the Audience
      description: Create a Realtime Personalization Service for the Audience
      requestBody:
        description: parameters to create a realtime personalization service
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  nullable: false
                description:
                  type: string
                  nullable: true
                public:
                  type: boolean
                  default: false
              required:
                - name
              additionalProperties: false
        required: true
      responses:
        '200':
          description: A Realtime Personalization Service for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_personalization_services/{realtimePersonalizationServiceId}:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimePersonalizationServiceId
    get:
      tags:
        - Realtime Personalization
      summary: Return the specified Realtime Personalization Service
      description: Return the specified Realtime Personalization Service
      responses:
        '200':
          description: The specified Realtime Personalization Service
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Realtime Personalization
      summary: Edit the specified Realtime Personalization Service
      description: Edit the specified Realtime Personalization Service
      requestBody:
        description: parameters to edit the realtime personalization service
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  nullable: false
                description:
                  type: string
                  nullable: true
              required:
                - name
              additionalProperties: false
        required: true
      responses:
        '200':
          description: A Realtime Key Events for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Realtime Personalization
      summary: Delete the specified Realtime Personalization Service
      description: Delete the specified Realtime Personalization Service
      responses:
        '200':
          description: A Realtime Personalization Service for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_personalization_services/{realtimePersonalizationServiceId}/tokens:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimePersonalizationServiceId
    post:
      tags:
        - Realtime Personalization
      summary: Create a new Personalization Token
      description: Create a new Personalization Token
      requestBody:
        description: parameters to create a personalization service token
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                allowedIps:
                  type: array
                  items:
                    type: string
                  minLength: 0
                description:
                  type: string
                  nullable: true
              required:
                - name
              additionalProperties: false
      responses:
        '200':
          description: The created Token
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceTokenAttributes
      security:
        - TdApikeyAuth: []
  /audiences/{audienceId}/realtime_personalization_services/{realtimePersonalizationServiceId}/tokens/{tokenId}:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimePersonalizationServiceId
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimePersonalizationTokenId
    delete:
      tags:
        - Realtime Personalization
      summary: Delete the specified Realtime Personalization Token
      description: Delete the specified Realtime Personalization Token
      responses:
        '200':
          description: A Realtime Personalization Token for the Audience
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      id:
                        type: string
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceTokenAttributes
  /audiences/{audienceId}/realtime_configuration_versions/current:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/AudienceId'
    get:
      tags:
        - Realtime Journeys
      summary: Return the current version for the Audience
      description: Return the current version for the Audience
      responses:
        '200':
          description: The current version
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  audienceId:
                    type: string
                  status:
                    type: string
                    enum:
                      - queueing
                      - queued
                      - finished
                  eventKind:
                    type: string
                  identifier:
                    type: string
                nullable: true
      security:
        - TdApikeyAuth: []
  /entities/parent_segments/{parentSegmentId}/realtime_attributes:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Realtime Journeys
      summary: List available realtime attributes
      description: List available realtime attributes
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - $ref: '#/components/parameters/partial_pagination.yaml-SortedBy'
        - name: types
          in: query
          required: false
          description: filter by the resource's type
          schema:
            type: string
            description: comma separated types like "types=single,imported"
        - name: q
          in: query
          required: false
          schema:
            type: string
            description: >-
              Returns resources whose name or any of whose sub attribute names
              match the value.
      responses:
        '200':
          description: Returns a list of available realtime attributes
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                              enum:
                                - realtime-attribute
                            attributes:
                              $ref: >-
                                #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeAttributeAttributes
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys:
    x-external: true
    post:
      tags:
        - Realtime Journeys
      summary: Create a realtime journey
      description: Create a realtime journey.
      requestBody:
        description: parameters to create a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              required:
                - attributes
                - relationships
              properties:
                attributes:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyAttributes
        required: true
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
    get:
      tags:
        - Realtime Journeys
      summary: Retrieve summary of specified realtime journey
      description: Retrieve the summary of a specified realtime journey.
      responses:
        '200':
          description: Returns a summary of the realtime journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Realtime Journeys
      summary: Update realtime journey entity
      description: Update a realtime journey entity.
      responses:
        '200':
          description: Returns a summary of the updated journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Realtime Journeys
      summary: Delete realtime journey entity
      description: Delete a realtime journey entity.
      responses:
        '200':
          description: Empty if deletion is successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}/detail:
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
    x-external: true
    post:
      tags:
        - Realtime Journeys
      summary: Validate fields of the realtime journey
      description: Validate fields of the realtime journey
      requestBody:
        description: parameters to validate
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              properties:
                attributes:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyDetailAttributes
        required: true
      responses:
        '200':
          description: Returns a summary of the realtime journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/parent_segments/{parentSegmentId}/realtime_journeys:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Realtime Journeys
      summary: Retrieve a list of realtime journeys under the Parent Segment
      description: Retrieve a list of realtime journeys under the Parent Segment
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - name: permissions
          in: query
          description: filter by the resource's permission. Default to 'view'
          required: false
          schema:
            type: string
            enum:
              - edit
              - view
      responses:
        '200':
          description: Returns a list of realtime journeys under the Parent Segment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: >-
                            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/parent_segments/{parentSegmentId}/realtime_activations:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Realtime Journeys
      summary: Retrieve a list of realtime activations under the Parent Segment
      description: Retrieve a list of realtime activations under the Parent Segment
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
      responses:
        '200':
          description: Returns a list of realtime activations under the Parent Segment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: >-
                            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}/activations:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
    get:
      tags:
        - Realtime Journeys
      summary: >-
        Retrieve a list of realtime journey activations for the specified
        realtime journey.
      description: >-
        Retrieve a list of realtime journey activations for the specified
        realtime journey.
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
      responses:
        '200':
          description: >-
            Returns the list of realtime journey activations for the specified
            realtime journey.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: >-
                            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
      security:
        - TdApikeyAuth: []
    post:
      tags:
        - Realtime Journeys
      summary: >-
        Create a realtime journey activations for the specified realtime
        journey.
      description: >-
        Create a realtime journey activations for the specified realtime
        journey.
      requestBody:
        description: parameters to create a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              properties:
                attributes:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepAttributes
              required:
                - attributes
              additionalProperties: false
      responses:
        '200':
          description: >-
            Returns the list of realtime journey activations for the specified
            realtime journey.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}/activations/{realtimeJourneyActivationStepId}:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyActivationStepId
    get:
      tags:
        - Realtime Journeys
      summary: Retrieve a summary of the activation node in a realtime journey.
      description: Retrieve a summary of the activation node in a realtime journey.
      responses:
        '200':
          description: Returns a summary of the activation node in the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
      security:
        - TdApikeyAuth: []
    patch:
      tags:
        - Realtime Journeys
      summary: Update activation node in journey
      description: Update the activation node in a journey.
      requestBody:
        description: parameters to create a journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              properties:
                attributes:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepAttributes
              required:
                - attributes
              additionalProperties: false
      responses:
        '200':
          description: Returns a summary of the activation node in the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}/pause:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
    patch:
      tags:
        - Realtime Journeys
      summary: Pause activations in the realtime journey.
      description: Pause activations in the realtime journey.
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/{realtimeJourneyId}/resume:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimeJourneyId
    patch:
      tags:
        - Realtime Journeys
      summary: Resume activations in the realtime journey.
      description: Resume activations in the realtime journey.
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_journeys/duplicate:
    x-external: true
    post:
      tags:
        - Realtime Journeys
      summary: Create a duplicate of the specified realtime journey
      description: Create a duplicate of the specified realtime journey
      requestBody:
        description: parameters to duplicate a realtime journey
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyDuplicateJsonApiResource
        required: true
      responses:
        '200':
          description: Returns a summary of the journey
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_personalizations:
    x-external: true
    post:
      tags:
        - Realtime Personalization
      summary: Create a realtime personalization
      description: Create a realtime personalization.
      requestBody:
        description: parameters to create a realtime personalization
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              required:
                - attributes
              properties:
                attributes:
                  type: object
                  required:
                    - name
                    - description
                  properties:
                    audienceId:
                      type: string
                      pattern: '[1-9][0-9]*'
                    name:
                      type: string
                    description:
                      type: string
                      nullable: true
                    sections:
                      type: array
                      items:
                        $ref: >-
                          #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationSectionAttributes
                  additionalProperties: false
                relationships:
                  type: object
                  properties:
                    parentFolder:
                      $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
        required: true
      responses:
        '200':
          description: Returns a realtime personalization
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationResource
      security:
        - TdApikeyAuth: []
  /entities/realtime_personalizations/{realtimePersonalizationId}:
    x-external: true
    parameters:
      - $ref: >-
          #/components/parameters/partial_realtime_journey.yaml-RealtimePersonalizationId
    get:
      tags:
        - Realtime Personalization
      summary: Get a realtime personalization
      description: Get a realtime personalization.
      responses:
        '200':
          description: Returns a realtime personalization
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationResource
    patch:
      tags:
        - Realtime Personalization
      summary: Update a realtime personalization
      description: Update a realtime personalization.
      requestBody:
        description: parameters to update a realtime personalization
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              type: object
              required:
                - attributes
              properties:
                attributes:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationAttributes
        required: true
      responses:
        '200':
          description: Returns a realtime personalization
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationResource
      security:
        - TdApikeyAuth: []
    delete:
      tags:
        - Realtime Personalization
      summary: Delete realtime personalization entity
      description: Delete a realtime personalization entity.
      responses:
        '200':
          description: Empty if deletion is successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
      security:
        - TdApikeyAuth: []
  /entities/parent_segments/{parentSegmentId}/realtime_personalizations:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
    get:
      tags:
        - Realtime Personalization
      summary: Retrieve a list of realtime personalizations under the Parent Segment
      description: Retrieve a list of realtime personalizations under the Parent Segment
      parameters:
        - $ref: '#/components/parameters/partial_pagination.yaml-PageSize'
        - $ref: '#/components/parameters/partial_pagination.yaml-PageAfter'
        - name: permissions
          in: query
          description: filter by the resource's permission. Default to 'view'
          required: false
          schema:
            type: string
            enum:
              - edit
              - view
      responses:
        '200':
          description: Returns a list of realtime personalizations under the Parent Segment
          content:
            application/json:
              schema:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_pagination.yaml-PaginatedResponse
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: >-
                            #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationResource
      security:
        - TdApikeyAuth: []
  /entities/activation_templates:
    x-external: true
    post:
      tags:
        - Activation Templates
      summary: Create an Activation Template
      operationId: activation_templates#create
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: >-
                #/components/schemas/EntitiesActivationTemplateUpdateRepresentation
      responses:
        '200':
          description: Created Activation Template
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetActivationTemplateJsonApiResponse
        '400':
          $ref: '#/components/responses/JsonApiBadRequest'
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
  /entities/activation_templates/{id}:
    x-external: true
    get:
      tags:
        - Activation Templates
      summary: Get an Activation Template
      operationId: activation_templates#show
      parameters:
        - name: id
          in: path
          description: Activation Template ID
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Returns an activation template by ID
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetActivationTemplateJsonApiResponse
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
    patch:
      tags:
        - Activation Templates
      summary: Update an Activation Template
      operationId: activation_templates#update
      parameters:
        - name: id
          in: path
          description: Activation Template to update
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/vnd.treasuredata.v1+json:
            schema:
              $ref: >-
                #/components/schemas/EntitiesActivationTemplateUpdateRepresentation
      responses:
        '200':
          description: Updated Activation Template
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetActivationTemplateJsonApiResponse
        '400':
          $ref: '#/components/responses/JsonApiBadRequest'
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        '422':
          $ref: '#/components/responses/JsonApiUnprocessableRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
    delete:
      tags:
        - Activation Templates
      summary: Delete an Activation Template
      operationId: activation_templates#delete
      parameters:
        - name: id
          in: path
          description: Activation Template to delete
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Deleted Activation Template
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesGetActivationTemplateJsonApiResponse
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        '409':
          $ref: '#/components/responses/JsonApiConflictRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
  /entities/parent_segments/{parentSegmentId}/activation_templates:
    x-external: true
    parameters:
      - $ref: '#/components/parameters/ParentSegmentId'
      - name: availableBySegmentId
        in: query
        description: Segment ID to detect template availability
        required: false
        schema:
          type: integer
          format: int64
      - name: kind
        in: query
        description: >-
          If kind is specified, returns Activations Templates have same one
          only.
        required: false
        schema:
          type: integer
    get:
      tags:
        - Activation Templates
      summary: Returns list of Activation Templates by an audience (parent segment)
      responses:
        '200':
          description: Returns a list of Activation Templates.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/EntitiesActivationTemplateIndexJsonApiResponse
        '403':
          $ref: '#/components/responses/JsonApiForbiddenRequest'
        '404':
          $ref: '#/components/responses/JsonApiNotFoundRequest'
        5XX:
          $ref: '#/components/responses/ServerError'
components:
  responses:
    BadRequest:
      description: Given parameters are not valid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        Unauthorized; You don't provide valid credentials. Maybe you didn't
        specify valid TD's Master API Key as 'TD1 {Your TD Master API Key}'.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        Requested resource or action is not allowed because you don't have
        sufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ClientError:
      description: >-
        There is a high possibility of error of the authentication system.
        Please check the contents and authority of the key. Please contact the
        TD support team if you do not resolve it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: >-
        System error. Because there is a possibility of a temporary error due to
        network trouble and so on, we recommend several times retry on request
        side. Please contact the TD support team if you do not resolve it.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                format: int64
                description: Error status
              error:
                type: string
                description: Error message
              details:
                type: string
                description: Detailed error message
            required:
              - status
              - error
    JsonApiBadRequest:
      description: Given parameters are not valid
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/JsonApiBadParameterError'
                    - $ref: '#/components/schemas/JsonApiMaskedValueError'
                    - $ref: '#/components/schemas/JsonApiValidationError'
            required:
              - errors
    JsonApiForbiddenRequest:
      description: >-
        Requested resource or action is not allowed because you don't have
        sufficient permissions
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/JsonApiPermissionError'
            required:
              - errors
    JsonApiNotFoundRequest:
      description: The specified resource is not found
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/JsonApiNotFoundError'
            required:
              - errors
    JsonApiConflictRequest:
      description: >-
        The specified resource conflicts; having dependent segments, referencing
        segments, etc.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: object
                description: Error messages. Key name can be vary depends on endpoint.
                properties:
                  id:
                    type: array
                    items:
                      type: string
                      example: 'Segment is referenced by other segments: 123, 345'
                  deletion:
                    type: array
                    items:
                      type: string
                      example: 'SegmentFolder has segments: 123, 456'
              referencedBySegments:
                type: array
                description: This field exists only for segment deletion
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      pattern: '[1-9][0-9]*'
                      description: Other Segment ID referencing this segment
              referencedByPredictiveSegments:
                type: array
                description: This field exists only for segment deletion
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      pattern: '[1-9][0-9]*'
                      description: PredictiveSegment ID referencing this segment
            required:
              - errors
        application/vnd.treasuredata.v1+json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/JsonApiConflictError'
            required:
              - errors
    JsonApiUnprocessableRequest:
      description: The specified resource has unprocessable entities
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  $ref: '#/components/schemas/JsonApiUnprocessableEntityError'
            required:
              - errors
    NonJsonApiForbiddenRequest:
      description: >-
        non-JSON:API formatted error for insufficient permission to access a
        resource
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: string
            required:
              - errors
    partial_tree.yaml-GetTreeSegmentFoldersIndexResponse:
      description: >-
        Return all the folders under the Parent Segment. The order is determined
        by depth and name. But top-level folder may not be the first because
        deeper folder can be top-level due to permission.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/partial_pagination.yaml-PaginatedResponse'
              - type: object
                additionalProperties: false
                properties:
                  data:
                    type: array
                    description: >-
                      if the length is less than page[size], it means the last
                      page.
                    minLength: 0
                    items:
                      $ref: >-
                        #/components/schemas/partial_tree.yaml-TreeSegmentFolderIndexItem
  schemas:
    NullValue:
      nullable: true
      type: object
      additionalProperties: false
      properties:
        thisKeyNeverHit:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
    GenericError:
      type: object
      properties:
        errors:
          type: string
      required:
        - errors
    JsonApiValidationError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - validation-error
        status:
          type: string
          description: Status code for error
          enum:
            - '400'
        detail:
          type: string
          description: Detailed error message
          example: Name has already been taken
        source:
          type: object
          properties:
            pointer:
              type: string
              description: Pointer to invalid model attribute
              example: /attributes/id
          required:
            - pointer
        meta:
          type: object
          properties:
            validationCode:
              type: string
              description: Detailed validation error code
              enum:
                - VIOLATES_UNIQUENESS_CONSTRAINT
                - IS_TOO_SHORT
                - IS_TOO_LONG
                - CANNOT_BE_BLANK
                - INVALID_FORMAT_OR_ASSOCIATION
                - COMPOSITE_CONDITION_TOO_FEW_RULES_REFERENCED
                - COMPOSITE_CONDITION_TOO_FEW_RULE_SETS_REFERENCED
                - COMPOSITE_CONDITION_MISSING_RULE_IDENTIFIER
                - COMPOSITE_CONDITION_SYNTAX_ERROR
                - COMPOSITE_CONDITION_TOO_LONG_ALPHABETICAL_IDENTIFIER
                - COMPOSITE_CONDITION_TOO_LONG_NUMERICAL_IDENTIFIER
                - PREDICTIVE_SEGMENT_NOT_YET_SCORED
                - PREDICTIVE_SEGMENT_NOT_YET_TRAINED
                - IS_IMMUTABLE
                - UNKNOWN
                - TOO_MANY_BEHAVIOR_RULES
                - INVALID_WINDOW_DURATION
                - UNDEFINED_ENTRY_CRITERIA
                - UNDEFINED_MILESTONE
                - UNDEFINED_ACTIVATION_STEP
                - UNDEFINED_WAIT_STEP
                - UNDEFINED_EXIT_CRITERIA
                - UNDEFINED_DECISION_CONDITION
                - UNDEFINED_MERGE_POINT
                - UNUSED_IN_ID_LINK
                - TOO_MANY_PRIMARY_KNOWN_IDS
                - TOO_LESS_PRIMARY_KNOWN_IDS
                - TOO_MANY_RT_SEGMENTS
          required:
            - validationCode
      required:
        - code
        - status
        - detail
        - source
        - meta
    JsonApiBadParameterError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - bad-parameter-error
        status:
          type: string
          description: Status code for error
          enum:
            - '400'
        detail:
          type: string
          description: Detailed error message
          example: SegmentFolder View Permission Required
        source:
          type: object
          properties:
            pointer:
              type: string
              description: Pointer to invalid parameter
              example: /attributes/segments/
          required:
            - pointer
        meta:
          type: object
          properties:
            parameterCode:
              type: string
              description: Detailed validation error code
              enum:
                - SHOULD_BE_ARRAY
                - INVALID_FORMAT
          required:
            - parameterCode
      required:
        - code
        - status
        - detail
    JsonApiMaskedValueError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - bad-parameter-error
        status:
          type: string
          description: Status code for error
          enum:
            - 400
        detail:
          type: string
          description: Detailed error message
          example: masked value is used
        source:
          type: object
          properties:
            pointer:
              type: string
              description: Pointer to invalid parameter
              example: /attributes/syndication/columns/0
          required:
            - pointer
        meta:
          type: object
          properties:
            parameterCode:
              type: string
              description: Detailed validation error code
              enum:
                - MASKED_VALUE_IS_USED
          required:
            - parameterCode
      required:
        - code
        - status
        - detail
        - source
        - meta
    JsonApiPermissionError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - permission-error
        status:
          type: string
          description: Status code for error
          enum:
            - '403'
        detail:
          type: string
          description: Detailed error message
          example: SegmentFolder View Permission Required
        meta:
          type: object
          description: >-
            Meta info for storing permissionCode. Note that in some cases, meta
            can be null.
          properties:
            permissionCode:
              type: string
              description: Detailed validation error code
              enum:
                - SEGMENT_FOLDER_VIEW_REQUIRED
                - SEGMENT_FOLDER_EDIT_REQUIRED
          required:
            - permissionCode
      required:
        - code
        - status
        - detail
    JsonApiNotFoundError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - record-not-found-error
        status:
          type: string
          enum:
            - '404'
        detail:
          type: string
          description: Detailed error message
          example: Record not found
      required:
        - code
        - status
        - detail
    JsonApiConflictError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - conflict-error
        status:
          type: string
          enum:
            - 409
        detail:
          type: string
          description: Detailed error message
          example: Deletion SegmentFolder has segments
        meta:
          type: object
          description: >-
            Meta information to store conflicting ids. These fields exist only
            for segment deletion.
          properties:
            referencedByPredictiveSegments:
              type: array
              items:
                type: string
                description: Id of referenced Predictive Segment
            referencedBySegments:
              type: array
              items:
                type: string
                description: Id of referenced Segment
      required:
        - code
        - status
        - detail
    JsonApiUnprocessableEntityError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - unprocessable-entity-error
        status:
          type: string
          enum:
            - '422'
        meta:
          type: object
          nullable: true
          properties:
            unprocessableEntityCode:
              type: string
              description: Detailed error code
              enum:
                - CANNOT_MOVE
                - CANNOT_BE_JSONAPI
        detail:
          type: string
          description: Detailed error message
          example: parent_folder id parameter is required
      required:
        - code
        - status
        - detail
    JsonApiGenericError:
      type: object
      properties:
        code:
          type: string
          description: Error code in string
          enum:
            - record-not-found-error
        status:
          type: string
          description: status code of error
          example: '400'
        detail:
          type: string
          description: Detailed error message
          example: Record not found
      required:
        - code
        - status
        - detail
    AudienceMasterAttribute:
      description: >-
        Attribute of master table, not attribute tables. Similar to
        AudienceAttribute but some properties are null
      required:
        - name
        - type
        - parentColumn
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: >-
            Column name user defined on Master Segment Configuration page of
            Data Workbench
        type:
          $ref: '#/components/schemas/ColumnType'
        parentDatabaseName:
          type: string
          description: Database name of the attribute table
        parentTableName:
          type: string
          description: Table name of the attribute table
        parentColumn:
          type: string
          description: >-
            Column name of the attribute table which is imported into customer
            table
        parentKey:
          type: string
          description: Join key of the attribute table
        foreignKey:
          type: string
          description: Foreign key of the master table
    AudienceAttribute:
      required:
        - name
        - audienceId
        - type
        - parentDatabaseName
        - parentTableName
        - parentColumn
        - parentKey
        - foreignKey
        - groupingName
      type: object
      properties:
        audienceId:
          type: string
          description: ID of Master Segment for this attribute
        name:
          type: string
          description: >-
            Column name user defined on Master Segment Configuration page of
            Data Workbench
        type:
          $ref: '#/components/schemas/ColumnType'
        parentDatabaseName:
          type: string
          description: Database name of the attribute table
        parentTableName:
          type: string
          description: Table name of the attribute table
        parentColumn:
          type: string
          description: >-
            Column name of the attribute table which is imported into customer
            table
        parentKey:
          type: string
          description: Join key of the attribute table
        foreignKey:
          type: string
          description: Foreign key of the master table
        groupingName:
          type: string
          nullable: true
          description: Group name of the attribute
    ColumnType:
      type: string
      description: Type of the column
      enum:
        - string
        - number
        - timestamp
        - string_array
        - number_array
    AudienceAttributeWithVisibility:
      required:
        - name
        - audienceId
        - type
        - parentDatabaseName
        - parentTableName
        - parentColumn
        - parentKey
        - foreignKey
      type: object
      properties:
        audienceId:
          type: string
          description: ID of Master Segment for this attribute
        id:
          type: string
          nullable: true
          description: This can be null when the attribute is an enriched attribute
        name:
          type: string
          description: >-
            Column name user defined on Master Segment Configuration page of
            Data Workbench
        type:
          $ref: '#/components/schemas/ColumnType'
        parentDatabaseName:
          type: string
          description: Database name of the attribute table
        parentTableName:
          type: string
          description: Table name of the attribute table
        parentColumn:
          type: string
          description: >-
            Column name of the attribute table which is imported into customer
            table
        parentKey:
          type: string
          nullable: true
          description: >-
            Join key of the attribute table (This can be null when the attribute
            is an enriched attribute)
        foreignKey:
          type: string
          nullable: true
          description: >-
            Foreign key of the master table (This can be null when the attribute
            is an enriched attribute)
        matrixColumnName:
          type: string
        usedBySegmentInsight:
          type: boolean
        groupingName:
          type: string
          nullable: true
          description: Group name of the attribute
        visibility:
          type: string
          enum:
            - clear
            - pii
            - non_pii
            - blocked
    AudienceBehavior:
      required:
        - id
        - name
        - parentDatabaseName
        - parentTableName
        - parentKey
        - foreignKey
        - schema
      type: object
      properties:
        id:
          type: string
          description: ID of Master Segment Config behavior
        name:
          type: string
          description: >-
            Behavior name user defined on Master Segment Configuration page of
            Data Workbench
        parentDatabaseName:
          type: string
          description: Database name of the behavior table
        parentTableName:
          type: string
          description: Table name of the behavior table
        parentKey:
          type: string
          description: Join key of the behavior table
        foreignKey:
          type: string
          description: Foreign key of the master table
        schema:
          type: array
          description: Columns of behavior
          items:
            $ref: '#/components/schemas/AudienceBehaviorSchema'
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
        scheduleOption:
          type: string
          nullable: true
        defaultTimeFilterEnabled:
          type: boolean
        isRealtime:
          type: boolean
    AudienceBehaviorSchema:
      required:
        - name
        - type
        - parentColumn
      type: object
      properties:
        name:
          type: string
          description: >-
            Column name user defined on Master Segment Configuration page of
            Data Workbench
        type:
          $ref: '#/components/schemas/ColumnType'
        parentColumn:
          type: string
          description: Column name of the behavior table
    AudienceBehaviorWithVisibility:
      required:
        - id
        - name
        - parentDatabaseName
        - parentTableName
        - parentKey
        - foreignKey
        - schema
      type: object
      properties:
        id:
          type: string
          description: ID of Master Segment Config behavior
        name:
          type: string
          description: >-
            Behavior name user defined on Master Segment Configuration page of
            Data Workbench
        parentDatabaseName:
          type: string
          description: Database name of the behavior table
        parentTableName:
          type: string
          description: Table name of the behavior table
        parentKey:
          type: string
          description: Join key of the behavior table
        foreignKey:
          type: string
          description: Foreign key of the master table
        schema:
          type: array
          description: Columns of behavior
          items:
            $ref: '#/components/schemas/AudienceBehaviorSchemaWithVisibility'
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
        scheduleOption:
          type: string
          nullable: true
        defaultTimeFilterEnabled:
          type: boolean
    AudienceCustomers:
      required:
        - names
        - rows
      type: object
      properties:
        names:
          description: Column names
          example:
            - cdp_customer_id
            - email
          type: array
          items:
            type: string
        rows:
          description: Array of profiles
          type: array
          items:
            type: array
            description: a tuple whose values corresponding names property
            example:
              - 003171af29a5f0ac890fed022d9e5366dea5d68e
              - a@example.com
            items:
              anyOf:
                - type: string
                  nullable: true
                - type: integer
                  format: int64
                - type: number
                  format: float
    CustomerGroupBehaviorWithVisibility:
      required:
        - id
        - name
        - parentDatabaseName
        - parentTableName
        - parentKey
        - foreignKey
        - schema
      type: object
      properties:
        id:
          type: string
          description: ID of Master Segment Config behavior
        name:
          type: string
          description: >-
            Behavior name user defined on Master Segment Configuration page of
            Data Workbench
        parentDatabaseName:
          type: string
          description: Database name of the behavior table
        parentTableName:
          type: string
          description: Table name of the behavior table
        parentKey:
          type: string
          description: Join key of the behavior table
        foreignKey:
          type: string
          description: Foreign key of the master table
        schema:
          type: array
          description: Columns of behavior
          items:
            $ref: '#/components/schemas/AudienceBehaviorSchemaWithVisibility'
        defaultTimeFilterEnabled:
          type: boolean
        isRealtime:
          type: boolean
        fromCustomerGroup:
          type: boolean
    AudienceBehaviorSchemaWithVisibility:
      required:
        - name
        - type
        - parentColumn
      type: object
      properties:
        name:
          type: string
          description: >-
            Column name user defined on Master Segment Configuration page of
            Data Workbench
        type:
          $ref: '#/components/schemas/ColumnType'
        parentColumn:
          type: string
          nullable: true
          description: >-
            Column name of the behavior table (This can be null when the column
            is an enriched column)
        matrixColumnName:
          type: string
          description: Column name of the behavior table
        visibility:
          type: string
          enum:
            - clear
            - pii
            - non_pii
            - blocked
    AudienceMaster:
      required:
        - parentDatabaseName
        - parentTableName
      type: object
      properties:
        parentDatabaseName:
          type: string
          description: Source database name of the audience master
        parentTableName:
          type: string
          description: Source table name of the audience master
    AudienceFilter:
      required:
        - columnName
        - rightValues
      type: object
      additionalProperties: false
      nullable: false
      properties:
        columnName:
          type: string
          description: Column name to filter source data
          example: Country
        rightValues:
          type: array
          items:
            type: string
          description: Values of the column to filter source data
          example:
            - Japan
    Audience:
      required:
        - name
      type: object
      description: >-
        An audience handles a Master Segment and a related Master Segment
        Config.
      properties:
        id:
          type: string
          format: integer
        name:
          type: string
        description:
          type: string
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
        scheduleOption:
          type: string
          nullable: true
          example: '00:00'
        timezone:
          type: string
          example: UTC
        matrixUpdatedAt:
          type: string
          nullable: true
          format: datetime
        workflowHiveOnly:
          type: boolean
          description: Whether the workflow mainly use Hive or not. Default is false
        hiveEngineVersion:
          type: string
          description: Hive engine version used in audience workflows
          enum:
            - '0.13'
            - cdpaudience
        hivePoolName:
          type: string
          nullable: true
        prestoPoolName:
          type: string
          nullable: true
        allowActivationBehavior:
          type: boolean
          nullable: true
        maxActivationBehaviorRow:
          type: integer
          nullable: true
          description: |
            Only null is acceptable when allowActivationBehavior is false.
        llmEnabled:
          type: boolean
          nullable: true
          description: >
            llmEnabled indicates whether customer has enabled llm (true or
            false).
        llmState:
          type: string
          enum:
            - enabling
            - enabled
            - disabling
            - disabled
          description: |
            llmState indicates more detailed state including updating.
        population:
          type: integer
          format: int64
          nullable: true
          description: the population of the audience
        enrichmentWordTaggingEnabled:
          type: boolean
        enrichmentIpEnabled:
          type: boolean
        enrichmentTdJsSdkEnabled:
          type: boolean
        master:
          $ref: '#/components/schemas/AudienceMaster'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/AudienceAttribute'
        behaviors:
          type: array
          items:
            $ref: '#/components/schemas/AudienceBehavior'
        customerGroup:
          $ref: '#/components/schemas/CustomerGroup'
        audienceFilters:
          type: array
          maxItems: 2
          items:
            $ref: '#/components/schemas/AudienceFilter'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
    CustomerGroup:
      required:
        - name
        - parentDatabaseName
        - parentTableName
        - parentKey
        - foreignKey
      type: object
      description: A group of customers within an audience
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        audienceId:
          type: integer
        name:
          type: string
          description: group name that is to be used for table name
          pattern: '[A-Za-z_][A-Za-z0-9_ ]*'
        parentDatabaseName:
          type: string
          description: Database name of the customer_group table
        parentTableName:
          type: string
          description: Table name of the customer_group table
        parentKey:
          type: string
          description: Join key of the customer_group table
        foreignKey:
          type: string
          description: Foreign key of the customers table
        customerGroupAttributes:
          type: array
          items:
            $ref: '#/components/schemas/CustomerGroupAttribute'
        customerGroupBehaviors:
          type: array
          items:
            $ref: '#/components/schemas/CustomerGroupBehavior'
    CustomerGroupAttribute:
      required:
        - name
        - type
        - parentDatabaseName
        - parentTableName
        - parentColumn
        - parentKey
        - foreignKey
      type: object
      properties:
        name:
          type: string
          description: Column name
        type:
          $ref: '#/components/schemas/ColumnType'
        parentDatabaseName:
          type: string
          description: Database name of the customer_group attribute table
        parentTableName:
          type: string
          description: Table name of the customer_group attribute table
        parentColumn:
          type: string
          description: >-
            Column name of the customer_group attribute table which is imported
            into customer table
        parentKey:
          type: string
          description: Join key of the customer_group attribute table
        foreignKey:
          type: string
          description: Foreign key of the customer_group table
    CustomerGroupBehavior:
      required:
        - id
        - name
        - parentDatabaseName
        - parentTableName
        - parentKey
        - foreignKey
        - schema
      type: object
      properties:
        name:
          type: string
          description: Behavior name
        parentDatabaseName:
          type: string
          description: Database name of the customer_group behavior table
        parentTableName:
          type: string
          description: Table name of the customer_group behavior table
        parentKey:
          type: string
          description: Join key of the customer_group behavior table
        foreignKey:
          type: string
          description: Foreign key of the customer_group table
        schema:
          type: array
          description: Columns of behavior
          items:
            $ref: '#/components/schemas/CustomerGroupBehaviorSchema'
    CustomerGroupBehaviorSchema:
      required:
        - name
        - type
        - parentColumn
      type: object
      properties:
        name:
          type: string
          description: Column name
        type:
          $ref: '#/components/schemas/ColumnType'
        parentColumn:
          type: string
          description: Column name of the customer_group behavior table
    ExecutionCore:
      type: object
      required:
        - workflowId
        - workflowSessionId
        - createdAt
        - finishedAt
        - status
      properties:
        workflowId:
          type: string
          pattern: '[1-9][0-9]*|0'
        workflowSessionId:
          type: string
          pattern: '[1-9][0-9]*'
        createdAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - success
            - canceled
            - error
            - canceling
            - blocked
            - queued
            - running
    Execution:
      allOf:
        - $ref: '#/components/schemas/ExecutionCore'
        - type: object
          required:
            - workflowAttemptId
          properties:
            workflowAttemptId:
              type: string
              pattern: '[1-9][0-9]*'
    AudienceExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            audienceId:
              type: string
              format: integer
    EmptyCondition:
      type: object
      additionalProperties: false
    AndCondition:
      type: object
      required:
        - type
        - conditions
      properties:
        type:
          type: string
          enum:
            - And
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
    OrCondition:
      type: object
      required:
        - type
        - conditions
      properties:
        type:
          type: string
          enum:
            - Or
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
    CompositeCondition:
      type: object
      required:
        - type
        - conditions
        - expr
      properties:
        type:
          type: string
          enum:
            - Composite
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
        expr:
          type: string
    Operator:
      type: object
    ArrayMatching:
      oneOf:
        - type: string
          enum:
            - any
            - all
        - type: object
          properties:
            atLeast:
              type: number
        - type: object
          properties:
            atMost:
              type: number
        - type: object
          properties:
            exactly:
              type: number
    Value: {}
    ReferenceCondition:
      type: object
      properties:
        type:
          type: string
          enum:
            - FunnelStageReference
            - Reference
            - AbTestVariantReference
            - PredictiveScoreReference
            - MlAttributeReference
    ValueCondition:
      type: object
      properties:
        type:
          type: string
          enum:
            - Value
        leftValue:
          $ref: '#/components/schemas/Value'
        operator:
          $ref: '#/components/schemas/Operator'
        arrayMatching:
          $ref: '#/components/schemas/ArrayMatching'
    Condition:
      oneOf:
        - $ref: '#/components/schemas/AndCondition'
        - $ref: '#/components/schemas/OrCondition'
        - $ref: '#/components/schemas/ValueCondition'
        - $ref: '#/components/schemas/ReferenceCondition'
    ScheduleType:
      type: string
      example: daily
      enum:
        - cron
        - daily
        - hourly
        - minutes_interval
        - monthly
        - none
        - weekly
    DeprecatedScheduleType:
      type: string
      deprecated: true
      description: >-
        Deprecated. Old parameter for setting schedule type. See/Use RepeatUnit
        instead.
      example: daily
      enum:
        - cron
        - daily
        - hourly
        - minutes_interval
        - monthly
        - none
        - weekly
    Columns:
      description: >
        Syndication column detail. Basic syntax is `{"column": "alias_name",
        "source": {...}}`. `source` accepts various definitions. See
        ColumnExpression/StringExpression for details. example value is using
        ColumnExpression without `function` property.
      example:
        - column: alias_name
          source:
            column: real_column_name
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            format: uuid
          column:
            type: string
          source:
            anyOf:
              - $ref: '#/components/schemas/ColumnExpression'
              - $ref: '#/components/schemas/StringExpression'
        required:
          - column
          - source
    StartAt:
      type: string
      format: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$
      nullable: true
      description: >-
        cdp-api will fill some value for old syndications with ScheduleType is
        not NoneType. '%Y-%M-%DT%h:%m:%s' is expected.
    RepeatUnit:
      type: string
      description: Setting an activation repetition cycle such as "day" or "week".
      enum:
        - none
        - minute
        - hour
        - day
        - week
        - month
        - once
    RepeatFrequency:
      type: integer
      description: >
        Setting an activation repeat frequency.

        Currently, it is set only when the repeat unit is "minute". If the
        repeat unit is "minute", the interval is set in minutes.
      default: 1
    RepeatSubFrequency:
      type: array
      description: >
        Parameter for more detailed frequency settings. Values are array of
        integers.

        Currently, this parameter is only valid for repeat unit "week".

        For multiple days of the week, each value should be 1 to 7.

        1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6:
        Saturday, 7: Sunday
      example:
        - 1
        - 5
        - 6
      default: []
      items:
        type: integer
        format: int64
    ColumnExpression:
      type: object
      properties:
        column:
          type: string
        customerGroup:
          type: string
          nullable: true
        functions:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/FunctionExpression'
      required:
        - column
    StringExpression:
      type: object
      properties:
        string:
          type: string
        parameters:
          type: array
          description: Values for the placeholders ($1, $2, $3, ...) in the string
          items:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - String
                  string:
                    type: string
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - Timestamp
                  format:
                    type: string
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - SegmentName
                      - SegmentId
                      - AudienceId
                      - FunnelName
                      - StageName
      required:
        - string
    FunctionExpression:
      oneOf:
        - type: object
          properties:
            function:
              type: string
              enum:
                - +
                - '-'
                - '*'
                - /
            arg:
              type: number
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - replace
            search:
              type: string
            replacement:
              type: string
              nullable: true
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - substr
            start:
              type: number
            length:
              type: number
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - regexp_extract
            pattern:
              type: string
            group:
              type: number
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - day_of_week
                - from_iso8601_timestamp
                - ln
                - elapsed_days
                - td_ip_to_least_specific_subdivision_name
                - td_ip_to_country_name
                - td_ip_to_city_name
                - td_ip_to_connection_type
                - td_ip_to_domain
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - cast_as_quantitative
            default:
              type: number
              format: float
          required:
            - function
            - default
        - type: object
          properties:
            function:
              type: string
              enum:
                - cast_as_categorical
            default:
              type: string
          required:
            - function
            - default
        - type: object
          properties:
            function:
              type: string
              enum:
                - cast_as_categorical_array
          required:
            - function
        - type: object
          properties:
            function:
              type: string
              enum:
                - if
            op:
              type: string
              enum:
                - '>'
                - <
                - <=
                - '>='
                - '='
                - '!='
                - is
                - is\
                - not
            right_value:
              type: number
              nullable: true
            then:
              type: number
            else:
              type: number
          required:
            - function
    SegmentRule:
      oneOf:
        - $ref: '#/components/schemas/EmptyCondition'
        - $ref: '#/components/schemas/AndCondition'
        - $ref: '#/components/schemas/OrCondition'
        - $ref: '#/components/schemas/CompositeCondition'
    SegmentParameters:
      type: object
      properties:
        audienceId:
          type: integer
          format: int64
        name:
          type: string
        realtime:
          type: boolean
          deprecated: true
          description: use `kind` instead
        kind:
          type: integer
          description: '0: batch, 1: realtime, 2: funnel_stage'
        funnel_stage:
          type: object
          properties:
            funnel_id:
              type: integer
              format: int64
            stage_id:
              type: integer
              format: int64
          description: required if creating segment as a rule of funnel_stage
        description:
          type: string
        segmentFolderId:
          type: integer
          format: int64
        rule:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
        countPopulation:
          type: boolean
    Segment:
      type: object
      properties:
        audienceId:
          type: string
          format: integer
        id:
          type: string
          format: integer
        name:
          type: string
        realtime:
          type: boolean
          description: Whether the segment is realtime segment or not
          deprecated: true
        kind:
          type: integer
          description: '0: batch, 1: realtime, 2: funnel_stage'
        description:
          type: string
          nullable: true
        segmentFolderId:
          type: string
          format: integer
        population:
          type: integer
          format: int64
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
        rule:
          anyOf:
            - $ref: '#/components/schemas/SegmentRule'
            - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
    SegmentSummary:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        realtime:
          type: boolean
          deprecated: true
          description: use `kind` instead
        kind:
          type: integer
          description: '0: batch, 1: realtime, 2: funnel_stage'
        description:
          type: string
        segmentFolderId:
          type: integer
          format: int64
        population:
          type: integer
          format: int64
          description: The population of the segment
    SegmentQueryStatus:
      type: object
      properties:
        id:
          type: string
          format: uuid
        queryId:
          type: string
          format: uuid
          description: Same value as `id`.
        status:
          type: string
          enum:
            - success
            - killed
            - error
            - running
        count:
          type: integer
          description: Number of profiles produced by the given segment rules
          nullable: true
        maxPage:
          type: integer
          nullable: true
        error:
          type: string
          nullable: true
        jobid:
          type: string
          format: integer
        countJobid:
          type: string
          format: integer
        customerGroupCount:
          type: integer
          description: Number of customer groups related by the given segment rules
          nullable: true
    SegmentQueryCustomers:
      type: object
      properties:
        error:
          description: Error message
          type: string
          nullable: true
        names:
          description: Column names
          example:
            - cdp_customer_id
            - email
          type: array
          items:
            type: string
          nullable: true
        queryId:
          description: ID of query
          example: 970937b9-98b1-45b1-ba9b-10905846476e
          type: string
        rows:
          description: Array of profiles
          nullable: true
          type: array
          items:
            type: array
            description: a tuple whose values corresponding names property
            example:
              - 003171af29a5f0ac890fed022d9e5366dea5d68e
              - a@example.com
            items:
              oneOf:
                - type: string
                  nullable: true
                - type: integer
                  format: int64
                - type: number
                  format: float
            nullable: true
        type:
          type: string
          enum:
            - rows
            - end
            - killed
            - error
            - pending
    SegmentFolderCreateRepresentation:
      type: object
      required:
        - name
        - description
      properties:
        name:
          type: string
        description:
          type: string
    SegmentFolderUpdateRepresentation:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
    SegmentFolderReadRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          oneOf:
            - $ref: '#/components/schemas/User'
            - $ref: '#/components/schemas/NullValue'
        updatedBy:
          oneOf:
            - $ref: '#/components/schemas/User'
            - $ref: '#/components/schemas/NullValue'
    AdministratorSegmentFolderReadRepresentation:
      allOf:
        - $ref: '#/components/schemas/SegmentFolderReadRepresentation'
        - type: object
          properties:
            version:
              type: string
              enum:
                - V4
                - V5
            path:
              type: array
              items:
                description: >-
                  A collection of folder names in the SegmentFolder tree
                  hierarchy, ordered from root to given SegmentFolder
                type: string
    AdministratorAudienceColumnsReadRepresentation:
      type: object
      properties:
        attributeColumns:
          type: array
          items:
            $ref: '#/components/schemas/AudienceColumnRepresentation'
          description: A list of attributes, inluding master table's columns.
        behaviors:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                nullable: false
                description: A name of behavior
              columns:
                type: array
                items:
                  $ref: '#/components/schemas/AudienceColumnRepresentation'
    AdministratorUsersColumnPermissionsRepresentation:
      type: object
      properties:
        columnIdentifier:
          type: string
          nullable: false
          description: A column representation for PBP-PII
        visibility:
          type: string
          enum:
            - clear
            - non_pii
            - pii
            - blocked
          nullable: false
    AudienceColumnRepresentation:
      type: object
      properties:
        columnIdentifier:
          type: string
          nullable: false
          description: An identifier to specify a column.
        name:
          type: string
          nullable: false
          description: The name of attribute or behavior column.
        enriched:
          type: boolean
          nullable: false
          description: True if it's from Enrichment.
        parentDatabaseName:
          type: string
          nullable: true
          description: Null only if enriched is true.
        parentTableName:
          type: string
          nullable: true
          description: Null only if enriched is true.
        parentColumnName:
          type: string
          nullable: true
          description: Null only if enriched is true.
    SyndicationParameters:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        allColumns:
          description: >-
            syndication all column flag  ('true' means  that you use all
            attribute data)
          type: boolean
        columns:
          $ref: '#/components/schemas/Columns'
        scheduleType:
          $ref: '#/components/schemas/DeprecatedScheduleType'
        scheduleOption:
          type: string
          deprecated: true
          description: Deprecated. Old parameter for setting schedule. Use startAt instead.
        repeatUnit:
          $ref: '#/components/schemas/RepeatUnit'
        repeatFrequency:
          $ref: '#/components/schemas/RepeatFrequency'
        repeatSubFrequency:
          $ref: '#/components/schemas/RepeatSubFrequency'
        startAt:
          $ref: '#/components/schemas/StartAt'
        runAt:
          type: string
        cron:
          type: string
        timezone:
          type: string
        connectionId:
          type: integer
          format: int64
          nullable: true
        connectorConfig:
          type: object
          nullable: true
        notifyOn:
          type: array
          items:
            type: string
            enum:
              - onSuccess
              - onFailure
        emailRecipients:
          type: array
          items:
            description: User ID of td-api. Not CDP-API's one.
            type: integer
            format: int64
        nestedWorkflowProjectName:
          type: string
        nestedWorkflowName:
          type: string
        lockEnabled:
          type: boolean
        activationTemplateId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
        syndicationBehavior:
          type: object
          nullable: true
          properties:
            columns:
              $ref: '#/components/schemas/Columns'
            behaviorTableName:
              type: string
              description: Behavior table name which contains behavior records
              example: purchase_history
            joinRow:
              type: integer
              description: How much rows would be joined (value is N for Top-N join)
              example: 3
              nullable: true
            joinStrategy:
              type: string
              example: Last
              enum:
                - All
                - First
                - Last
                - Top-N
            formatting:
              type: string
              enum:
                - rows
                - cols
            orderBy:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  order:
                    type: string
                    enum:
                      - ascending
                      - descending
                example:
                  key: purchased_at
                  order: descending
              example:
                - key: purchased_at
                  order: descending
                - key: price
                  order: ascending
      required:
        - name
        - connection_id
        - connector_config
    SyndicationJsonApiParameters:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        allColumns:
          description: >-
            syndication all column flag  ('true' means  that you use all
            attribute data)
          type: boolean
        columns:
          $ref: '#/components/schemas/Columns'
        scheduleType:
          $ref: '#/components/schemas/DeprecatedScheduleType'
        scheduleOption:
          type: string
          deprecated: true
          description: Deprecated. Old parameter for setting schedule. See startAt instead.
        runAt:
          type: string
        cron:
          type: string
        timezone:
          type: string
        startAt:
          $ref: '#/components/schemas/StartAt'
        endOn:
          type: string
          format: date
          nullable: true
        repeatUnit:
          $ref: '#/components/schemas/RepeatUnit'
        repeatFrequency:
          $ref: '#/components/schemas/RepeatFrequency'
        repeatSubFrequency:
          $ref: '#/components/schemas/RepeatSubFrequency'
        connectionId:
          type: integer
          format: int64
        connectorConfig:
          type: object
        notifyOn:
          type: array
          items:
            type: string
            enum:
              - onSuccess
              - onFailure
        emailRecipients:
          type: array
          items:
            description: User ID of td-api. Not CDP-API's one.
            type: integer
            format: int64
        activationTemplateId:
          type: string
          pattern: '[1-9][0-9]*'
        syndicationBehavior:
          type: object
          nullable: true
          properties:
            columns:
              $ref: '#/components/schemas/Columns'
            behaviorTableName:
              type: string
              description: Behavior table name which contains behavior records
              example: purchase_history
            joinRow:
              type: integer
              description: How much rows would be joined (value is N for Top-N join)
              example: 3
              nullable: true
            formatting:
              type: string
              enum:
                - rows
                - cols
            orderBy:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  order:
                    type: string
                    enum:
                      - ascending
                      - descending
                example:
                  key: purchased_at
                  order: descending
              example:
                - key: purchased_at
                  order: descending
                - key: price
                  order: ascending
      required:
        - name
        - connection_id
        - connector_config
    Syndication:
      type: object
      properties:
        id:
          type: string
          format: integer
        audienceId:
          type: string
          format: integer
        segmentId:
          type: string
          format: integer
        name:
          type: string
        description:
          type: string
        allColumns:
          description: >-
            syndication all column flag  ('true' means  that you use all
            attribute data)
          type: boolean
        columns:
          oneOf:
            - $ref: '#/components/schemas/Columns'
            - $ref: '#/components/schemas/NullValue'
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
        scheduleOption:
          type: string
          nullable: true
        startAt:
          $ref: '#/components/schemas/StartAt'
        endOn:
          type: string
          format: date
          nullable: true
        repeatUnit:
          type: string
          nullable: true
        repeatFrequency:
          type: integer
          nullable: true
        repeatSubFrequency:
          $ref: '#/components/schemas/RepeatSubFrequency'
        timezone:
          type: string
        connectionId:
          type: string
          format: integer
          nullable: true
        connectorConfig:
          type: object
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
        valid:
          type: boolean
        executions:
          type: array
          items:
            $ref: '#/components/schemas/SyndicationExecution'
        notifyOn:
          type: array
          items:
            type: string
            enum:
              - onSuccess
              - onFailure
        emailRecipients:
          type: array
          items:
            description: User ID of td-api. Not CDP-API's one.
            type: integer
            format: int64
        activationTemplateId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
    SyndicationExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            syndicationId:
              type: string
              pattern: '[1-9][0-9]*'
    SyndicationOverview:
      type: object
      additionalProperties: false
      properties:
        scheduleStatus:
          type: string
          nullable: false
          enum:
            - active
            - scheduled
            - inactive
            - none
        runStatus:
          type: string
          description: >-
            Tag should be shown in "Run Status". If the workflow never run
            before and future schedule is set, 'scheduled' will be shown.
          nullable: true
          enum:
            - scheduled
            - success
            - error
            - canceling
            - canceled
            - running
            - waiting
        id:
          type: string
          description: Activation ID
          format: integer
        name:
          type: string
          description: Activation Name
        segmentId:
          type: string
          format: integer
        segmentName:
          type: string
        folder:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: integer
              name:
                type: string
        activationTemplateId:
          type: string
          nullable: true
          format: integer
        activationTemplateName:
          type: string
          nullable: true
        connectionId:
          type: string
          format: integer
        connectionType:
          type: string
          nullable: true
        connectionTypeDescription:
          type: string
          nullable: true
        connectionName:
          type: string
          nullable: true
        connectionValid:
          type: boolean
        startAt:
          $ref: '#/components/schemas/StartAt'
        endOn:
          type: string
          format: date
          nullable: true
        workflowProjectName:
          type: string
          nullable: true
        workflowName:
          type: string
          nullable: true
        lastExecution:
          oneOf:
            - type: object
              nullable: true
            - $ref: '#/components/schemas/SyndicationExecution'
        lastRecordCount:
          type: integer
          format: int64
          nullable: true
        repeatUnit:
          $ref: '#/components/schemas/RepeatUnit'
        repeatFrequency:
          $ref: '#/components/schemas/RepeatFrequency'
        timezone:
          type: string
        updatedAt:
          type: string
          format: date-time
        updatedBy:
          $ref: '#/components/schemas/User'
        createdAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
    TokenParameters:
      type: object
      properties:
        description:
          description: description
          example: description
          type: string
        token:
          description: UUID of the token
          type: string
          format: uuid
        keyColumn:
          description: A key column name to fetch the information of a customer.
          example: td_client_id
          type: string
        segments:
          description: associated segments
          example:
            - id: 1234
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                format: int64
        attributeColumns:
          description: >-
            associated attribute column names. Max the number of attribute
            columns is 5. You must specify empty array if you don't need
            attributes.
          example:
            - gender
            - country
          nullable: false
          type: array
          items:
            type: string
      required:
        - keyColumn
        - attributeColumns
    Token:
      type: object
      properties:
        id:
          type: string
          format: integer
        audienceId:
          type: string
          format: integer
        token:
          description: UUID of the token
          type: string
          format: uuid
        description:
          type: string
        keyColumn:
          description: A key column name to fetch the information of a customer.
          example: td_client_id
          type: string
        segments:
          description: associated segments
          type: array
          items:
            $ref: '#/components/schemas/SegmentSummary'
        attributeColumns:
          description: associated attribute column names.
          example:
            - gender
            - country
          type: array
          items:
            type: string
        v2:
          description: whether the token is v2 or not
          example: true
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
    TokenExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            tokenId:
              type: string
              format: integer
    PredictiveSegmentParameters:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        baseSegmentId:
          type: integer
          format: int64
          nullable: true
        segmentId:
          type: integer
          format: int64
        scoredSegmentId:
          type: integer
          format: int64
          nullable: true
        gradeThresholds:
          $ref: '#/components/schemas/PredictiveSegmentGradeThresholds'
        categoricalAsColumnNames:
          type: array
          items:
            type: string
        categoricalArrayAsColumnNames:
          type: array
          items:
            type: string
        quantitativeAsColumnNames:
          type: array
          items:
            type: string
        preprocess:
          type: array
          description: >-
            Definition of preprocess. All of `$item.column` must be specified in
            one of categoricalAsColumnNames, categoricalArrayAsColumnNames, or
            quantitativeAsColumnNames.
          minItems: 1
          items:
            $ref: '#/components/schemas/PredictiveSegmentPreprocessItem'
    PredictiveSegment:
      type: object
      properties:
        audienceId:
          type: string
          format: integer
        id:
          type: string
          format: integer
        baseSegmentId:
          type: string
          format: integer
          nullable: true
        segmentId:
          type: string
          format: integer
        scoredSegmentId:
          type: string
          format: integer
          nullable: true
        name:
          type: string
        description:
          type: string
          nullable: true
        categoricalAsColumnNames:
          type: array
          items:
            type: string
        categoricalArrayAsColumnNames:
          type: array
          items:
            type: string
        quantitativeAsColumnNames:
          type: array
          items:
            type: string
        accuracy:
          $ref: '#/components/schemas/PredictiveSegmentAccuracy'
        areaUnderRocCurve:
          $ref: '#/components/schemas/PredictiveSegmentAreaUnderRocCurve'
        gradeThresholds:
          $ref: '#/components/schemas/PredictiveSegmentGradeThresholds'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    User:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        td_user_id:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
    Funnel:
      type: object
      properties:
        id:
          type: string
          format: integer
        audienceId:
          type: string
          format: integer
        segmentFolderId:
          type: string
          format: integer
        name:
          type: string
        population:
          type: integer
          format: int64
          nullable: true
          description: The latest population of the funnel
        description:
          type: string
        numSyndications:
          type: integer
          format: int64
        needToRunWorkflow:
          type: boolean
          description: true if need to run workflow to load data
        stages:
          description: funnel stages
          example:
            - id: '1'
              name: Awareness
              numSyndication: 2
              audienceId: '1'
              funnelId: '10'
              segmentFolderId: '30'
              segmentId: '999'
            - id: '2'
              name: Interest
              numSyndications: 0
              audienceId: '1'
              funnelId: '10'
              segmentFolderId: '30'
              segmentId: null
            - id: '3'
              name: Conversion
              numSyndications: 0
              audienceId: '1'
              funnelId: '10'
              segmentFolderId: '30'
              segmentId: null
          type: array
          minItems: 3
          maxItems: 8
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              numSyndications:
                type: integer
              audienceId:
                type: string
              funnelId:
                type: string
              segmentFolderId:
                type: string
              segmentId:
                type: string
                nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
    FunnelParameters:
      type: object
      properties:
        name:
          description: name
          type: string
        description:
          description: description
          type: string
        segmentFolderId:
          type: integer
          format: int64
        stages:
          description: funnel stages
          example:
            - name: Awareness
            - id: 1
              name: Interest
            - name: Conversion
          type: array
          minItems: 3
          maxItems: 8
          items:
            type: object
            properties:
              id:
                type: integer
                description: >-
                  null means new stage, non-null means no-op or updating
                  existing stage name or updating stage orders
              name:
                type: string
            required:
              - name
      required:
        - name
        - segmentFolderId
        - stages
    FunnelCloneParameters:
      type: object
      properties:
        name:
          description: name
          type: string
        description:
          description: description
          type: string
        segmentFolderId:
          type: integer
          format: int64
      required:
        - name
        - segmentFolderId
    FunnelStatistic:
      type: object
      properties:
        population:
          type: integer
          format: int64
          nullable: true
          description: the latest population of the funnel
        stages:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                format: int64
                description: funnel stage id
              history:
                type: array
                items:
                  type: array
                  items:
                    oneOf:
                      - type: integer
                        format: int64
                      - type: boolean
                  description: >-
                    a tuple whose values are Unix epoch, the population, whether
                    a workflow has run at that time or not
                  example:
                    - 1556382847
                    - 1234
                    - true
      example:
        population: 1000
        stages:
          - id: 44242
            history:
              - - 1600297704
                - 362
                - true
              - - 1600383964
                - 362
                - true
          - id: 44240
            history:
              - - 1600297667
                - 122
                - true
              - - 1600383950
                - 122
                - true
          - id: 44241
            history:
              - - 1600297690
                - 516
                - true
              - - 1600383956
                - 516
                - true
    FunnelExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            audienceId:
              type: integer
              format: int64
            funnelId:
              type: integer
              format: int64
    PredictiveSegmentExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            predictiveSegmentId:
              type: string
              format: integer
    PredictiveSegmentExecutionCore:
      allOf:
        - $ref: '#/components/schemas/ExecutionCore'
        - type: object
          required:
            - predictiveSegmentId
          properties:
            predictiveSegmentId:
              type: string
              pattern: '[1-9][0-9]*'
    SampleValuesPayload:
      description: array of tuple of sample values
      type: array
      items:
        type: array
        description: >-
          a tuple whose values are (1) value itself whose type depends on source
          column (2) percentage of the value
        example:
          - Japan
          - 0.14285714285714285
        items:
          anyOf:
            - type: integer
            - type: number
              format: float
            - type: string
    SisenseDashboard:
      type: object
      properties:
        base_url:
          type: string
          format: url
          description: Sisense base URL
          example: https://us01-01-development.reporting.treasuredata.com
        datamodel:
          type: object
          description: Sisense data model attributes used as data source of dashboard
          properties:
            datamodelOid:
              type: string
              description: Data model oid in Sisense
              example: a17a0f1ec9954a72-0e1fa49aa8ba4e83
            tableName:
              type: string
              description: Table name in Sisense
              example: customers
            customerIdColumnName:
              type: string
              description: Column name to identify customers
              example: cdp_customer_id
        dashboard:
          type: object
          description: Sisense Dashboard attributes used for building dashboard layout
          properties:
            dashboardOid:
              type: string
              description: Dashboard oid in Sisense
              example: 0e1fa49aa8ba4e83-a17a0f1ec9954a72
            dashboardType:
              type: integer
              description: '1: unified-customer-view'
              enum:
                - 1
        datasource:
          type: object
          description: Sisense Datasource attributes used for building dashboard filter
          required:
            - title
            - fullname
            - address
          properties:
            fullname:
              type: string
              description: >-
                Full name of Datasource in Sisense. It is a concatenation of a
                Data model's server and title
              example: localhost/kom Presto data model via API
            address:
              type: string
              description: Same as data model server name
              example: LocalHost
            live:
              type: boolean
              description: Whether Datasource is Live model or not (Elasticube).
              example: false
            title:
              type: string
              description: Same as data model title
              example: kom Presto Datamodel via API
    SisenseDatamodel:
      type: object
      properties:
        id:
          type: string
        audienceId:
          type: string
          format: integer
        datamodelOid:
          type: string
          description: Data model oid in Sisense
          example: a17a0f1ec9954a72-0e1fa49aa8ba4e83
        datamodelType:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    SisenseSyncExecution:
      allOf:
        - $ref: '#/components/schemas/Execution'
        - type: object
          properties:
            audienceId:
              type: string
              format: integer
    Statistic:
      type: array
      items:
        type: array
        description: >-
          a tuple whose values are Unix epoch, the population, whether a
          workflow has run at that time or not. If the third value is false, it
          is imputed value.
        example:
          - 1556382847
          - 1234
          - true
        items:
          oneOf:
            - type: integer
              format: int64
            - type: boolean
    PredictiveSegmentPreprocessItem:
      type: object
      properties:
        column:
          type: string
        source:
          type: object
          properties:
            column:
              type: string
            table:
              type: string
            functions:
              type: array
              items:
                $ref: '#/components/schemas/FunctionExpression'
      required:
        - column
        - source
    PredictiveSegmentGradeThresholds:
      type: array
      minItems: 3
      maxItems: 3
      description: Given the items [a, b, c], they must meet the condition `a >= b >= c`
      example:
        - 75
        - 50
        - 25
      items:
        type: number
        format: double
        minimum: 0
        maximum: 100
    PredictiveSegmentAccuracy:
      type: number
      format: double
      minimum: 0
      maximum: 100
      nullable: true
      description: Accuracy for trained model evaluated on initial training.
    PredictiveSegmentAreaUnderRocCurve:
      type: number
      format: double
      minimum: 0
      maximum: 1
      nullable: true
      description: >-
        Evaluation score for the model. See also
        https://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve
    PredictiveSegmentModelScoreHistogram:
      type: array
      items:
        type: array
        items:
          oneOf:
            - type: string
            - type: integer
        minLength: 2
        maxLength: 2
      example:
        - - '1'
          - 300
        - - '2'
          - 200
    PredictiveSegmentRule:
      type: object
      properties:
        categoricalAsColumnNames:
          type: array
          items:
            type: string
        categoricalArrayAsColumnNames:
          type: array
          items:
            type: string
        quantitativeAsColumnNames:
          type: array
          items:
            type: string
        preprocess:
          type: array
          description: >-
            Definition of preprocess. All of `$item.column` must be specified in
            one of categoricalAsColumnNames, categoricalArrayAsColumnNames, or
            quantitativeAsColumnNames.
          minItems: 1
          items:
            $ref: '#/components/schemas/PredictiveSegmentPreprocessItem'
    TableConfig:
      type: object
      required:
        - name
        - audienceId
        - adlHost
        - primaryKey
        - indexes
        - excludeColumns
        - sortColumns
        - filterColumns
        - adlFullTableName
        - behaviors
        - subdimensions
        - createdAt
        - updatedAt
        - createdBy
        - updatedBy
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        adlHost:
          type: string
          example: https://c360-api-a1-adl.treasuredata.com
        primaryKey:
          type: string
          description: Primary key for customers table on ADL
          example: td_client_id
        indexes:
          type: array
          description: 'Indexes columns for customers table on ADL. Default: []'
          items:
            type: string
        excludeColumns:
          description: 'Column names to be excluded to sync into ADL. Default: []'
          type: array
          items:
            type: string
        sortColumns:
          description: 'Column names to be used for sorting on ADL. Default: []'
          type: array
          items:
            type: string
        filterColumns:
          description: 'Column names to be used for filtering on ADL. Default: []'
          type: array
          items:
            type: string
        adlFullTableName:
          type: string
          description: Data base name and table name on ADL
          example: cdp_1234_cc.customers
        behaviors:
          type: array
          items:
            $ref: '#/components/schemas/ServiceBehavior'
        subdimensions:
          type: array
          items:
            $ref: '#/components/schemas/ServiceSubdimension'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
    ServiceBehavior:
      type: object
      description: >-
        ADL table setting for behavior table. Table name on ADL can be
        'cdp_{audience_id}_cc.behaviors_{table_name}'. If realtime_update is
        true, table name will be same as parent table name.
      required:
        - id
        - primaryKey
        - excludeColumns
        - sortColumns
        - filterColumns
        - realtimeUpdate
        - overwriteParentTable
        - cleanupParentTable
        - adlFullTableName
        - audienceBehavior
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        primaryKey:
          type: string
          nullable: true
          description: Primary key for behavior table on ADL
        indexes:
          type: array
          description: 'Indexes columns for customers table on ADL. Default: []'
          items:
            type: string
        excludeColumns:
          description: 'Column names to be excluded to sync into ADL. Default: []'
          type: array
          items:
            type: string
        sortColumns:
          description: 'Column names to be used for sorting on ADL. Default: []'
          type: array
          items:
            type: string
        filterColumns:
          description: 'Column names to be used for filtering on ADL. Default: []'
          type: array
          items:
            type: string
        realtimeUpdate:
          type: boolean
          description: >-
            Enables to sync parent table of behavior table into ADL one-time. If
            there are existing tables that have same name as parent tables on
            ADL, it won't sync them. Default false.
        overwriteParentTable:
          type: boolean
          description: >-
            Overwrite parent tables on ADL for realtime update. This enables to
            sync parent table regardless of existing the ADL table. Default
            false.
        cleanupParentTable:
          type: boolean
          description: If true, remove behavior parent table on ADL. Default false.
        adlFullTableName:
          type: string
          description: >-
            Data base name and table name on ADL. If realtimeUpdate is true,
            database name and table name is same as parent table of the behavior
            table.
          example: cdp_1234_cc.behavior_weblogs
        audienceBehavior:
          $ref: '#/components/schemas/AudienceBehavior'
    ServiceSubdimension:
      type: object
      description: >-
        ADL table setting for sub dimension table. A sub dimension table enables
        to sync user table into ADL and link to behavior table. A table name can
        be 'cdp_{audinece_id}_cc.user_{database_name}_{table_name}'.
      required:
        - id
        - databaseName
        - tableName
        - primaryKey
        - excludeColumns
        - sortColumns
        - filterColumns
        - adlFullTableName
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        databaseName:
          type: string
          description: Database name on Plazma DB
        tableName:
          type: string
          description: Table name on Plazma DB
        primaryKey:
          type: string
          description: Primary key for sub dimension table on ADL
        indexes:
          type: array
          description: 'Indexes columns for customers table on ADL. Default: []'
          items:
            type: string
        excludeColumns:
          description: 'Column names to be excluded to sync into ADL. Default: []'
          type: array
          items:
            type: string
        sortColumns:
          description: 'Column names to be used for sorting on ADL. Default: []'
          type: array
          items:
            type: string
        filterColumns:
          type: array
          description: 'Column names to be used for filtering on ADL. Default: []'
          items:
            type: string
        adlFullTableName:
          type: string
          description: >-
            Data base name and table name on ADL. The ADL table name should be
            'user_{database_name}_{table_name}'.
          example: cdp_1234_cc.user_userdb_orders
        linkKey:
          type: string
          description: >-
            Join key to be joined with another table. Target table's primary key
            for ADL should be same.
          nullable: true
        linkTable:
          type: string
          description: >-
            Join full target table name on ADL. For behavior table, it should be
            "cdp_{audience_id}_cc.behaviors_{table_name}".
          nullable: true
    TableConfigParameters:
      type: object
      required:
        - name
        - primaryKey
      properties:
        name:
          type: string
        adlHost:
          type: string
          example: https://c360-api-a1-adl.treasuredata.com
        primaryKey:
          type: string
          description: Primary key for customers table on ADL
          example: td_client_id
        indexes:
          type: array
          description: 'Indexes columns for customers table on ADL. Default: []'
          items:
            type: string
        behaviors:
          type: array
          items:
            type: object
            description: >-
              ADL table setting for behavior table. Table name on ADL can be
              'cdp_{audience_id}_cc.behaviors_{table_name}'. If realtime_update
              is true, table name will be same as parent table name.
            required:
              - behaviorName
            properties:
              behaviorName:
                type: string
                description: Target behavior name to be synced
                example: weblogs
              primaryKey:
                type: string
                description: Primary key for behavior table on ADL
              indexes:
                type: array
                description: >-
                  Indexes columns for behaviors table on ADL. If primaryKey is
                  null, you need to include td_client_id column in indexes.
                  Default: []
                items:
                  type: string
              excludeColumns:
                type: array
                description: 'Column names to be excluded to sync into ADL. Default: []'
                items:
                  type: string
              sortColumns:
                type: array
                description: 'Column names to be used for sorting on ADL. Default: []'
                items:
                  type: string
              filterColumns:
                type: array
                description: 'Column names to be used for filtering on ADL. Default: []'
                items:
                  type: string
              realtimeUpdate:
                type: boolean
                description: >-
                  Enables to sync parent table of behavior table into ADL
                  one-time. If there are existing tables that have same name as
                  parent tables on ADL, it won't sync them. Default false.
              overwriteParentTable:
                type: boolean
                description: >-
                  Overwrite parent tables on ADL for realtime update. This
                  enables to sync parent table regardless of existing the ADL
                  table. Default false.
              cleanupParentTable:
                type: boolean
                description: If true, remove behavior parent table on ADL. Default false.
        subdimensions:
          type: array
          items:
            type: object
            description: >-
              ADL table setting for sub dimension table. A sub dimension table
              enables to sync user table into ADL and link to behavior table. A
              table name can be
              'cdp_{audinece_id}_cc.user_{database_name}_{table_name}'.
            required:
              - databaseName
              - tableName
              - primaryKey
            properties:
              databaseName:
                type: string
                description: Database name on Plazma DB
              tableName:
                type: string
                description: Table name on Plazma DB
              primaryKey:
                type: string
                description: Primary key for sub dimension table on ADL
              indexes:
                type: array
                description: 'Indexes columns for sub dimensions table on ADL. Default: []'
                items:
                  type: string
              excludeColumns:
                type: array
                description: 'Column names to be excluded to sync into ADL. Default: []'
                items:
                  type: string
              sortColumns:
                type: array
                description: 'Column names to be used for sorting on ADL. Default: []'
                items:
                  type: string
              filterColumns:
                type: array
                description: 'Column names to be used for filtering on ADL. Default: []'
                items:
                  type: string
              linkKey:
                type: string
                description: >-
                  Join key to be joined with another table. Target table's
                  primary key for ADL should be same.
                nullable: true
              linkTable:
                type: string
                description: >-
                  Join full target table name on ADL. For behavior table, it
                  should be "cdp_{audience_id}_cc.behaviors_{table_name}".
                nullable: true
    UserJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - user
        attributes:
          type: object
          required:
            - tdUserId
            - name
          properties:
            tdUserId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
    AudienceBehaviorWithVisibilityJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - audience-behavior
        attributes:
          type: object
          required:
            - audienceId
            - name
            - parentDatabaseName
            - parentTableName
            - parentKey
            - foreignKey
            - matrixDatabaseName
            - matrixTableName
            - allColumns
            - defaultTimeFilterEnabled
            - isRealtime
            - schema
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
              description: >-
                Behavior name user defined on Master Segment Configuration page
                of Data Workbench
            parentDatabaseName:
              type: string
              description: Database name of the behavior table
            parentTableName:
              type: string
              description: Table name of the behavior table
            parentKey:
              type: string
              description: Join key of the behavior table
            foreignKey:
              type: string
              description: Foreign key of the master table
            matrixDatabaseName:
              type: string
              description: Matrix database name of the behavior table
            matrixTableName:
              type: string
              description: Matrix table name of the behavior table
            allColumns:
              type: boolean
            defaultTimeFilterEnabled:
              type: boolean
            isRealtime:
              type: boolean
            schema:
              type: array
              description: Columns of behavior
              items:
                $ref: '#/components/schemas/AudienceBehaviorSchemaWithVisibility'
    FolderJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - folder-segment
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - createdAt
            - updatedAt
            - permissions
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            enrichments:
              type: object
              nullable: true
            rule:
              type: object
              nullable: true
            permissions:
              $ref: '#/components/schemas/FolderPermissions'
        relationships:
          type: object
          properties:
            children:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      data:
                        type: object
                        required:
                          - id
                          - type
                        properties:
                          id:
                            type: string
                            pattern: '[1-9][0-9]*'
                          type:
                            type: string
                            enum:
                              - folder-segment
                              - segment-batch
                              - funnel
                              - predictive-segment
                              - token
                              - journey
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderNullableJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    FolderPermissions:
      type: object
      nullable: false
      properties:
        view:
          type: boolean
        edit:
          type: boolean
    BatchSegmentJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - segment-batch
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - population
            - rule
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            population:
              type: number
              nullable: true
            numSyndications:
              type: integer
              format: int64
            rule:
              $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            countPopulation:
              type: boolean
            segmentInsightDashboardId:
              type: integer
              format: int64
              nullable: true
            isEmptyRule:
              type: boolean
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    RealtimeSegmentJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - segment-realtime
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - population
            - rule
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            population:
              type: number
              nullable: true
            numSyndications:
              nullable: true
              type: integer
              format: int64
            rule:
              $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            countPopulation:
              type: boolean
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    FunnelStageSegmentJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - segment-funnel-stage
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - population
            - rule
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            population:
              type: number
              nullable: true
            numSyndications:
              type: integer
              format: int64
            rule:
              $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            countPopulation:
              type: boolean
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    SegmentSummaryJsonApiResource:
      type: object
      required:
        - id
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        attributes:
          type: object
          nullable: true
          description: >-
            If user doesn't have a permission for the resource, attributes field
            doesn't exist.
          required:
            - name
            - description
            - population
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            population:
              type: number
              nullable: true
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    BatchSegmentSummaryJsonApiResource:
      allOf:
        - $ref: '#/components/schemas/SegmentSummaryJsonApiResource'
        - type: object
          properties:
            type:
              type: string
              enum:
                - segment-batch
              nullable: false
    RealtimeSegmentSummaryJsonApiResource:
      allOf:
        - $ref: '#/components/schemas/SegmentSummaryJsonApiResource'
        - type: object
          properties:
            type:
              type: string
              enum:
                - segment-realtime
              nullable: false
    FunnelStageSegmentSummaryJsonApiResource:
      allOf:
        - $ref: '#/components/schemas/SegmentSummaryJsonApiResource'
        - type: object
          properties:
            type:
              type: string
              enum:
                - segment-funnel-stage
              nullable: false
    FunnelJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - funnel
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - population
            - numSyndications
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            population:
              type: number
              nullable: true
            numSyndications:
              type: integer
              format: int64
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            countPopulation:
              type: boolean
            stages:
              type: array
              minLength: 3
              maxLength: 8
              items:
                $ref: '#/components/schemas/FunnelStageJsonApiResource'
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    FunnelStageJsonApiResource:
      type: object
      required:
        - name
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        segmentId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        numSyndications:
          type: integer
          format: int64
    ParentSegmentJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - parentSegment
        attributes:
          type: object
          required:
            - name
            - description
            - matrixUpdatedAt
            - population
            - scheduleType
            - createdAt
            - updatedAt
            - v4Id
          properties:
            name:
              type: string
            description:
              type: string
            matrixUpdatedAt:
              type: string
              format: date-time
              nullable: true
            population:
              type: number
              nullable: true
            scheduleType:
              $ref: '#/components/schemas/ScheduleType'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            v4Id:
              type: number
            allowActivationBehavior:
              type: boolean
              default: false
            maxActivationBehaviorRow:
              type: integer
              default: 7
            customerGroup:
              type: object
              nullable: true
              required:
                - name
                - population
              properties:
                name:
                  type: string
                population:
                  type: number
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            parentSegmentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    SyndicationJsonApiResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - syndication
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - columns
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            allColumns:
              description: >-
                syndication all column flag  ('true' means that you use all
                attribute data)
              type: boolean
            columns:
              $ref: '#/components/schemas/Columns'
            scheduleType:
              $ref: '#/components/schemas/DeprecatedScheduleType'
            scheduleOption:
              type: string
              deprecated: true
            timezone:
              type: string
            startAt:
              $ref: '#/components/schemas/StartAt'
            endOn:
              type: string
              format: date
              nullable: true
            runStatus:
              type: string
              description: >-
                Tag should be shown in "Run Status". If the workflow never run
                before and future schedule is set, 'scheduled' will be shown.
              nullable: true
              enum:
                - scheduled
                - success
                - error
                - canceling
                - canceled
                - running
                - waiting
            repeatUnit:
              $ref: '#/components/schemas/RepeatUnit'
            repeatFrequency:
              $ref: '#/components/schemas/RepeatFrequency'
            repeatSubFrequency:
              $ref: '#/components/schemas/RepeatSubFrequency'
            connectionId:
              type: string
              pattern: '[1-9][0-9]*'
            connectorConfig:
              type: object
            valid:
              type: boolean
            notifyOn:
              type: array
              items:
                type: string
                enum:
                  - onSuccess
                  - onFailure
            emailRecipients:
              type: array
              items:
                description: User ID of td-api. Not CDP-API's one.
                type: integer
                format: int64
            executions:
              type: array
              items:
                $ref: '#/components/schemas/SyndicationExecution'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            nestedWorkflowProjectName:
              type: string
            nestedWorkflowName:
              type: string
            activationActionsEnabled:
              type: boolean
            lockEnabled:
              type: boolean
            activationTemplateId:
              type: string
              pattern: '[1-9][0-9]*'
            syndicationBehavior:
              type: object
              properties:
                columns:
                  $ref: '#/components/schemas/Columns'
                behaviorTableName:
                  type: string
                  description: Behavior table name which contains behavior records
                  example: purchase_history
                joinRow:
                  type: integer
                  description: How much rows would be joined (value is N for Top-N join)
                  example: 3
                  nullable: true
                joinStrategy:
                  type: string
                  description: >
                    Label of what is the wanted record(s).

                    Note for BE: See APPS-2679. "ascending" and "descending" are
                    inverted finally.
                  example: Last
                  enum:
                    - All
                    - First
                    - Last
                    - Top-N
                formatting:
                  type: string
                  enum:
                    - rows
                    - cols
                orderBy:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                      order:
                        type: string
                        enum:
                          - ascending
                          - descending
                    example:
                      key: purchased_at
                      order: descending
                  example:
                    - key: purchased_at
                      order: descending
                    - key: price
                      order: ascending
                validReferences:
                  type: object
                  properties:
                    behaviorTableName:
                      type: boolean
                      description: >-
                        Behavior table name has valid reference by other
                        dependent resources.
                    columns:
                      type: object
                      description: >
                        it contains pair of source name and status by each
                        column

                        status is Behavior column has valid reference by other
                        dependent resources.
                      example:
                        purchased_at: false
                        price: true
                  example:
                    behaviorTableName: true
                    columns:
                      purchased_at: false
                      price: true
        relationships:
          type: object
          properties:
            segment:
              $ref: '#/components/schemas/RelationshipsBatchSegmentJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    SyndicationExecutionJsonApiResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
          description: workflowAttemptId is used as id
        type:
          type: string
          enum:
            - execution-syndication
        attributes:
          $ref: '#/components/schemas/SyndicationExecution'
    PredictiveSegmentJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - predictive-segment
        attributes:
          $ref: '#/components/schemas/PredictiveSegmentJsonApiResourceAttr'
        relationships:
          type: object
          properties:
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    PredictiveSegmentJsonApiResourceAttr:
      properties:
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        baseSegmentId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
        segmentId:
          type: string
          pattern: '[1-9][0-9]*'
        scoredSegmentId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
        name:
          type: string
        description:
          type: string
          nullable: true
        categoricalAsColumnNames:
          type: array
          items:
            type: string
        categoricalArrayAsColumnNames:
          type: array
          items:
            type: string
        quantitativeAsColumnNames:
          type: array
          items:
            type: string
        accuracy:
          $ref: '#/components/schemas/PredictiveSegmentAccuracy'
        areaUnderRocCurve:
          $ref: '#/components/schemas/PredictiveSegmentAreaUnderRocCurve'
        gradeThresholds:
          $ref: '#/components/schemas/PredictiveSegmentGradeThresholds'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        modelUpdatedAt:
          type: string
          format: date-time
    PredictiveSegmentExecutionJsonApiResource:
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
          description: workflowAttemptId is used as id
        type:
          type: string
          enum:
            - execution-predictive-segment
        attributes:
          $ref: '#/components/schemas/PredictiveSegmentExecutionCore'
    TokenJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - token
        attributes:
          type: object
          required:
            - name
            - attributeColumns
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            token:
              description: UUID of the token
              type: string
              format: uuid
            description:
              type: string
            keyColumn:
              description: A key column name to fetch the information of a customer.
              example: td_client_id
              type: string
            attributeColumns:
              description: associated attribute column names.
              example:
                - gender
                - country
              type: array
              items:
                type: string
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
        relationships:
          type: object
          properties:
            segments:
              $ref: '#/components/schemas/RelationshipsSegmentJsonApiResource'
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    EntitiesAudienceBehaviorIndexJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AudienceBehaviorWithVisibilityJsonApiResource'
    EntitiesGetByFolderJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/FolderJsonApiResource'
              - $ref: '#/components/schemas/BatchSegmentJsonApiResource'
              - $ref: '#/components/schemas/RealtimeSegmentJsonApiResource'
              - $ref: '#/components/schemas/FunnelJsonApiResource'
              - $ref: '#/components/schemas/PredictiveSegmentJsonApiResource'
              - $ref: '#/components/schemas/TokenJsonApiResource'
              - $ref: '#/components/schemas/JourneyJsonApiResource'
              - $ref: '#/components/schemas/ActivationTemplateJsonApiResource'
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyByFolderResource
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationByFolderResource
              - $ref: '#/components/schemas/MlSolutionJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesGetParentSegmentJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/ParentSegmentJsonApiResource'
    EntitiesGetFolderJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/FolderJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesFolderUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - folder-segment
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    EntitiesGetSegmentJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/BatchSegmentJsonApiResource'
            - $ref: '#/components/schemas/RealtimeSegmentJsonApiResource'
            - $ref: '#/components/schemas/FunnelStageSegmentJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesSegmentUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - segment-batch
            - segment-realtime
            - segment-funnel-stage
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            rule:
              $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
            funnel_stage:
              type: object
              properties:
                funnel_id:
                  type: integer
                  format: int64
                stage_id:
                  type: integer
                  format: int64
              description: >-
                required if type is segment-funnel-stage to create segment as a
                rule of funnel_stage
            segmentInsightDashboardId:
              type: integer
              format: int64
              nullable: true
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    EntitiesGetFunnelJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/FunnelJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesFunnelIndexJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FunnelJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesFunnelCreateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - funnel
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            stages:
              type: array
              minLength: 3
              maxLength: 8
              items:
                $ref: '#/components/schemas/FunnelStageJsonApiResource'
          required:
            - name
            - stages
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
          required:
            - parentFolder
    EntitiesFunnelUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - funnel
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            stages:
              type: array
              minLength: 3
              maxLength: 8
              items:
                $ref: '#/components/schemas/FunnelStageJsonApiResource'
          required:
            - name
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
          required:
            - parentFolder
    EntitiesGetSyndicationJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/SyndicationJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesSyndicationIndexJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SyndicationJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesSyndicationUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - syndication
        attributes:
          $ref: '#/components/schemas/SyndicationJsonApiParameters'
    EntitiesGetAbTestJsonApiResult:
      type: object
      properties:
        id:
          type: string
          example: '1'
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - ab-test
        attributes:
          type: object
          properties:
            audienceId:
              type: string
              example: '1'
            segmentFolderId:
              type: string
              example: '1'
            name:
              type: string
              example: Email Test
              pattern: '[A-Za-z_][A-Za-z0-9_ ]*'
              description: Name for an A/B test
            keyColumn:
              type: string
              example: td_client_id
              description: >-
                Stable ID column that is expected to be unique identifier for
                each profile
            variants:
              description: AbTest variants
              example:
                - id: '1'
                  abTestId: '1'
                  name: Group A
                  ratio: 40
                - id: '2'
                  abTestId: '1'
                  name: Group B
                  ratio: 40
                - id: '3'
                  abTestId: '1'
                  name: Hold out
                  ratio: 20
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  abTestId:
                    type: string
                  name:
                    type: string
                  ratio:
                    type: integer
                    format: int64
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    EntitiesAbTestCreateRepresentation:
      type: object
      properties:
        id:
          type: string
          example: '1'
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - ab-test
        attributes:
          type: object
          required:
            - name
            - variants
            - keyColumn
          properties:
            name:
              type: string
              example: Email Test
              pattern: '[A-Za-z_][A-Za-z0-9_ ]*'
              description: Name for an A/B test
            keyColumn:
              type: string
              example: td_client_id
              description: >-
                Stable ID column that is expected to be unique identifier for
                each profile
            variants:
              description: AbTest variants
              example:
                - id: '1'
                  abTestId: '1'
                  name: Group A
                  ratio: 40
                - id: '2'
                  abTestId: '1'
                  name: Group B
                  ratio: 40
                - id: '3'
                  abTestId: '1'
                  name: Hold out
                  ratio: 20
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  abTestId:
                    type: string
                  name:
                    type: string
                  ratio:
                    type: integer
                    format: int64
        relationships:
          type: object
          required:
            - baseSegment
            - parentSegment
          properties:
            baseSegment:
              $ref: '#/components/schemas/RelationshipsBatchSegmentJsonApiResource'
            parentSegment:
              $ref: '#/components/schemas/RelationshipsParentSegmentJsonApiResource'
    EntitiesAbTestCreationJsonApiResult:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - ab-test
        attributes:
          type: object
          properties:
            audienceId:
              type: string
              example: '1'
            segmentFolderId:
              type: string
              example: '1'
            name:
              type: string
              example: Email Test
              pattern: '[A-Za-z_][A-Za-z0-9_ ]*'
              description: Name for an A/B test
            keyColumn:
              type: string
              example: td_client_id
              description: >-
                Stable ID column that is expected to be unique identifier for
                each profile
            variants:
              description: AbTest variants
              example:
                - id: '1'
                  abTestId: '1'
                  name: Group A
                  ratio: 40
                - id: '2'
                  abTestId: '1'
                  name: Group B
                  ratio: 40
                - id: '3'
                  abTestId: '1'
                  name: Hold out
                  ratio: 20
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  abTestId:
                    type: string
                  name:
                    type: string
                  ratio:
                    type: integer
                    format: int64
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
        relationships:
          type: object
          properties:
            folder:
              description: auto-generated folder
              allOf:
                - $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            segments:
              type: array
              description: auto-generated segments
              items:
                $ref: '#/components/schemas/RelationshipsBatchSegmentJsonApiResource'
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            baseSegment:
              $ref: '#/components/schemas/RelationshipsBatchSegmentJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    EntitiesGetPredictiveSegmentJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/PredictiveSegmentJsonApiResourceAttr'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesGetPredictiveSegmentExecutionJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/PredictiveSegmentExecutionJsonApiResource'
    EntitiesPredictiveSegmentUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - predictive-segment
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            baseSegmentId:
              type: integer
              format: int64
              nullable: true
            segmentId:
              type: integer
              format: int64
            scoredSegmentId:
              type: integer
              format: int64
              nullable: true
            gradeThresholds:
              $ref: '#/components/schemas/PredictiveSegmentGradeThresholds'
            categoricalAsColumnNames:
              type: array
              items:
                type: string
            categoricalArrayAsColumnNames:
              type: array
              items:
                type: string
            quantitativeAsColumnNames:
              type: array
              items:
                type: string
            preprocess:
              type: array
              description: >-
                Definition of preprocess. All of `$item.column` must be
                specified in one of categoricalAsColumnNames,
                categoricalArrayAsColumnNames, or quantitativeAsColumnNames.
              minItems: 1
              items:
                $ref: '#/components/schemas/PredictiveSegmentPreprocessItem'
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    EntitiesGetPredictiveSegmentModelFeaturesJsonApiResult:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - predictive-segment-model
            attributes:
              type: object
              properties:
                features:
                  type: array
                  items:
                    type: array
                    description: >-
                      a tuple of feature name and its weight. A feature name can
                      be column name or 'column_name#category_name'. Feature
                      weight is importance of the feature and can be positive
                      and negative (absolute value is matter).
                    example:
                      - td_ip_subdivision_names#Maharashtra
                      - 0.4376903474330902
                    items:
                      oneOf:
                        - type: string
                        - type: number
                          format: float
    EntitiesGetPredictiveSegmentModelColumnsJsonApiResult:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - predictive-segment-model
            attributes:
              type: object
              properties:
                columns:
                  type: array
                  items:
                    type: array
                    items:
                      type: string
    EntitiesGetPredictiveSegmentModelScoresJsonApiResult:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - predictive-segment-model-score
            attributes:
              type: object
              properties:
                positives:
                  $ref: '#/components/schemas/PredictiveSegmentModelScoreHistogram'
                negatives:
                  $ref: '#/components/schemas/PredictiveSegmentModelScoreHistogram'
    EntitiesSegmentPredictiveSegmentGuessRuleAsyncJsonApiResult:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - predictive-segment-rule-guess-result
            attributes:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - running
                    - success
                rule:
                  $ref: '#/components/schemas/PredictiveSegmentRule'
    EntitiesGetTokenJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/TokenJsonApiResource'
        included:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
              - $ref: '#/components/schemas/BatchSegmentSummaryJsonApiResource'
              - $ref: '#/components/schemas/RealtimeSegmentSummaryJsonApiResource'
              - $ref: '#/components/schemas/FunnelStageSegmentSummaryJsonApiResource'
    EntitiesTokenUpdateRepresentation:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          example: '1'
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - token
        attributes:
          type: object
          required:
            - name
            - attrributeColumns
          properties:
            name:
              type: string
              pattern: '[A-Za-z_][A-Za-z0-9_ ]*'
              description: Name for a Token
              nullable: false
            description:
              description: description
              example: blah blah blah
              type: string
            keyColumn:
              description: >-
                A key column name to fetch the information of a customer. If
                empty, cdp-api fills "td_global_id" as default value.
              example: td_client_id
              type: string
            attributeColumns:
              description: >-
                associated attribute column names. Max the number of attribute
                columns is 5. You must specify empty array if you don't need
                attributes.
              example:
                - gender
                - country
              nullable: false
              type: array
              items:
                type: string
        relationships:
          type: object
          required:
            - parentFolder
          properties:
            segments:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - type
                    properties:
                      id:
                        type: string
                        pattern: '[1-9][0-9]*'
                      type:
                        type: string
                        enum:
                          - segment-batch
                          - segment-realtime
                          - segment-funnel-stage
              nullable: true
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    RelationshipsParentSegmentJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - parent-segment
    RelationshipsFolderJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - folder-segment
    RelationshipsFolderNullableJsonApiResource:
      type: object
      properties:
        data:
          type: object
          nullable: true
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - folder-segment
    RelationshipsFolderStrictJsonApiResource:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - folder-segment
    RelationshipsBatchSegmentJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - segment-batch
    RelationshipsRealtimeSegmentJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - segment-realtime
    RelationshipsFunnelJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - funnel
    RelationshipsJourneyJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - journey
    RelationshipsPredictiveSegmentJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - predictive-segment
    RelationshipsTokenJsonApiResource:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - token
    RelationshipsUserJsonApiResource:
      type: object
      properties:
        data:
          nullable: true
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - user
    RelationshipsSegmentJsonApiResource:
      type: object
      properties:
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/RelationshipsBatchSegmentJsonApiResource'
              - $ref: >-
                  #/components/schemas/RelationshipsRealtimeSegmentJsonApiResource
    JourneyJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journey
        attributes:
          type: object
          required:
            - name
            - description
            - state
            - audienceId
            - goal
            - createdAt
            - updatedAt
            - launchedAt
            - journeyStages
            - paused
            - pausedAt
            - allowReentry
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            state:
              type: string
            goal:
              $ref: '#/components/schemas/JourneyCriteria'
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            journeyStages:
              type: array
              minLength: 1
              maxLength: 8
              items:
                $ref: '#/components/schemas/JourneyStageJsonApiResource'
            paused:
              type: boolean
            pausedAt:
              type: string
              format: date-time
              nullable: true
            allowReentry:
              type: boolean
            reentryMode:
              type: string
              enum:
                - no_reentry
                - reentry_unless_goal_achieved
                - reentry_always
            journeyBundleId:
              type: string
              pattern: '[1-9][0-9]*'
              nullable: true
            journeyBundleName:
              type: string
              nullable: true
            versionNumber:
              type: integer
              format: int64
            journeyBundleDescription:
              type: string
              nullable: true
            latestExecution:
              nullable: true
              description: >-
                The most recent execution of the journey workflow. If no
                executions have been created, this will be null. 
              allOf:
                - $ref: '#/components/schemas/Execution'
                - type: object
                  properties:
                    audienceId:
                      type: string
                      format: integer
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    JourneyDetailJsonApiResource:
      type: object
      required:
        - attributes
        - relationships
      properties:
        attributes:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
              nullable: true
            journeyStages:
              type: array
              minLength: 1
              maxLength: 8
              items:
                $ref: '#/components/schemas/JourneyStageDetailJsonApiResource'
            journeyBundleName:
              type: string
              nullable: true
              description: Name of the journey bundle if it is assumed to be changed.
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    JourneyDuplicateJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
          description: source journey id
        type:
          type: string
          enum:
            - journey
        attributes:
          type: object
          required:
            - name
          properties:
            name:
              type: string
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    JourneyStageJsonApiResource:
      type: object
      required:
        - name
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
        steps:
          $ref: '#/components/schemas/JourneyStep'
        rootStep:
          type: string
        entryCriteria:
          $ref: '#/components/schemas/JourneyCriteria'
        milestone:
          $ref: '#/components/schemas/JourneyCriteria'
        exitCriterias:
          type: array
          items:
            $ref: '#/components/schemas/JourneyCriteria'
    JourneyStageDetailJsonApiResource:
      type: object
      properties:
        name:
          type: string
    EntitiesGetJourneyJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/JourneyJsonApiResource'
        included:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
              - $ref: '#/components/schemas/JourneyJumpFromJourney'
    EntitiesIndexJourneyJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneyJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    JourneyCriteria:
      type: object
      nullable: true
      required:
        - name
        - segmentId
      properties:
        name:
          type: string
        description:
          type: string
        segmentId:
          type: string
          pattern: '[1-9][0-9]*'
        target:
          $ref: '#/components/schemas/JourneyJumpTarget'
    JourneyStep:
      type: object
      nullable: true
      properties:
        uuid:
          oneOf:
            - $ref: '#/components/schemas/JourneyWaitStep'
            - $ref: '#/components/schemas/JourneyActivationStep'
            - $ref: '#/components/schemas/JourneyDecisionPointStep'
            - $ref: '#/components/schemas/JourneyMergeStep'
            - $ref: '#/components/schemas/JourneyJumpStep'
            - $ref: '#/components/schemas/JourneyEndStep'
            - $ref: '#/components/schemas/JourneyAbTestStep'
    JourneyWaitStep:
      type: object
      oneOf:
        - $ref: '#/components/schemas/JourneyWaitStepDuration'
        - $ref: '#/components/schemas/JourneyWaitStepDate'
        - $ref: '#/components/schemas/JourneyWaitStepDaysOfTheWeek'
        - $ref: '#/components/schemas/JourneyWaitStepCondition'
    JourneyWaitStepDuration:
      type: object
      required:
        - type
        - name
        - waitStepType
        - waitStep
        - waitStepUnit
      properties:
        type:
          enum:
            - WaitStep
        name:
          type: string
        waitStepType:
          enum:
            - Duration
        waitStep:
          type: integer
        waitStepUnit:
          type: string
          enum:
            - day
            - week
        next:
          type: string
    JourneyWaitStepDate:
      type: object
      required:
        - type
        - name
        - waitStepType
        - waitUntilDate
        - timezone
      properties:
        type:
          enum:
            - WaitStep
        name:
          type: string
        waitStepType:
          enum:
            - Date
        waitUntilDate:
          type: string
          format: date
        timezone:
          type: string
        next:
          type: string
    JourneyWaitStepDaysOfTheWeek:
      type: object
      required:
        - type
        - name
        - waitStepType
        - waitUntilDaysOfTheWeek
        - timezone
      properties:
        type:
          enum:
            - WaitStep
        name:
          type: string
        waitStepType:
          enum:
            - DaysOfTheWeek
        waitUntilDaysOfTheWeek:
          type: array
          description: >
            Array of integer representing the day of the week.

            1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6:
            Saturday, 7: Sunday
          example:
            - 1
            - 5
            - 6
          items:
            type: integer
            minimum: 1
            maximum: 7
          minItems: 1
          uniqueItems: true
        timezone:
          type: string
        next:
          type: string
    JourneyWaitStepCondition:
      type: object
      required:
        - type
        - name
        - waitStepType
        - conditions
      properties:
        type:
          enum:
            - WaitStep
        waitStepType:
          enum:
            - Condition
        conditions:
          type: array
          minItems: 1
          maxItems: 2
          description: >-
            the path with segment is required, but the path with moveAfter as
            timedOutPath = true is optional
          items:
            $ref: '#/components/schemas/JourneyWaitStepConditionPath'
        description:
          type: string
          nullable: true
    JourneyWaitStepConditionPath:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        name:
          type: string
        segmentId:
          type: string
          pattern: '[1-9][0-9]*'
          description: required if timedOutPath = false
          nullable: true
        timedOutPath:
          type: boolean
        moveAfter:
          type: integer
          minimum: 1
        unit:
          type: string
          enum:
            - day
            - week
        next:
          type: string
    JourneyActivationStep:
      type: object
      required:
        - type
        - name
        - journeyActivationStepId
      properties:
        type:
          enum:
            - Activation
        name:
          type: string
        journeyActivationStepId:
          type: string
          pattern: '[1-9][0-9]*'
        next:
          type: string
    JourneyDecisionPointStep:
      type: object
      required:
        - type
        - name
        - branches
      properties:
        type:
          enum:
            - DecisionPoint
        name:
          type: string
        branches:
          type: array
          items:
            $ref: '#/components/schemas/JourneyDecisionPointBranch'
    JourneyDecisionPointBranch:
      type: object
      required:
        - name
        - segmentId
      properties:
        name:
          type: string
        segmentId:
          type: string
          pattern: '[1-9][0-9]*'
        excludedPath:
          type: boolean
        next:
          type: string
    JourneyMergeStep:
      type: object
      required:
        - type
      properties:
        type:
          enum:
            - Merge
        name:
          type: string
        next:
          type: string
    JourneyJumpStep:
      type: object
      required:
        - type
        - name
        - target
      properties:
        type:
          enum:
            - Jump
        name:
          type: string
        target:
          $ref: '#/components/schemas/JourneyJumpTarget'
    JourneyJumpTarget:
      type: object
      required:
        - journeyId
        - journeyStageId
      properties:
        journeyId:
          type: string
          pattern: '[1-9][0-9]*'
        journeyStageId:
          type: string
          pattern: '[1-9][0-9]*'
        journeyBundleId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
        stageOrderIndex:
          type: integer
          nullable: true
        jumpReferenceId:
          description: >-
            The reference id of the jump target. This is used to identify the
            jump entity in the included field.
          type: string
          nullable: true
    JourneyEndStep:
      type: object
      nullable: true
      properties:
        type:
          enum:
            - End
        name:
          type: string
    JourneyAbTestStep:
      type: object
      required:
        - type
        - name
        - customizedSplit
        - variants
      properties:
        type:
          enum:
            - AbTest
        name:
          type: string
        customizedSplit:
          type: boolean
        uniqueId:
          type: string
        variants:
          type: array
          items:
            $ref: '#/components/schemas/JourneyAbTestVariant'
    JourneyAbTestVariant:
      type: object
      required:
        - id
        - name
        - percentage
      properties:
        id:
          type: string
        name:
          type: string
        percentage:
          type: number
        next:
          type: string
    EntitiesListJourneyActivationStepJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneyActivationStepJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesGetJourneyActivationStepJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/JourneyActivationStepJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    JourneyActivationStepJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journeyActivationStep
        attributes:
          type: object
          required:
            - activationId
            - activationParams
          properties:
            activationId:
              type: string
              pattern: '[1-9][0-9]*'
              nullable: true
            activationParams:
              $ref: >-
                #/components/schemas/partial_journey_activation_step.yaml-JourneyActivationParams
        relationships:
          type: object
          properties:
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    EntitiesGetJourneyStatisticsJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/JourneyStatisticsJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    JourneyStatisticsJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journeyStatistic
        attributes:
          type: object
          required:
            - size
            - goalSize
            - enteredSize
            - completionRate
            - exitOrJumpSize
            - exitOrJumpRate
            - history
            - journeyStageStatistics
          properties:
            size:
              type: number
            goalSize:
              type: number
            enteredSize:
              type: number
            completionRate:
              type: number
              format: float
              minimum: 0
              maximum: 100
            exitOrJumpSize:
              type: number
            exitOrJumpRate:
              type: number
              format: float
              minimum: 0
              maximum: 100
            history:
              type: array
              items:
                $ref: '#/components/schemas/JourneyStatisticsHistory'
            journeyStageStatistics:
              $ref: '#/components/schemas/JourneyStageStatisticsJsonApiResource'
    JourneyStageStatisticsJsonApiResource:
      type: array
      items:
        $ref: '#/components/schemas/JourneyStageStatistic'
    JourneyStageStatistic:
      type: object
      required:
        - id
        - enteredSize
        - milestoneSize
        - completeMilestoneRate
        - exitOrJumpSize
        - exitOrJumpRate
        - history
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        enteredSize:
          type: number
        milestoneSize:
          type: number
        completeMilestoneRate:
          type: number
          format: float
          minimum: 0
          maximum: 100
        exitOrJumpSize:
          type: number
        exitOrJumpRate:
          type: number
          format: float
          minimum: 0
          maximum: 100
        history:
          type: array
          items:
            $ref: '#/components/schemas/JourneyStageStatisticHistory'
    JourneyStatisticsHistory:
      type: object
      required:
        - updatedAt
        - size
        - entryInflux
        - goalInflux
        - exitInflux
        - jumpInflux
      properties:
        updatedAt:
          type: string
          format: datetime
        size:
          type: number
        entryInflux:
          type: number
        goalInflux:
          type: number
        exitInflux:
          type: number
        jumpInflux:
          type: number
    JourneyStageStatisticHistory:
      type: object
      required:
        - updatedAt
        - journeyStageId
        - size
        - exitSizes
        - entryInflux
        - milestoneInflux
        - exitInflux
        - jumpInflux
      properties:
        updatedAt:
          type: string
          format: datetime
        journeyStageId:
          type: string
          pattern: '[1-9][0-9]*'
        size:
          type: number
        exitSizes:
          type: array
          nullable: true
          items:
            type: number
        entryInflux:
          type: number
        milestoneInflux:
          type: number
        exitInflux:
          type: number
        jumpInflux:
          type: number
    EntitiesGetJourneyConversionSankeyChartsJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/JourneySankeyCharts'
    EntitiesGetJourneyActivationSankeyChartsJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/JourneySankeyCharts'
    JourneyActivationSankeyCharts:
      type: object
      properties:
        stageId:
          $ref: '#/components/schemas/JourneySankeyCharts'
    JourneySankeyCharts:
      type: array
      items:
        $ref: '#/components/schemas/JourneySankeyChart'
    JourneySankeyChart:
      type: object
      properties:
        attributes:
          type: object
          properties:
            updatedAt:
              type: string
              format: datetime
            journeyStageId:
              type: string
              pattern: '[1-9][0-9]*'
              nullable: true
            chart:
              type: object
              properties:
                title:
                  type: string
                chartType:
                  type: string
                  enum:
                    - sankey
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/JourneySankeyChartNode'
                metaData:
                  type: object
                  properties:
                    links:
                      type: array
                      items:
                        $ref: '#/components/schemas/JourneySankeyChartLink'
    JourneySankeyChartNode:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: object
          properties:
            id:
              type: string
            type:
              type: string
              enum:
                - stage
                - goal
                - exit
                - jump
                - activation
                - milestone
    JourneySankeyChartLink:
      type: object
      required:
        - source
        - target
        - value
      properties:
        source:
          type: string
        target:
          type: string
        value:
          type: number
        conversionRate:
          type: number
    EntitiesGetJourneyCustomersJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/JourneyProfilesJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    JourneyProfilesJsonApiResource:
      type: object
      required:
        - names
        - rows
      properties:
        names:
          type: array
          items:
            type: string
        rows:
          type: array
          items:
            type: array
            description: a tuple whose values corresponding names property
            example:
              - 003171af29a5f0ac890fed022d9e5366dea5d68e
              - a@example.com
            items:
              oneOf:
                - type: string
                  nullable: true
                - type: integer
                  format: int64
                - type: number
                  format: float
    EntitiesGetJourneySegmentRulesJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneySegmentRulesJsonApiResource'
    JourneySegmentRulesJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journeySegmentRule
        attributes:
          type: object
          required:
            - journeyId
            - journeyStageId
            - name
            - location
            - journeyBundleName
            - journeyBundleId
          properties:
            journeyId:
              type: string
              pattern: '[1-9][0-9]*'
            journeyStageId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            location:
              type: string
            journeyBundleName:
              type: string
            journeyState:
              type: string
              enum:
                - draft
                - launched
            journeyPaused:
              type: boolean
            journeyVersionNumber:
              type: integer
            journeyIsLatestVersion:
              type: boolean
    JourneyJumpFromJourney:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - journey
        attributes:
          type: object
          required:
            - name
          properties:
            name:
              type: string
            jumpType:
              type: string
            jumpName:
              type: string
              nullable: true
            sourceJourneyId:
              type: string
              pattern: '[1-9][0-9]*'
            folderName:
              type: string
            targetJourneyId:
              type: string
              pattern: '[1-9][0-9]*'
            targetStageId:
              type: string
              pattern: '[1-9][0-9]*'
            targetStageName:
              type: string
            deletedBy:
              type: string
              nullable: true
    EntitiesGetWorkflowProjectsJsonApiResult:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - id
              - type
            properties:
              id:
                type: string
                pattern: '[1-9][0-9]*'
              type:
                type: string
                enum:
                  - workflow-project
              attributes:
                type: object
                properties:
                  name:
                    type: string
    EntitiesGetWorkflowsJsonApiResult:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - id
              - type
            properties:
              id:
                type: string
                pattern: '[1-9][0-9]*'
              type:
                type: string
                enum:
                  - workflow
              attributes:
                type: object
                properties:
                  name:
                    type: string
    EntitiesGetMatchedActivationsJsonApiResult:
      type: object
      properties:
        data:
          type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
            type:
              type: string
              enum:
                - matched-activations
            attributes:
              type: object
              properties:
                count:
                  type: integer
                  format: int64
    ActivationTemplateFieldProperties:
      description: activation template field properties
      type: object
      properties:
        locked:
          $ref: '#/components/schemas/ActivationTemplateFieldPropertiesLocked'
      required:
        - locked
    ActivationTemplateFieldPropertiesLocked:
      description: activation template field properties locked
      type: object
      properties:
        allColumns:
          type: boolean
        columns:
          type: object
          example:
            b24bf298-4f8c-4e8a-8187-38f2efc781d9:
              column: true
              source: true
              lockDeleteColumn: false
            c97c5711-31dd-4563-aca9-795c0b429593:
              column: true
              source: true
              lockDeleteColumn: false
        connectionId:
          type: boolean
        connectorConfig:
          type: object
          nullable: true
          example:
            userDatabaseName: true
            userTableName: true
            legacy: false
            mode: false
        activationActionsEnabled:
          type: boolean
        syndicationBehavior:
          type: object
          nullable: true
          properties:
            tableName:
              type: string
              description: Behavior table name which contains behavior records
              example: purchase_history
            columns:
              type: object
              example:
                0ae6e876-9d9d-4217-8be2-f8646000d0c2:
                  column: true
                  source: true
                  lockDeleteColumn: false
                b71d422e-4f29-47d5-b072-7e598275a402:
                  column: true
                  source: true
                  lockDeleteColumn: false
            lockAddColumn:
              type: boolean
            lockDeleteBehaviorTable:
              type: boolean
            lockEditBehaviorTable:
              type: boolean
            lockEditJoinRow:
              type: boolean
            lockEditJoinStrategy:
              type: boolean
            lockEditFormatting:
              type: boolean
            lockEditOrderBy:
              type: boolean
        lockAddColumn:
          type: boolean
        lockAddString:
          type: boolean
        lockAddBehavior:
          type: boolean
        lockEditSchedule:
          type: boolean
        lockEditNotification:
          type: boolean
        lockEditWorkflowExecution:
          type: boolean
        lockEditSequentialActivation:
          type: boolean
    ActivationTemplateSyndicationBehaviorProperties:
      type: object
      properties:
        columns:
          $ref: '#/components/schemas/Columns'
        behaviorTableName:
          type: string
          description: Behavior table name which contains behavior records
          example: purchase_history
        joinRow:
          type: integer
          description: How much rows would be joined (value is N for Top-N join)
          example: 3
          nullable: true
        joinStrategy:
          type: string
          example: Last
          enum:
            - All
            - First
            - Last
            - Top-N
        formatting:
          type: string
          enum:
            - rows
            - cols
        orderBy:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              order:
                type: string
                enum:
                  - ascending
                  - descending
            example:
              key: purchased_at
              order: descending
          example:
            - key: purchased_at
              order: descending
            - key: price
              order: ascending
    ActivationTemplateJsonApiParameters:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        kind:
          type: integer
          description: '0: batch, 1: batch_journey (default is 0)'
        allColumns:
          description: >-
            syndication all column flag  ('true' means  that you use all
            attribute data)
          type: boolean
        columns:
          $ref: '#/components/schemas/Columns'
        scheduleType:
          $ref: '#/components/schemas/DeprecatedScheduleType'
        scheduleOption:
          type: string
        timezone:
          type: string
        startAt:
          $ref: '#/components/schemas/StartAt'
        endOn:
          type: string
          format: date
          nullable: true
        repeatUnit:
          $ref: '#/components/schemas/RepeatUnit'
        repeatFrequency:
          $ref: '#/components/schemas/RepeatFrequency'
        repeatSubFrequency:
          $ref: '#/components/schemas/RepeatSubFrequency'
        connectionId:
          type: integer
          format: int64
        connectorConfig:
          type: object
          nullable: true
        notifyOn:
          type: array
          items:
            type: string
            enum:
              - onSuccess
              - onFailure
        emailRecipients:
          type: array
          items:
            description: User ID of td-api. Not CDP-API's one.
            type: integer
            format: int64
        state:
          type: string
          enum:
            - draft
            - published
        nestedWorkflowProjectName:
          type: string
          nullable: true
        nestedWorkflowName:
          type: string
          nullable: true
        lockEnabled:
          type: boolean
        runAfterJourneyRefresh:
          description: >-
            If true, this activation step will be executed immediately after the
            journey is refreshed. Only available for kind of journey.
          type: boolean
        syndicationBehavior:
          nullable: true
          allOf:
            - $ref: >-
                #/components/schemas/ActivationTemplateSyndicationBehaviorProperties
        fieldProperties:
          $ref: '#/components/schemas/ActivationTemplateFieldProperties'
      required:
        - name
        - connectionId
        - state
    ActivationTemplateJsonApiResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - activation-template
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            kind:
              type: integer
              description: '0: batch, 1: batch_journey'
            allColumns:
              description: >-
                activation all column flag  ('true' means that you use all
                attribute data)
              type: boolean
            columns:
              oneOf:
                - $ref: '#/components/schemas/Columns'
                - $ref: '#/components/schemas/NullValue'
            scheduleType:
              $ref: '#/components/schemas/DeprecatedScheduleType'
            scheduleOption:
              type: string
              nullable: true
            timezone:
              type: string
              nullable: true
            startAt:
              $ref: '#/components/schemas/StartAt'
            endOn:
              type: string
              format: date
              nullable: true
            repeatUnit:
              $ref: '#/components/schemas/RepeatUnit'
            repeatFrequency:
              $ref: '#/components/schemas/RepeatFrequency'
            repeatSubFrequency:
              $ref: '#/components/schemas/RepeatSubFrequency'
            connectionId:
              type: string
              pattern: '[1-9][0-9]*'
              nullable: true
            connectorConfig:
              type: object
              nullable: true
            notifyOn:
              type: array
              items:
                type: string
                enum:
                  - onSuccess
                  - onFailure
            emailRecipients:
              type: array
              items:
                description: User ID of td-api. Not CDP-API's one.
                type: integer
                format: int64
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            state:
              type: string
              enum:
                - draft
                - published
            nestedWorkflowProjectName:
              type: string
              nullable: true
            nestedWorkflowName:
              type: string
              nullable: true
            activationActionsEnabled:
              type: boolean
            lockEnabled:
              type: boolean
            runAfterJourneyRefresh:
              description: >-
                If true, this activation step will be executed immediately after
                the journey is refreshed. Only available for kind of journey.
              type: boolean
              nullable: true
            syndicationBehavior:
              nullable: true
              allOf:
                - $ref: >-
                    #/components/schemas/ActivationTemplateSyndicationBehaviorProperties
            fieldProperties:
              $ref: '#/components/schemas/ActivationTemplateFieldProperties'
            activationCount:
              type: integer
              description: Number of related activations
            journeyCount:
              type: integer
              description: Number of related journeys
            available:
              type: boolean
              description: >-
                This template is available or not (It contains PBP PII BLOCKED
                columns or not)
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    ActivationTemplateIndexJsonApiResponse:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - activation-template
        attributes:
          type: object
          required:
            - audienceId
            - name
            - description
            - createdAt
            - updatedAt
          properties:
            audienceId:
              type: string
              pattern: '[1-9][0-9]*'
            name:
              type: string
            description:
              type: string
              nullable: true
            kind:
              type: integer
              description: '0: batch, 1: batch_journey'
            allColumns:
              description: >-
                activation all column flag  ('true' means that you use all
                attribute data)
              type: boolean
            columns:
              oneOf:
                - $ref: '#/components/schemas/Columns'
                - $ref: '#/components/schemas/NullValue'
            scheduleType:
              $ref: '#/components/schemas/DeprecatedScheduleType'
            scheduleOption:
              type: string
              nullable: true
            timezone:
              type: string
              nullable: true
            startAt:
              $ref: '#/components/schemas/StartAt'
            endOn:
              type: string
              format: date
              nullable: true
            repeatUnit:
              $ref: '#/components/schemas/RepeatUnit'
            repeatFrequency:
              $ref: '#/components/schemas/RepeatFrequency'
            repeatSubFrequency:
              $ref: '#/components/schemas/RepeatSubFrequency'
            connectionId:
              type: string
              pattern: '[1-9][0-9]*'
              nullable: true
            connectorConfig:
              type: object
              nullable: true
            notifyOn:
              type: array
              items:
                type: string
                enum:
                  - onSuccess
                  - onFailure
            emailRecipients:
              type: array
              items:
                description: User ID of td-api. Not CDP-API's one.
                type: integer
                format: int64
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
            state:
              type: string
              enum:
                - draft
                - published
            nestedWorkflowProjectName:
              type: string
              nullable: true
            nestedWorkflowName:
              type: string
              nullable: true
            activationActionsEnabled:
              type: boolean
            lockEnabled:
              type: boolean
            runAfterJourneyRefresh:
              description: >-
                If true, this activation step will be executed immediately after
                the journey is refreshed. Only available for kind of journey.
              type: boolean
              nullable: true
            syndicationBehavior:
              nullable: true
              allOf:
                - $ref: >-
                    #/components/schemas/ActivationTemplateSyndicationBehaviorProperties
            fieldProperties:
              $ref: '#/components/schemas/ActivationTemplateFieldProperties'
            activationCount:
              type: integer
              description: Number of related activations
            available:
              type: boolean
              description: >-
                This template is available or not (It contains PBP PII BLOCKED
                columns or not)
            availableBySegment:
              type: boolean
              description: >-
                This template is available by the segment or not (It return only
                with `availableBySegmentId` parameter)
            availableByStep:
              type: boolean
              description: >-
                This template is available by the step or not (It is returned
                only when
                `/entities/journeys/{journeyId}/activation_templates_for_step`
                is called)
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    EntitiesGetActivationTemplateJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/ActivationTemplateJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesActivationTemplateIndexJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ActivationTemplateIndexJsonApiResponse'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesActivationTemplateUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - activation-template
        attributes:
          $ref: '#/components/schemas/ActivationTemplateJsonApiParameters'
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    SegmentInsightsIndexResponse:
      type: array
      description: An array of Segment Insight dashboards
      items:
        $ref: '#/components/schemas/SegmentInsightDashboard'
    SegmentInsightDashboardParameter:
      type: object
      description: The parameter for Segment Insight Dashboard
      properties:
        id:
          type: string
          nullable: true
          description: >-
            When validate the changes of an existing dashboard, this dashboard
            id must be specified
        name:
          type: string
        description:
          type: string
          nullable: true
        default:
          type: boolean
        widgets:
          type: array
          items:
            $ref: '#/components/schemas/SegmentInsightDashboardWidget'
        updatedBy:
          $ref: '#/components/schemas/User'
    SegmentInsightDashboard:
      type: object
      description: A Segment Insight dashboard
      properties:
        id:
          type: string
          format: '[1-9][0-9]*'
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
          nullable: true
        default:
          type: boolean
          description: >-
            Whether the dashboard is the default dashboard or not. Default is
            false
        widgets:
          type: array
          items:
            $ref: '#/components/schemas/SegmentInsightDashboardWidget'
        details:
          type: object
          description: >-
            If request has `with_details` option true, this object will be
            filled
          nullable: true
          properties:
            numberOfSegmentUses:
              type: integer
              format: int64
    SegmentInsightDashboardWidget:
      type: object
      description: A Segment Insight dashboard widget
      properties:
        attribute:
          type: string
          description: An attribute of a segment
        title:
          type: string
        calculationType:
          type: string
          description: Type of calculation
          enum:
            - distribution
            - sum
            - average
            - countDistinct
        chartType:
          type: string
          description: Type of chart
          enum:
            - column
            - categoricalStacked
            - numericalStacked
            - ranking
            - pie
            - histogram
            - indicator
        options:
          type: object
          description: A required option if the chart type is histogram
          nullable: true
          properties:
            lowerLimit:
              type: integer
              format: int64
            upperLimit:
              type: integer
              format: int64
            bins:
              type: integer
              format: int64
            additionalAttribute:
              type: string
              description: >-
                The name of an attribute to be used for the additional axis of
                the stacked chart
              nullable: true
            measurementType:
              type: string
              description: Type of measurement for the stacked chart
              enum:
                - count
                - percentage
              nullable: true
            xAxisAttribute:
              type: string
              description: >-
                The name of the attribute to be set as the x-axis for the
                stacked chart
              nullable: true
        metadata:
          type: object
          description: Additional metadata for the widget
          nullable: true
          properties:
            dimensions:
              type: array
              description: The legends for cross tabular charts
              items:
                type: string
              nullable: true
        data:
          type: array
          description: A list of datapoints
          nullable: true
          items:
            $ref: '#/components/schemas/SegmentInsightDashboardWidgetDatapoint'
    SegmentInsightDashboardWidgetDatapoint:
      type: object
      description: A datapoint in the Segment Insight Dashboard Widget
      properties:
        label:
          description: The label of the datapoint
          nullable: true
          type: string
        value:
          description: The value of the datapoint
          nullable: true
          anyOf:
            - type: number
            - type: array
              description: Pairs of label and value of data points for cross tabular charts
              items:
                type: object
                properties:
                  label:
                    type: string
                  value:
                    type: number
        bin:
          description: The number of bin the datapoint belongs to
          nullable: true
          type: integer
    SegmentInsightQueryStatus:
      type: object
      description: Status of Segment Insight Query
      properties:
        queryId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - success
            - killed
            - error
            - running
        error:
          type: string
          nullable: true
        jobId:
          type: string
          format: integer
          description: Presto Job ID
        dashboard:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/SegmentInsightDashboard'
    SegmentInsightQueryParameter:
      type: object
      properties:
        columns:
          type: array
          items:
            type: string
        rule:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule'
        dashboardId:
          type: integer
          format: int64
          nullable: true
          description: To specify the Segment Insight Dashboard
    SegmentInsightDashboardValidationResult:
      type: object
      description: A list of validation errors for a Segment Insight Dashboard
      properties:
        errors:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/JsonApiValidationError'
    MlSolution:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
          nullable: true
        solutionType:
          $ref: '#/components/schemas/MlSolutionType'
        behaviorName:
          type: string
          description: Behavior name for input data
        targetColumn:
          type: string
          description: Target column name for the prediction
        outputFolderId:
          type: string
          pattern: '[1-9][0-9]*'
          description: Output folder id for segment generation
        state:
          type: string
          enum:
            - draft
            - published
        lastPublishedAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Last published date time. If null, it means the solution is not
            published yet.
    MlSolutionExecution:
      allOf:
        - $ref: '#/components/schemas/ExecutionCore'
        - type: object
          properties:
            mlSolutionId:
              type: string
              pattern: '[1-9][0-9]*'
            modelParams:
              anyOf:
                - $ref: '#/components/schemas/MlSolutionRfmParams'
                - $ref: '#/components/schemas/MlSolutionCltvParams'
            mlOutputs:
              type: object
              nullable: true
          required:
            - mlSolutionId
    MlSolutionRfmParams:
      type: object
      nullable: true
      description: >-
        RFM ML workflow parameters. The parameter names are based on the RFM
        workflow.
      properties:
        docker:
          type: object
          properties:
            taskMem:
              type: string
              description: Task memory size. e.g. 256g
        notebook:
          type: string
          description: Notebook name for ML operator
        inputTable:
          type: string
          description: Input table name. Should be generated by Behavior
        userColumn:
          type: string
          description: User column name for input data. Should be generated by Behavior
        tstampColumn:
          type: string
          description: >-
            Timestamp column name for input data. If not specified, the column
            will be generated by time
          nullable: true
        outputTable:
          type: string
          description: Output table name. Should be generated based on ML solution id
        amountColumn:
          type: string
          description: Amount column name for monetary value.
        minClusters:
          type: integer
          minimum: 1
          nullable: true
        maxClusters:
          type: integer
          minimum: 1
          nullable: true
        numClusters:
          type: integer
          minimum: 1
          nullable: true
        dashboardOutput:
          type: boolean
          description: Build a notebook for dashboard if true
      required:
        - inputTable
        - userColumn
        - outputTable
    MlSolutionCltvParams:
      type: object
      nullable: true
      description: >-
        CLTV ML workflow parameters. The parameter names are based on the CLTV
        workflow.
      properties:
        docker:
          type: object
          properties:
            taskMem:
              type: string
              description: Task memory size. e.g. 256g
        notebook:
          type: string
          description: Notebook name for ML operator
        inputTable:
          type: string
          description: Input table name. Should be generated by Behavior
        userColumn:
          type: string
          description: User column name for input data. Should be generated by Behavior
        tstampColumn:
          type: string
          description: >-
            Timestamp column name for input data. If not specified, the column
            will be generated by time
          nullable: true
        outputTable:
          type: string
          description: Output table name. Should be generated based on ML solution id
        amountColumn:
          type: string
          description: Amount column name for monetary value.
        discountRate:
          type: number
          format: float
        segmentTimeHorizon:
          type: string
          description: Time horizon for CLTV segments in 1m/3m/6m/12m/24m
        dashboardOutput:
          type: boolean
          description: Build a notebook for dashboard if true
      required:
        - inputTable
        - userColumn
        - outputTable
    MlSolutionJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - mlSolution
        attributes:
          allOf:
            - $ref: '#/components/schemas/MlSolutionAttributes'
            - type: object
              properties:
                createdAt:
                  type: string
                  format: date-time
                updatedAt:
                  type: string
                  format: date-time
                lastPublishedAt:
                  type: string
                  format: date-time
                  nullable: true
                  description: >-
                    Last published date time. If null, it means the solution is
                    not published yet.
              required:
                - createdAt
                - updatedAt
                - lastPublishedAt
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            outputFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            createdBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
            updatedBy:
              $ref: '#/components/schemas/RelationshipsUserJsonApiResource'
    MlSolutionType:
      type: string
      enum:
        - rfm
        - cltv
    EntitiesMlSolutionUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - mlSolution
        attributes:
          $ref: '#/components/schemas/MlSolutionUpdateAttributes'
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    MlSolutionUpdateAttributes:
      allOf:
        - $ref: '#/components/schemas/MlSolutionCoreUpdateAttributes'
        - oneOf:
            - $ref: '#/components/schemas/MlSolutionRfmAttributes'
            - $ref: '#/components/schemas/MlSolutionCltvAttributes'
    MlSolutionCoreUpdateAttributes:
      type: object
      required:
        - name
        - targetColumn
        - state
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        targetColumn:
          type: string
          description: Target column name for the prediction
        state:
          type: string
          enum:
            - draft
            - published
    MlSolutionAttributes:
      allOf:
        - $ref: '#/components/schemas/MlSolutionCoreAttributes'
        - oneOf:
            - $ref: '#/components/schemas/MlSolutionRfmAttributes'
            - $ref: '#/components/schemas/MlSolutionCltvAttributes'
    MlSolutionCoreAttributes:
      type: object
      required:
        - name
        - audienceId
        - description
        - targetColumn
        - state
      properties:
        name:
          type: string
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        description:
          type: string
          nullable: true
        targetColumn:
          type: string
          description: Target column name for the prediction
        state:
          type: string
          enum:
            - draft
            - published
    MlSolutionRfmAttributes:
      type: object
      required:
        - solutionType
        - behaviorName
        - targetColumn
      properties:
        solutionType:
          type: string
          enum:
            - rfm
        behaviorName:
          type: string
          description: Behavior name for input data
        timestampColumn:
          type: string
          description: >-
            Timestamp column name for input data. If not specified, the column
            will be generated by time
        minClusters:
          type: integer
          minimum: 1
          nullable: true
        maxClusters:
          type: integer
          minimum: 1
          nullable: true
        numClusters:
          type: integer
          minimum: 1
          nullable: true
    MlSolutionCltvAttributes:
      type: object
      required:
        - solutionType
        - behaviorName
        - targetColumn
      properties:
        solutionType:
          type: string
          enum:
            - cltv
        behaviorName:
          type: string
          description: Behavior name for input data
        timestampColumn:
          type: string
          description: >-
            Timestamp column name for input data. If not specified, the column
            will be generated by time
        discountRate:
          type: number
          format: float
          nullable: true
        segmentTimeHorizon:
          type: string
          description: Time horizon for CLTV segments in 1m/3m/6m/12m/24m
          nullable: true
          example: 12m
    EntitiesGetMlSolutionJsonApiResponse:
      type: object
      required:
        - data
        - included
      properties:
        data:
          $ref: '#/components/schemas/MlSolutionJsonApiResource'
        included:
          type: array
          items:
            $ref: '#/components/schemas/UserJsonApiResource'
    EntitiesGetMlSolutionSegmentRulesJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MlSolutionSegmentRulesJsonApiResource'
    MlSolutionSegmentRulesJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - mlSolutionSegmentRule
        attributes:
          type: object
          required:
            - name
            - state
            - solutionType
          properties:
            name:
              type: string
            state:
              type: string
              enum:
                - draft
                - published
            solutionType:
              type: string
              enum:
                - rfm
                - cltv
            schema:
              oneOf:
                - $ref: '#/components/schemas/MlSolutionRfmRuleSchema'
                - $ref: '#/components/schemas/MlSolutionCltvRuleSchema'
    MlSolutionRfmRuleSchema:
      type: object
      required:
        - rQuartile
        - fQuartile
        - mQuartile
        - rfmScore
        - rfmSegment
        - rfmClusterRank
        - rfmQuartile
      properties:
        rQuartile:
          type: array
          items:
            type: integer
            minimum: 1
            maximum: 4
          example:
            - 1
            - 2
            - 3
            - 4
        fQuartile:
          type: array
          items:
            type: integer
            minimum: 1
            maximum: 4
          example:
            - 1
            - 2
            - 3
            - 4
        mQuartile:
          type: array
          items:
            type: integer
            minimum: 1
            maximum: 4
          example:
            - 1
            - 2
            - 3
            - 4
        rfmScore:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float,
            minimum = 1, maximum= 4. example: 2.6667
        rfmSegment:
          type: array
          items:
            type: string
            enum:
              - Champions
              - Loyal Customers
              - Potential Loyalists
              - New Customers
              - Promising
              - Need attention
              - Cannot lose them
              - Hibernating
              - High Value Sleeping
              - Lost customers
          example:
            - Champions
            - Loyal Customers
            - Potential Loyalists
            - New Customers
            - Promising
            - Need attention
            - Cannot lose them
            - Hibernating
            - High Value Sleeping
            - Lost customers
        rfmClusterRank:
          type: array
          items:
            type: string
            pattern: ^R[1-4]F[1-4]M[1-4]$
          example:
            - R1F1M1
            - R1F1M2
            - R1F1M3
            - R1F1M4
            - R1F2M1
          description: response is array of all patterns R[1-4]F[1-4]M[1-4]
        rfmQuartile:
          type: array
          items:
            type: string
            pattern: ^R[1-4]F[1-4]M[1-4]$
          example:
            - R1F1M1
            - R1F1M2
            - R1F1M3
            - R1F1M4
            - R1F2M1
          description: response is array of all patterns R[1-4]F[1-4]M[1-4]
    MlSolutionCltvRuleSchema:
      type: object
      required:
        - cltv1m
        - cltv1mPctile
        - cltv3m
        - cltv3mPctile
        - cltv6m
        - cltv6mPctile
        - cltv12m
        - cltv12mPctile
        - cltv24m
        - cltv24mPctile
        - aliveProb
        - cltvSegment
      properties:
        cltv1m:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 9.753
        cltv1mPctile:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 82.832
        cltv3m:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 9.753
        cltv3mPctile:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 82.832
        cltv6m:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 9.753
        cltv6mPctile:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 82.832
        cltv12m:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 9.753
        cltv12mPctile:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 82.832
        cltv24m:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 9.753
        cltv24mPctile:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float.
            example: 82.832
        aliveProb:
          type: string
          example: float
          description: >-
            response is fixed string "float". available value as rule is float,
            minimum = 0, maximum= 1. example: 0.6667
        cltvSegment:
          type: array
          items:
            type: string
            enum:
              - Very Low
              - Low
              - Medium
              - High
              - Very High
          example:
            - Very Low
            - Low
            - Medium
            - High
            - Very High
    EntitiesRunMlSolutionExecutionJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/MlSolutionExecutionJsonApiResource'
    EntitiesGetMlSolutionExecutionJsonApiResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MlSolutionExecutionJsonApiResource'
    MlSolutionExecutionJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
      properties:
        id:
          type: string
          format: '[1-9][0-9]*'
          description: workflowAttemptId is used as id
        type:
          type: string
          enum:
            - execution-ml-solution
        attributes:
          $ref: '#/components/schemas/MlSolutionExecution'
    partial_journey.yaml-EntitiesJourneyBundleActivationSankeyChartsJsonApiResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneyActivationSankeyCharts'
        included:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
    partial_journey.yaml-EntitiesJourneyBundleActivationsJsonApiResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneyActivationStepJsonApiResource'
        included:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
              - $ref: '#/components/schemas/Syndication'
    partial_journey.yaml-EntitiesJourneyBundleConversionSankeyChartsJsonApiResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneySankeyChart'
        included:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
    partial_journey.yaml-EntitiesJourneyBundleDestroyJsonApiResponse:
      type: object
    partial_journey.yaml-EntitiesJourneyBundleJsonApiResponse:
      type: object
      properties:
        name:
          type: string
          description: Name of the journey bundle
        description:
          type: string
          description: Description of the journey bundle
        latestJourneyId:
          nullable: false
          description: Derived from the initial journey version name
        lastVersionNumber:
          type: integer
          description: >
            The version number of the most recently created journey. If no
            journey has been created, this will be 0.
        journeys:
          type: array
          items:
            $ref: '#/components/schemas/JourneyJsonApiResource'
        latestExecution:
          description: >-
            The most recent execution of the latest journey. If no executions
            have been created, this will be null. 
          allOf:
            - $ref: '#/components/schemas/Execution'
            - type: object
              properties:
                audienceId:
                  type: string
                  format: integer
        parentSegmentLatestExecution:
          description: >-
            The most recent execution of the latest journey. If no executions
            have been created, this will be null. 
          allOf:
            - $ref: '#/components/schemas/Execution'
            - type: object
              properties:
                audienceId:
                  type: string
                  format: integer
        included:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
              - $ref: '#/components/schemas/JourneyJsonApiResource'
    partial_journey.yaml-EntitiesJourneyBundleNewJourneyAppendableJsonApiResponse:
      type: object
    partial_journey.yaml-EntitiesJourneyBundleNewJourneyNotAppendableJsonApiResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/JsonApiValidationError'
    partial_journey.yaml-EntitiesJourneyBundleStatisticsJsonApiResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JourneyStatisticsJsonApiResource'
        included:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/UserJsonApiResource'
    partial_journey.yaml-EntitiesJourneyBundleUpdateRepresentation:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journeyBundle
        attributes:
          $ref: >-
            #/components/schemas/partial_journey.yaml-JourneyBundleMetaAttributes
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    partial_journey.yaml-JourneyBundleNewJourneyAttributes:
      type: object
      properties:
        sourceId:
          type: string
          description: ID of the journey to be copied
        attributes:
          type: object
          properties:
            name:
              type: string
              description: Name of the new journey
    partial_journey_activation_step.yaml-JourneyActivationParams:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        allColumns:
          description: >-
            syndication all column flag  ('true' means  that you use all
            attribute data)
          type: boolean
        columns:
          $ref: '#/components/schemas/Columns'
        scheduleType:
          $ref: '#/components/schemas/ScheduleType'
        scheduleOption:
          type: string
        runAt:
          type: string
        cron:
          type: string
        timezone:
          type: string
        startAt:
          $ref: '#/components/schemas/StartAt'
        endOn:
          type: string
          format: date
          nullable: true
        repeatUnit:
          $ref: '#/components/schemas/RepeatUnit'
        repeatFrequency:
          $ref: '#/components/schemas/RepeatFrequency'
        connectionId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
        connectorConfig:
          type: object
          nullable: true
        notifyOn:
          type: array
          items:
            type: string
            enum:
              - onSuccess
              - onFailure
        emailRecipients:
          type: array
          items:
            description: User ID of td-api. Not CDP-API's one.
            type: integer
            format: int64
        activationTemplateId:
          type: string
          pattern: '[1-9][0-9]*'
        nestedWorkflowProjectName:
          type: string
        nestedWorkflowName:
          type: string
        lockEnabled:
          type: boolean
        activationActionsEnabled:
          type: boolean
        syndicationBehavior:
          type: object
          nullable: true
          properties:
            columns:
              $ref: '#/components/schemas/Columns'
            behaviorTableName:
              type: string
              description: Behavior table name which contains behavior records
              example: purchase_history
            joinRow:
              type: integer
              description: How much rows would be joined (value is N for Top-N join)
              example: 3
              nullable: true
            joinStrategy:
              type: string
              example: Last
              enum:
                - All
                - First
                - Last
                - Top-N
            formatting:
              type: string
              enum:
                - rows
                - cols
            orderBy:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  order:
                    type: string
                    enum:
                      - ascending
                      - descending
                example:
                  key: purchased_at
                  order: descending
              example:
                - key: purchased_at
                  order: descending
                - key: price
                  order: ascending
      required:
        - name
        - connectionId
        - connectorConfig
    partial_journey_priority_group.yaml-JourneyPriorityGroupDuplicateRequest:
      type: object
      properties:
        attributes:
          type: object
          properties:
            name:
              type: string
              description: Name of new priority group
    partial_journey_priority_group.yaml-JourneyPriorityGroupIndexPaginatedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        pagination:
          type: object
          properties:
            nextPage:
              type: string
              description: The path part of URL of the next page
              nullable: true
            totalCount:
              type: integer
              description: The total number of priority groups
              nullable: true
          required:
            - nextPage
      required:
        - data
        - pagination
    partial_journey_priority_group.yaml-JourneyPriorityGroupResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - journeyPriorityGroup
        attributes:
          allOf:
            - $ref: >-
                #/components/schemas/partial_journey_priority_group.yaml-JourneyPriorityGroupAttributes
    partial_pagination.yaml-PaginatedResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        pagination:
          type: object
          properties:
            nextPage:
              type: string
              description: The path part of URL of the next page
              nullable: true
          required:
            - nextPage
      required:
        - data
        - pagination
    partial_realtime_journey.yaml-ParentSegmentRealtimeAttributeAttributes:
      oneOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeSingleAttributeAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeListAttributeAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeCounterAttributeAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeImportedAttributeAttributes
      discriminator:
        propertyName: type
        mapping:
          single: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeSingleAttributeAttributes
          list: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeListAttributeAttributes
          counter: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeCounterAttributeAttributes
          imported: >-
            #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeImportedAttributeAttributes
    partial_realtime_journey.yaml-RealtimeAttributeAttributes:
      oneOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeImportedAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeSingleAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributes
      discriminator:
        propertyName: type
        mapping:
          imported: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeImportedAttributes
          single: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeSingleAttributes
          list: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributes
          counter: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributes
    partial_realtime_journey.yaml-RealtimeAttributeDurationSetting:
      type: object
      properties:
        value:
          type: integer
        unit:
          type: string
          enum:
            - hour
            - day
            - minute
      required:
        - value
        - unit
    partial_realtime_journey.yaml-RealtimeJourneyActivationStepAttributes:
      type: object
      required:
        - connectionId
        - connectorType
        - connector
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        stepUuid:
          type: string
        connectionId:
          type: string
        connectorType:
          type: string
        connector:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeActivationParameters
    partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - realtime-journey-activation-step
        attributes:
          allOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepAttributes
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepReadonlyAttributes
    partial_realtime_journey.yaml-RealtimeJourneyAttributes:
      type: object
      required:
        - audienceId
        - segmentFolderId
        - name
        - description
        - goal
        - realtimeJourneyStages
        - reentryMode
      properties:
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        segmentFolderId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
          nullable: true
        goal:
          anyOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCriteriaWithTarget
            - type: object
              additionalProperties: false
              nullable: true
        realtimeJourneyStages:
          type: array
          minLength: 1
          maxLength: 8
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyStageAttributes
        reentryMode:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyReentryMode
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyByFolderResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - realtime-journey
        attributes:
          type: object
          required:
            - name
            - description
            - state
            - paused
            - realtimeJourneyStages
          properties:
            name:
              type: string
            description:
              type: string
            state:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyState
            paused:
              type: boolean
            realtimeJourneyStages:
              type: array
              items:
                type: object
                required:
                  - name
                properties:
                  id:
                    type: string
                  name:
                    type: string
          additionalProperties: false
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
          required:
            - parentFolder
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyDetailAttributes:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        realtimeJourneyStages:
          type: array
          minLength: 1
          maxLength: 8
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyStageDetailAttributes
    partial_realtime_journey.yaml-RealtimeJourneyDuplicateJsonApiResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
          description: source journey id
        type:
          type: string
          enum:
            - journey
        attributes:
          type: object
          required:
            - name
          properties:
            name:
              type: string
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    partial_realtime_journey.yaml-RealtimeJourneyResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - realtime-journey
        attributes:
          allOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyAttributes
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyReadonlyAttributes
        relationships:
          type: object
          properties:
            createdBy:
              $ref: '#/components/schemas/User'
            updatedBy:
              $ref: '#/components/schemas/User'
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
            realtimeJourneyActivationSteps:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStepResource
                meta:
                  type: object
                  properties:
                    names:
                      additionalProperties:
                        type: string
                  additionalProperties: false
              required:
                - data
                - meta
            jumpLinks:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpLinkResource
                meta:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpLinksMeta
              required:
                - data
                - meta
            jumpFroms:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpLinkResource
                meta:
                  $ref: >-
                    #/components/schemas/partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpFromsMeta
              required:
                - data
                - meta
          additionalProperties: false
    partial_realtime_journey.yaml-RealtimeKeyEventAttributes:
      type: object
      required:
        - name
        - databaseName
        - tableName
        - filterRule
      properties:
        name:
          type: string
        databaseName:
          type: string
        tableName:
          type: string
        filterRule:
          type: object
          properties:
            todo:
              type: string
          nullable: false
    partial_realtime_journey.yaml-RealtimeKeyEventColumn:
      type: object
      properties:
        queryAs:
          type: string
        dataColumn:
          type: string
        dataType:
          $ref: '#/components/schemas/ColumnType'
      required:
        - queryAs
        - dataColumn
        - dataType
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeListAttributeActions:
      type: array
      items:
        type: object
        properties:
          action:
            type: string
            enum:
              - delete_item
              - clear
          realtimeKeyEventId:
            type: string
          filterRule:
            type: object
        required:
          - action
          - realtimeKeyEventId
          - filterRule
        additionalProperties: false
    partial_realtime_journey.yaml-RealtimeListAttributeAggregations:
      type: array
      items:
        $ref: >-
          #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeAggregation
    partial_realtime_journey.yaml-RealtimeListAttributeFields:
      type: array
      items:
        type: string
        nullable: false
        minLength: 1
    partial_realtime_journey.yaml-RealtimePersonalizationAttributes:
      type: object
      required:
        - name
        - description
        - sections
      properties:
        audienceId:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
          nullable: true
        sections:
          type: array
          items:
            allOf:
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationSectionAttributes
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationSectionReadonlyAttributes
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationByFolderResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - realtime-personalization
        attributes:
          type: object
          required:
            - name
            - description
            - sections
          properties:
            name:
              type: string
            description:
              type: string
            sections:
              type: array
              items:
                type: object
                required:
                  - name
                properties:
                  id:
                    type: string
                  name:
                    type: string
          additionalProperties: false
        relationships:
          type: object
          properties:
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
          required:
            - parentFolder
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationResource:
      type: object
      required:
        - id
        - type
        - attributes
        - relationships
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - realtime-personalization
        attributes:
          allOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationAttributes
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationReadonlyAttributes
        relationships:
          type: object
          properties:
            createdBy:
              $ref: '#/components/schemas/User'
            updatedBy:
              $ref: '#/components/schemas/User'
            parentFolder:
              $ref: '#/components/schemas/RelationshipsFolderJsonApiResource'
    partial_realtime_journey.yaml-RealtimePersonalizationSectionAttributes:
      type: object
      required:
        - name
        - entryCriteria
        - payload
      properties:
        name:
          type: string
        entryCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCriteria
        payload:
          type: object
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationServiceAttributes:
      type: object
      required:
        - name
        - description
        - public
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        public:
          type: boolean
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationServiceReadonlyAttributes:
      type: object
      required:
        - tokens
      properties:
        tokens:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimePersonalizationServiceTokenAttributes
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationServiceTokenAttributes:
      type: object
      required:
        - id
        - name
        - value
        - allowedIps
      properties:
        id:
          type: string
        name:
          type: string
        value:
          type: string
          nullable: true
          description: null when masked
        allowedIps:
          type: array
          items:
            type: string
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeSetting:
      allOf:
        - type: object
          properties:
            id:
              type: string
              pattern: '[1-9][0-9]*'
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeSettingAttributes
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeSettingReadonlyAttributes
    partial_realtime_journey.yaml-RealtimeSettingAttributes:
      type: object
      required:
        - keyColumns
        - eventTables
        - batchAttributes
        - extLookupKey
      properties:
        keyColumns:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeKeyColumn
        eventTables:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeEventTable
        batchAttributes:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeBatchAttribute
        extLookupKey:
          type: string
          nullable: true
          description: >-
            one of the attribute of the audience. It can be null at first but
            once set it cannot be null again.
      additionalProperties: false
    partial_v5_rule.yaml-v5IonRule:
      oneOf:
        - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-ionRule'
        - additionalProperties: false
          maxProperties: 0
          minProperties: 0
          type: object
          nullable: true
    partial_journey.yaml-JourneyBundleMetaAttributes:
      type: object
      properties:
        name:
          type: string
          description: Name of the journey bundle
        description:
          type: string
          description: Description of the journey bundle
        latestJourneyId:
          type: string
    partial_journey_priority_group.yaml-JourneyPriorityGroupAttributes:
      type: object
      properties:
        name:
          type: string
          description: Name of the journey priority group
        capping:
          type: integer
          description: >
            The maximum number of journeys that a profile can enter at the same
            time.
        enabled:
          type: boolean
          description: >
            If true, the priority group is active. If false, the priority group
            is inactive.
        audienceId:
          type: string
          description: ID of the audience that the priority group is associated with.
        lastUpdatedAt:
          type: string
          format: date-time
          nullable: true
          description: >
            The date and time when the source tables of the priority group were
            last updated.
        journeyBundles:
          type: array
          minLength: 1
          maxLength: 20
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/partial_journey_priority_group.yaml-InPriorityGroupJourneyBundleAttributes
              - $ref: >-
                  #/components/schemas/partial_journey_priority_group.yaml-InPriorityGroupInvisibleJourneyBundleAttributes
    partial_realtime_journey.yaml-ParentSegmentRealtimeCounterAttributeAttributes:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - counter
        counterType:
          type: string
          enum:
            - sliding
            - total
        increment:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSetting
        notation:
          type: string
        realtimeKeyEventId:
          type: string
        filterRule:
          type: object
        duration:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
        backfill:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeBackfillSetting
        subDurations:
          type: array
          items:
            allOf:
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
              - type: object
                properties:
                  name:
                    type: string
                  identifier:
                    type: string
                  notation:
                    type: string
                required:
                  - name
                  - identifier
                  - notation
      required:
        - name
        - identifier
        - type
        - counterType
        - increment
        - notation
        - realtimeKeyEventId
        - filterRule
        - duration
        - backfill
        - subDurations
      additionalProperties: false
    partial_realtime_journey.yaml-ParentSegmentRealtimeImportedAttributeAttributes:
      type: object
      properties:
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        realtimeAttributeKind:
          type: string
          enum:
            - batch
        type:
          type: string
          enum:
            - imported
        notation:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        column:
          type: string
        identifier:
          type: string
          nullable: true
        dataType:
          anyOf:
            - $ref: '#/components/schemas/ColumnType'
            - type: string
              nullable: true
              description: >-
                This can be null when the corresponding AudienceAttribute is
                removed.
        sensitive:
          type: boolean
          enum:
            - true
            - false
      required:
        - realtimeAttributeKind
        - column
        - dataType
        - notation
      additionalProperties: false
    partial_realtime_journey.yaml-ParentSegmentRealtimeListAttributeAttributes:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - list
        notation:
          type: string
        realtimeKeyEventId:
          type: string
        filterRule:
          type: object
        idColumn:
          type: string
        fields:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeFields
        duration:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
        maxItems:
          type: number
          format: int64
        actions:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeActions
        aggregations:
          type: array
          items:
            allOf:
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeAggregation
              - type: object
                properties:
                  notation:
                    type: string
                required:
                  - notation
      required:
        - name
        - identifier
        - type
        - realtimeKeyEventId
        - filterRule
        - idColumn
        - fields
        - duration
        - maxItems
        - actions
        - aggregations
      additionalProperties: false
    partial_realtime_journey.yaml-ParentSegmentRealtimeSingleAttributeAttributes:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
            - single
        notation:
          type: string
        realtimeKeyEventId:
          type: string
        sensitive:
          type: boolean
          enum:
            - true
            - false
        filterRule:
          type: object
        valueColumn:
          type: string
        dataType:
          type: string
          enum:
            - number
            - string
        duration:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
        backfill:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeBackfillSetting
      required:
        - name
        - identifier
        - type
        - notation
        - realtimeKeyEventId
        - filterRule
        - valueColumn
        - dataType
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeActivationParameters:
      type: object
      properties:
        exportJson:
          type: string
          nullable: true
        exportAdvancedJson:
          type: string
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeBatchAttribute:
      type: object
      properties:
        column:
          type: string
        name:
          type: string
          nullable: true
      required:
        - column
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeCounterAttributes:
      allOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributesBase
        - type: object
          properties:
            type:
              type: string
              enum:
                - counter
            realtimeKeyEventId:
              type: string
            filterRule:
              type: object
            counterType:
              type: string
              enum:
                - sliding
                - total
              default: sliding
            increment:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSetting
            duration:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
            backfill:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeBackfillSetting
            subDurations:
              type: array
              items:
                allOf:
                  - $ref: >-
                      #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
                  - type: object
                    properties:
                      name:
                        type: string
                      identifier:
                        type: string
                    required:
                      - name
                      - identifier
    partial_realtime_journey.yaml-RealtimeEventTable:
      type: object
      properties:
        database:
          type: string
        table:
          type: string
      required:
        - database
        - table
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeImportedAttributes:
      allOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributesBase
        - type: object
          properties:
            type:
              type: string
              enum:
                - imported
    partial_realtime_journey.yaml-RealtimeJourneyActivationStepReadonlyAttributes:
      type: object
      properties:
        realtimeJourneyId:
          type: string
          pattern: '[1-9][0-9]*'
        realtimeJourneyStageId:
          type: string
          pattern: '[1-9][0-9]*'
          nullable: true
          description: null until used in the RT Journey
    partial_realtime_journey.yaml-RealtimeJourneyCriteria:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        keyEventCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyKeyEventCriteria
        profileCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAndBatchIon
      required:
        - name
      nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyCriteriaWithTarget:
      allOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCriteria
        - type: object
          properties:
            target:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyJumpTarget
          nullable: true
    partial_realtime_journey.yaml-RealtimeJourneyReadonlyAttributes:
      type: object
      required:
        - state
        - createdAt
        - updatedAt
        - paused
        - pausedAt
        - launchedAt
      properties:
        state:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyState
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        paused:
          type: boolean
        pausedAt:
          type: string
          format: date-time
          nullable: true
        launchedAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyReentryMode:
      type: string
      enum:
        - reentry_unless_goal_achieved
        - reentry_always
    partial_realtime_journey.yaml-RealtimeJourneyStageAttributes:
      type: object
      required:
        - name
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        name:
          type: string
        description:
          type: string
        steps:
          allOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyStep
            - example:
                58AB9022-B48D-430A-A879-2E13D08CD2C1:
                  type: WaitStep
                  name: Wait 1 hour
                  waitStep: 1
                  waitStepUnit: hour
                  next: 428CA341-3C3E-4D38-8D88-A035CE83A1FF
                428CA341-3C3E-4D38-8D88-A035CE83A1FF:
                  type: TriggeredActivation
                  name: Send mail
                  journeyActivationStepId: '123'
        rootStep:
          type: string
          example: 58AB9022-B48D-430A-A879-2E13D08CD2C1
          nullable: true
        entryCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCriteria
        milestone:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCriteria
        exitCriterias:
          type: array
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyStaleCriteria
              - $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyCustomExitCriteria
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyStageDetailAttributes:
      type: object
      required:
        - name
      properties:
        id:
          type: string
        name:
          type: string
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyState:
      type: string
      enum:
        - draft
        - launched
    partial_realtime_journey.yaml-RealtimeKeyColumn:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        validRegexp:
          type: string
          nullable: true
        invalidTexts:
          type: array
          items:
            type: string
          minLength: 0
        internal:
          type: boolean
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeListAttributeAggregation:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        aggregationType:
          type: string
          enum:
            - first
            - last
            - sum
            - min
            - max
            - distinct_list
        column:
          type: string
    partial_realtime_journey.yaml-RealtimeListAttributes:
      allOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributesBase
        - type: object
          properties:
            type:
              type: string
              enum:
                - list
            realtimeKeyEventId:
              type: string
            filterRule:
              type: object
            idColumn:
              type: string
            fields:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeFields
            duration:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
            maxItems:
              type: number
              format: int64
            actions:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeActions
            aggregations:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeListAttributeAggregations
    partial_realtime_journey.yaml-RealtimePersonalizationReadonlyAttributes:
      type: object
      required:
        - createdAt
        - updatedAt
      properties:
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        referencingRealtimeAttributes:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
                enum:
                  - realtime-attribute
              attributes:
                $ref: >-
                  #/components/schemas/partial_realtime_journey.yaml-ParentSegmentRealtimeAttributeAttributes
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimePersonalizationSectionReadonlyAttributes:
      type: object
      required:
        - id
        - includeSensitive
      properties:
        id:
          type: string
        includeSensitive:
          type: boolean
          enum:
            - true
            - false
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeSettingReadonlyAttributes:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          nullable: false
          enum:
            - initialized
            - updating
            - ok
            - inconsistent
            - not_initialized
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeSingleAttributes:
      allOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributesBase
        - type: object
          properties:
            type:
              type: string
              enum:
                - single
            realtimeKeyEventId:
              type: string
            filterRule:
              type: object
            valueColumn:
              type: string
            dataType:
              type: string
              enum:
                - number
                - string
            duration:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeDurationSetting
            backfill:
              $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAttributeBackfillSetting
    partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpFromsMeta:
      type: array
      items:
        type: object
        properties:
          sourceJourneyId:
            type: string
          sourceJourneyName:
            type: string
          sourceJourneyState:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyState
          sourceJourneyStageId:
            type: string
            nullable: true
            description: null only when jump from goal
          sourceJourneyStageName:
            type: string
            nullable: true
            description: null only when jump from goal
          sourceJourneyFolderId:
            type: string
          sourceJourneyFolderName:
            type: string
          targetJourneyStageId:
            type: string
          jumpFrom:
            type: string
            enum:
              - exit_criteria
              - jump_step
              - goal
          jumpName:
            type: string
        additionalProperties: false
    partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpLinkResource:
      type: object
      properties:
        id:
          type: string
          pattern: '[1-9][0-9]*'
        type:
          type: string
          enum:
            - realtime-journey-jump-link
    partial_realtime_journey.yaml-RelationshipsRealtimeJourneyJumpLinksMeta:
      type: object
      properties:
        targetStageInfo:
          type: object
          additionalProperties:
            type: object
            properties:
              destinationRealtimeJourneyName:
                type: string
                nullable: true
              destinationRealtimeJourneyStageName:
                type: string
                nullable: true
              destinationSegmentFolderName:
                type: string
                nullable: true
              deleted:
                type: boolean
              deletedByTdUserId:
                type: string
                nullable: true
              deletedByTdUserName:
                type: string
                nullable: true
            required:
              - destinationRealtimeJourneyName
              - destinationRealtimeJourneyStageName
              - destinationSegmentFolderName
              - deleted
              - deletedByTdUserId
              - deletedByTdUserName
            additionalProperties: false
    partial_tree.yaml-TreeSegmentFolderIndexItem:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
        name:
          type: string
        parentFolderId:
          type: string
          nullable: true
          description: null if it is top-level.
      required:
        - id
        - name
        - parentFolderId
    partial_v5_rule.yaml-v5IonRule-ionRule:
      properties:
        conditions:
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueConditionSet
          type: array
        expr:
          type: string
        limit:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-valueLimit'
        type:
          enum:
            - Or
            - And
            - Composite
          type: string
      required:
        - conditions
        - type
      type: object
    partial_journey_priority_group.yaml-InPriorityGroupInvisibleJourneyBundleAttributes:
      type: object
      properties:
        id:
          type: string
          description: ID of the journey bundle
        invisible:
          type: boolean
          description: |
            If true, the journey bundle is invalid to display.
    partial_journey_priority_group.yaml-InPriorityGroupJourneyBundleAttributes:
      type: object
      properties:
        id:
          type: string
          description: ID of the journey bundle
        name:
          type: string
          description: Name of the journey bundle
        priority:
          type: integer
          minimum: 1
          description: |
            The priority of the journey bundle in the priority group.
        excludedCount:
          type: integer
          description: >
            The number of profiles that are excluded from the journey bundle due
            to capping.
        currentlyInCount:
          type: integer
          description: |
            The number of profiles that are currently in the journey bundle.
        latestJourney:
          $ref: >-
            #/components/schemas/partial_journey_priority_group.yaml-InPriorityGroupJourneyAttributes
        journeyIds:
          type: array
          items:
            type: string
          description: |
            The IDs of the journeys in the journey bundle.
    partial_realtime_journey.yaml-RealtimeAndBatchIon:
      type: object
    partial_realtime_journey.yaml-RealtimeAttributeBackfillSetting:
      type: object
      properties:
        attributeIdentifier:
          type: string
        timestampIdentifier:
          type: string
      required:
        - attributeIdentifier
        - timestampIdentifier
      additionalProperties: false
      nullable: true
    partial_realtime_journey.yaml-RealtimeAttributesBase:
      type: object
      required:
        - name
        - identifier
        - type
      properties:
        name:
          type: string
        identifier:
          type: string
        type:
          type: string
        description:
          type: string
          nullable: true
        createdBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSetting:
      oneOf:
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingConst
        - $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingField
      discriminator:
        propertyName: type
        mapping:
          const: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingConst
          field: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingField
    partial_realtime_journey.yaml-RealtimeJourneyCustomExitCriteria:
      type: object
      properties:
        name:
          type: string
          nullable: true
        keyEventCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyKeyEventCriteria
        profileCriteria:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeAndBatchIon
        target:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyJumpTarget
      required:
        - name
        - keyEventCriteria
        - profileCriteria
        - target
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyJumpTarget:
      type: object
      properties:
        realtimeJourneyId:
          type: string
        realtimeJourneyStageId:
          type: string
        confirmed:
          type: boolean
      required:
        - realtimeJourneyId
        - realtimeJourneyStageId
        - confirmed
      additionalProperties: false
      nullable: true
    partial_realtime_journey.yaml-RealtimeJourneyKeyEventCriteria:
      type: object
      properties:
        keyEventId:
          type: string
          pattern: '[1-9][0-9]*'
        keyEventFilters:
          type: object
          description: 'TODO: something like ION?'
          properties:
            todo:
              type: string
    partial_realtime_journey.yaml-RealtimeJourneyStaleCriteria:
      type: object
      properties:
        name:
          type: string
          nullable: true
        unit:
          type: string
          enum:
            - minute
            - hour
            - day
        exitAfter:
          type: integer
          minimum: 1
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyStep:
      type: object
      additionalProperties:
        oneOf:
          - $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyWaitStep
          - $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyActivationStep
          - $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeDecisionPointStep
          - $ref: '#/components/schemas/partial_realtime_journey.yaml-MergeStep'
          - $ref: '#/components/schemas/partial_realtime_journey.yaml-JumpStep'
          - $ref: '#/components/schemas/partial_realtime_journey.yaml-EndStep'
          - $ref: '#/components/schemas/partial_realtime_journey.yaml-RealtimeABTest'
    partial_v5_rule.yaml-v5IonRule-valueConditionSet:
      properties:
        conditions:
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/partial_v5_rule.yaml-v5IonRule-referenceCondition
              - $ref: >-
                  #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueCondition
          type: array
        description:
          type: string
        expr:
          type: string
        type:
          enum:
            - Or
            - And
            - Composite
          type: string
      required:
        - conditions
        - type
      type: object
    partial_v5_rule.yaml-v5IonRule-valueLimit:
      properties:
        number:
          type: number
        orderColumns:
          items:
            oneOf:
              - properties:
                  column:
                    type: string
                  order:
                    enum:
                      - ascending
                      - descending
                    type: string
                  type:
                    enum:
                      - Column
                    type: string
                required:
                  - column
                  - order
                  - type
                type: object
              - properties:
                  order:
                    enum:
                      - ascending
                      - descending
                    type: string
                  type:
                    enum:
                      - Aggregation
                    type: string
                required:
                  - order
                  - type
                type: object
          type: array
        type:
          enum:
            - Count
            - Percent
          type: string
      required:
        - number
        - type
      type: object
    partial_journey_priority_group.yaml-InPriorityGroupJourneyAttributes:
      type: object
      properties:
        id:
          type: string
          description: ID of the journey
        name:
          type: string
          description: Name of the journey bundle
        status:
          type: string
          enum:
            - launched
            - draft
          description: |
            The status of the journey. Possible values are: `launched`, `draft`.
        paused:
          type: boolean
          description: |
            If true, the journey is paused.
    partial_realtime_journey.yaml-EndStep:
      type: object
      required:
        - type
      properties:
        type:
          enum:
            - End
    partial_realtime_journey.yaml-JumpStep:
      type: object
      required:
        - type
      properties:
        type:
          enum:
            - Jump
        name:
          type: string
        description:
          type: string
          nullable: true
        target:
          $ref: >-
            #/components/schemas/partial_realtime_journey.yaml-RealtimeJourneyJumpTarget
      additionalProperties: false
    partial_realtime_journey.yaml-MergeStep:
      type: object
      required:
        - type
        - next
      properties:
        type:
          enum:
            - Merge
        next:
          type: string
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeABTest:
      type: object
      required:
        - type
        - variants
        - controlVariant
        - customizedSplit
      properties:
        type:
          enum:
            - Variant
        branches:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeABTestVariant
        controlVariant:
          type: boolean
          nullable: true
        customizedSplit:
          type: boolean
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingConst:
      type: object
      properties:
        type:
          type: string
          enum:
            - const
        value:
          type: number
          format: int
          minimum: 1
      required:
        - type
        - value
      nullable: false
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeCounterAttributeIncrementSettingField:
      type: object
      properties:
        type:
          type: string
          enum:
            - field
        value:
          type: string
          nullable: false
      required:
        - type
        - value
      nullable: false
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeDecisionPointStep:
      type: object
      required:
        - type
        - branches
      properties:
        type:
          enum:
            - DecisionPoint
        branches:
          type: array
          items:
            $ref: >-
              #/components/schemas/partial_realtime_journey.yaml-RealtimeDecisionPointBranch
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeJourneyActivationStep:
      type: object
      required:
        - type
        - journeyActivationStepId
      properties:
        type:
          enum:
            - TriggeredActivation
        journeyActivationStepId:
          type: string
          pattern: '[1-9][0-9]*'
        next:
          type: string
    partial_realtime_journey.yaml-RealtimeJourneyWaitStep:
      type: object
      required:
        - type
        - waitStep
        - waitStepUnit
      properties:
        type:
          type: string
          enum:
            - WaitStep
        waitStep:
          type: integer
        waitStepUnit:
          type: string
          enum:
            - minute
            - hour
            - day
        next:
          type: string
    partial_v5_rule.yaml-v5IonRule-referenceCondition:
      oneOf:
        - properties:
            exclude:
              type: boolean
            id:
              type: string
            type:
              enum:
                - FunnelStageReference
                - Reference
                - AbTestVariantReference
              type: string
          required:
            - exclude
            - id
            - type
          type: object
        - properties:
            id:
              type: string
            includeConvertedCustomers:
              type: boolean
            maxGrade:
              type: number
            minGrade:
              type: number
            type:
              enum:
                - PredictiveScoreReference
              type: string
          required:
            - id
            - includeConvertedCustomers
            - maxGrade
            - minGrade
            - type
          type: object
        - properties:
            id:
              type: string
            leftValue:
              properties:
                attribute:
                  enum:
                    - r_quartile
                    - f_quartile
                    - m_quartile
                    - rfm_segment
                    - rfm_score
                    - rfm_cluster_rank
                    - rfm_quartile
                  type: string
              required:
                - attribute
              type: object
            operator:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueOperator
            solutionType:
              enum:
                - rfm
              type: string
            type:
              enum:
                - MlAttributeReference
              type: string
          required:
            - id
            - leftValue
            - operator
            - solutionType
            - type
          type: object
        - properties:
            id:
              type: string
            leftValue:
              properties:
                attribute:
                  enum:
                    - cltv_1m
                    - cltv_1m_pctile
                    - cltv_3m
                    - cltv_3m_pctile
                    - cltv_6m
                    - cltv_6m_pctile
                    - cltv_12m
                    - cltv_12m_pctile
                    - cltv_24m
                    - cltv_24m_pctile
                    - alive_prob
                    - cltv_segment
                  type: string
              required:
                - attribute
              type: object
            operator:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueOperator
            solutionType:
              enum:
                - cltv
              type: string
            type:
              enum:
                - MlAttributeReference
              type: string
          required:
            - id
            - leftValue
            - operator
            - solutionType
            - type
          type: object
    partial_v5_rule.yaml-v5IonRule-valueCondition:
      properties:
        arrayMatching:
          $ref: >-
            #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueArrayMatching
        exclude:
          type: boolean
        leftValue:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-valueLeftValue'
        limit:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-valueLimit'
        operator:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-valueOperator'
        type:
          enum:
            - Value
          type: string
      required:
        - arrayMatching
        - exclude
        - leftValue
        - operator
        - type
      type: object
    partial_realtime_journey.yaml-RealtimeABTestVariant:
      type: object
      required:
        - id
        - name
        - percentage
        - isControlGroup
        - next
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        percentage:
          type: number
          nullable: true
        isControlGroup:
          type: boolean
          nullable: true
        next:
          type: string
          nullable: true
      additionalProperties: false
    partial_realtime_journey.yaml-RealtimeDecisionPointBranch:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        profileCriteria:
          anyOf:
            - $ref: >-
                #/components/schemas/partial_realtime_journey.yaml-RealtimeAndBatchIon
            - type: object
              nullable: true
              description: for draft
        excludedPath:
          type: boolean
        next:
          type: string
          nullable: true
      required:
        - id
        - name
        - profileCriteria
        - excludedPath
        - next
      additionalProperties: false
    partial_v5_rule.yaml-v5IonRule-valueArrayMatching:
      oneOf:
        - nullable: true
        - enum:
            - all
            - any
          type: string
        - properties:
            atLeast:
              type: number
          required:
            - atLeast
          type: object
        - properties:
            atMost:
              type: number
          required:
            - atMost
          type: object
        - properties:
            exactly:
              type: number
          required:
            - exactly
          type: object
    partial_v5_rule.yaml-v5IonRule-valueLeftValue:
      oneOf:
        - $ref: >-
            #/components/schemas/partial_v5_rule.yaml-v5IonRule-attributeNameValue
        - $ref: >-
            #/components/schemas/partial_v5_rule.yaml-v5IonRule-customerGroupAttributeValue
        - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-aggregationValue'
    partial_v5_rule.yaml-v5IonRule-valueOperator:
      oneOf:
        - properties:
            not:
              type: boolean
            rightValue:
              properties:
                last:
                  oneOf:
                    - type: number
                    - $ref: >-
                        #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
              required:
                - last
                - unit
              type: object
            type:
              enum:
                - GreaterEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - anyOf:
            - properties:
                duration:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-duration'
                from:
                  properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
                not:
                  type: boolean
                reverse:
                  type: boolean
                type:
                  enum:
                    - TimeRange
                  type: string
              required:
                - duration
                - from
                - not
                - reverse
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                not:
                  enum:
                    - false
                  type: boolean
                type:
                  enum:
                    - TimeRange
                  type: string
              required:
                - from
                - not
                - type
              type: object
            - properties:
                type:
                  enum:
                    - TimeToday
                  type: string
              required:
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                type:
                  enum:
                    - TimeThis
                  type: string
              required:
                - from
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                type:
                  enum:
                    - TimeNext
                  type: string
              required:
                - from
                - type
              type: object
            - properties:
                type:
                  enum:
                    - TimeWithinNext
                  type: string
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                value:
                  type: string
              required:
                - type
                - unit
                - value
              type: object
            - properties:
                type:
                  enum:
                    - TimeWithinPast
                  type: string
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                value:
                  type: string
              required:
                - type
                - unit
                - value
              type: object
            - properties:
                from:
                  properties:
                    next:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - next
                    - unit
                  type: object
                not:
                  enum:
                    - false
                  type: boolean
                to:
                  properties:
                    next:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - next
                    - unit
                  type: object
                type:
                  enum:
                    - TimeInBetweenNext
                  type: string
              required:
                - from
                - not
                - to
                - type
              type: object
        - properties:
            not:
              type: boolean
            rightValue:
              properties:
                timestamp:
                  type: string
              required:
                - timestamp
              type: object
            type:
              enum:
                - Equal
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - Greater
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              properties:
                timestamp:
                  type: string
              required:
                - timestamp
              type: object
            type:
              enum:
                - GreaterEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - Less
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - LessEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - additionalProperties: false
          properties:
            maxValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            minValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            not:
              type: boolean
            type:
              enum:
                - Between
              type: string
          required:
            - maxValue
            - minValue
            - not
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - Equal
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - IsNull
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValues:
              items:
                oneOf:
                  - type: number
                  - type: string
              type: array
            type:
              enum:
                - In
              type: string
          required:
            - not
            - rightValues
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - Greater
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - Less
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - GreaterEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              oneOf:
                - type: number
                - type: string
            type:
              enum:
                - LessEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            maxValue:
              oneOf:
                - type: number
                - type: string
            minValue:
              oneOf:
                - type: number
                - type: string
            not:
              type: boolean
            rightValue:
              type: number
            type:
              enum:
                - Between
              type: string
          required:
            - maxValue
            - minValue
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValues:
              items:
                oneOf:
                  - type: string
              type: array
            type:
              enum:
                - Contain
              type: string
          required:
            - not
            - rightValues
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValues:
              items:
                oneOf:
                  - type: string
              type: array
            type:
              enum:
                - StartWith
              type: string
          required:
            - not
            - rightValues
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValues:
              items:
                oneOf:
                  - type: string
              type: array
            type:
              enum:
                - EndWith
              type: string
          required:
            - not
            - rightValues
            - type
          type: object
        - properties:
            not:
              type: boolean
            rightValue:
              type: string
            type:
              enum:
                - Regexp
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
    partial_v5_rule.yaml-v5IonRule-aggregationValue:
      properties:
        aggregation:
          oneOf:
            - properties:
                column:
                  type: string
                groupingColumns:
                  items:
                    oneOf:
                      - type: string
                  type: array
                type:
                  enum:
                    - Sum
                    - Min
                    - Max
                    - Average
                  type: string
              required:
                - column
                - type
              type: object
            - properties:
                groupingColumns:
                  items:
                    oneOf:
                      - type: string
                  type: array
                type:
                  enum:
                    - Count
                  type: string
              required:
                - groupingColumns
                - type
              type: object
            - properties:
                columns:
                  items:
                    oneOf:
                      - type: string
                  type: array
                type:
                  enum:
                    - CountDistinct
                  type: string
              required:
                - columns
                - type
              type: object
            - properties:
                column:
                  type: string
                groupingColumns:
                  items:
                    oneOf:
                      - type: string
                  type: array
                orderColumn:
                  type: string
                type:
                  enum:
                    - First
                    - Last
                  type: string
              required:
                - column
                - orderColumn
                - type
              type: object
        filter:
          $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-filter'
        source:
          properties:
            name:
              type: string
          required:
            - name
          type: object
        window:
          properties:
            duration:
              properties:
                day:
                  type: number
                hour:
                  type: number
                minute:
                  type: number
                second:
                  type: number
              type: object
            type:
              enum:
                - TimeSliding
              type: string
          required:
            - duration
            - type
          type: object
      required:
        - aggregation
        - filter
        - source
      type: object
    partial_v5_rule.yaml-v5IonRule-attributeNameValue:
      properties:
        name:
          type: string
      required:
        - name
      type: object
    partial_v5_rule.yaml-v5IonRule-customerGroupAttributeValue:
      properties:
        customerGroup:
          type: string
        name:
          type: string
      required:
        - customerGroup
        - name
      type: object
    partial_v5_rule.yaml-v5IonRule-duration:
      oneOf:
        - properties:
            year:
              type: number
          required:
            - year
          type: object
        - properties:
            quarter:
              type: number
          required:
            - quarter
          type: object
        - properties:
            month:
              type: number
          required:
            - month
          type: object
        - properties:
            week:
              type: number
          required:
            - week
          type: object
        - properties:
            day:
              type: number
          required:
            - day
          type: object
        - properties:
            hour:
              type: number
          required:
            - hour
          type: object
        - properties:
            minute:
              type: number
          required:
            - minute
          type: object
        - properties:
            second:
              type: number
          required:
            - second
          type: object
    partial_v5_rule.yaml-v5IonRule-localDuration:
      properties:
        day:
          type: number
        hour:
          type: number
        minute:
          type: number
        month:
          type: number
        quarter:
          type: number
        second:
          type: number
        week:
          type: number
        year:
          type: number
      type: object
    partial_v5_rule.yaml-v5IonRule-unit:
      enum:
        - year
        - quarter
        - month
        - week
        - day
        - hour
        - minute
        - second
      type: string
    partial_v5_rule.yaml-v5IonRule-filter:
      oneOf:
        - additionalProperties: false
          maxProperties: 0
          minProperties: 0
          type: object
          nullable: true
        - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-andFilter'
        - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-orFilter'
    partial_v5_rule.yaml-v5IonRule-andFilter:
      properties:
        conditions:
          items:
            anyOf:
              - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-andFilter'
              - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-orFilter'
              - $ref: >-
                  #/components/schemas/partial_v5_rule.yaml-v5IonRule-columnFilter
          type: array
        type:
          enum:
            - And
          type: string
      required:
        - conditions
        - type
      type: object
    partial_v5_rule.yaml-v5IonRule-orFilter:
      properties:
        conditions:
          items:
            anyOf:
              - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-andFilter'
              - $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-orFilter'
              - $ref: >-
                  #/components/schemas/partial_v5_rule.yaml-v5IonRule-columnFilter
          type: array
        type:
          enum:
            - Or
          type: string
      required:
        - conditions
        - type
      type: object
    partial_v5_rule.yaml-v5IonRule-columnFilter:
      anyOf:
        - properties:
            arrayMatching:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueArrayMatching
            column:
              type: string
            operator:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueOperator
            type:
              enum:
                - Column
              type: string
          required:
            - arrayMatching
            - column
            - operator
            - type
          type: object
        - properties:
            arrayMatching:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-valueArrayMatching
            column:
              enum:
                - timestamp
              type: string
            operator:
              $ref: >-
                #/components/schemas/partial_v5_rule.yaml-v5IonRule-timeframeOperator
            type:
              enum:
                - Column
              type: string
          required:
            - arrayMatching
            - column
            - operator
            - type
          type: object
    partial_v5_rule.yaml-v5IonRule-timeframeOperator:
      oneOf:
        - properties:
            not:
              type: boolean
            rightValue:
              properties:
                last:
                  oneOf:
                    - type: number
                    - $ref: >-
                        #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
              required:
                - last
                - unit
              type: object
            type:
              enum:
                - GreaterEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - anyOf:
            - properties:
                duration:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-duration'
                from:
                  properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
                not:
                  type: boolean
                reverse:
                  type: boolean
                type:
                  enum:
                    - TimeRange
                  type: string
              required:
                - duration
                - from
                - not
                - reverse
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                not:
                  enum:
                    - false
                  type: boolean
                type:
                  enum:
                    - TimeRange
                  type: string
              required:
                - from
                - not
                - type
              type: object
            - properties:
                type:
                  enum:
                    - TimeToday
                  type: string
              required:
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                type:
                  enum:
                    - TimeThis
                  type: string
              required:
                - from
                - type
              type: object
            - properties:
                from:
                  properties:
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - unit
                  type: object
                type:
                  enum:
                    - TimeNext
                  type: string
              required:
                - from
                - type
              type: object
            - properties:
                type:
                  enum:
                    - TimeWithinNext
                  type: string
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                value:
                  type: string
              required:
                - type
                - unit
                - value
              type: object
            - properties:
                type:
                  enum:
                    - TimeWithinPast
                  type: string
                unit:
                  $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                value:
                  type: string
              required:
                - type
                - unit
                - value
              type: object
            - properties:
                from:
                  properties:
                    next:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - next
                    - unit
                  type: object
                not:
                  enum:
                    - false
                  type: boolean
                to:
                  properties:
                    next:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - next
                    - unit
                  type: object
                type:
                  enum:
                    - TimeInBetweenNext
                  type: string
              required:
                - from
                - not
                - to
                - type
              type: object
        - properties:
            not:
              type: boolean
            rightValue:
              properties:
                timestamp:
                  type: string
              required:
                - timestamp
              type: object
            type:
              enum:
                - Equal
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - Greater
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              properties:
                timestamp:
                  type: string
              required:
                - timestamp
              type: object
            type:
              enum:
                - GreaterEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - Less
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - properties:
            not:
              enum:
                - false
              type: boolean
            rightValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            type:
              enum:
                - LessEqual
              type: string
          required:
            - not
            - rightValue
            - type
          type: object
        - additionalProperties: false
          properties:
            maxValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            minValue:
              oneOf:
                - properties:
                    timestamp:
                      type: string
                  required:
                    - timestamp
                  type: object
                - properties:
                    last:
                      oneOf:
                        - type: number
                        - $ref: >-
                            #/components/schemas/partial_v5_rule.yaml-v5IonRule-localDuration
                    unit:
                      $ref: '#/components/schemas/partial_v5_rule.yaml-v5IonRule-unit'
                  required:
                    - last
                    - unit
                  type: object
            not:
              type: boolean
            type:
              enum:
                - Between
              type: string
          required:
            - maxValue
            - minValue
            - not
            - type
          type: object
  parameters:
    AudienceId:
      name: audienceId
      in: path
      description: Audience ID
      required: true
      schema:
        type: integer
        format: int64
    ParentSegmentId:
      name: parentSegmentId
      in: path
      description: Parent Segment ID (audience id)
      required: true
      schema:
        type: integer
        format: int64
    NameInclude:
      name: name_include
      in: query
      required: false
      description: filter by the resource's name
      schema:
        type: string
    partial_pagination.yaml-PageAfter:
      name: page[after]
      in: query
      description: >-
        A string to fetch more page. The next value should be present at the
        pagination.nextPage in the previous response if more pages exist.
      required: false
      schema:
        type: string
    partial_pagination.yaml-PageSize:
      name: page[size]
      in: query
      description: The maximum number of results to return per page
      required: false
      schema:
        type: number
        default: 100
        minimum: 1
        maximum: 1000
    partial_pagination.yaml-SortedBy:
      name: sorted_by
      in: query
      description: Specify the sort order in the format foo:asc or foo:desc.
      required: false
      schema:
        type: string
    partial_realtime_journey.yaml-RealtimeJourneyActivationStepId:
      name: realtimeJourneyActivationStepId
      in: path
      description: Realtime JourneyActivationStep ID
      required: true
      schema:
        type: integer
        format: int64
    partial_realtime_journey.yaml-RealtimeJourneyId:
      name: realtimeJourneyId
      in: path
      description: Realtime Journey ID
      required: true
      schema:
        type: integer
        format: int64
    partial_realtime_journey.yaml-RealtimeKeyEventId:
      name: realtimeKeyEventId
      in: path
      description: Realtime Key Event ID
      required: true
      schema:
        type: integer
        format: int64
    partial_realtime_journey.yaml-RealtimePersonalizationId:
      name: realtimePersonalizationId
      in: path
      description: Realtime Personalization ID
      required: true
      schema:
        type: integer
        format: int64
    partial_realtime_journey.yaml-RealtimePersonalizationServiceId:
      name: realtimePersonalizationServiceId
      in: path
      description: Realtime Personalization Service ID
      required: true
      schema:
        type: integer
        format: int64
    partial_realtime_journey.yaml-RealtimePersonalizationTokenId:
      name: tokenId
      in: path
      description: Realtime Personalization Token ID
      required: true
      schema:
        type: integer
        format: int64
  securitySchemes:
    TdApikeyAuth:
      type: apiKey
      in: header
      name: Authorization
