Rapidata Audience API

The Audience API from Rapidata — 19 operation(s) for audience.

OpenAPI Specification

rapidata-audience-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Rapidata Asset Audience API
  description: The API for the Rapidata Asset service
  version: v1
servers:
- url: https://api.rapidata.ai/
tags:
- name: Audience
  x-displayName: Audience
paths:
  /audience/{audienceId}/owner:
    patch:
      tags:
      - Audience
      summary: Changes the owner of the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      requestBody:
        description: The new owner information.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeAudienceOwnerEndpoint_Input'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience:
    post:
      tags:
      - Audience
      summary: Creates a new empty audience.
      requestBody:
        description: The properties of the audience to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAudienceEndpoint_Input'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAudienceEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{baseAudienceId}/filter:
    post:
      tags:
      - Audience
      summary: "Creates a filtered view on the given base audience by applying a filter on top of its\n graduates. Returns an audience id that can be used in job creation just like a regular\n audience id; no new onboarding is required."
      parameters:
      - name: baseAudienceId
        in: path
        description: The id of the dimension audience whose graduates the filter is applied on top of.
        required: true
        schema:
          type: string
      requestBody:
        description: The filter to apply to the base audience.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFilteredAudienceEndpoint_Input'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateFilteredAudienceEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}:
    delete:
      tags:
      - Audience
      summary: Deletes the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience to delete.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
    get:
      tags:
      - Audience
      summary: Returns the audience with the specified id.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAudienceByIdEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
    patch:
      tags:
      - Audience
      summary: Patches an existing audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience to update.
        required: true
        schema:
          type: string
      requestBody:
        description: The audience properties to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAudienceEndpoint_Input'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateAudienceEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/inactivity-sync/{syncId}:
    get:
      tags:
      - Audience
      summary: Returns the audience inactivity sync with the given id.
      parameters:
      - name: syncId
        in: path
        description: The unique identifier of the inactivity sync.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAudienceInactivitySyncByIdEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/state-recalculation/{recalculationId}:
    get:
      tags:
      - Audience
      summary: Returns the audience state recalculation with the given id.
      parameters:
      - name: recalculationId
        in: path
        description: The unique identifier of the recalculation.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAudienceStateRecalculationByIdEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/user-metrics:
    get:
      tags:
      - Audience
      summary: Gets the count of users in each state for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAudienceUserStateMetricsResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/inactivity-sync:
    get:
      tags:
      - Audience
      summary: Returns the most recent audience inactivity sync for the given audience, regardless of state.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLatestAudienceInactivitySyncEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
    post:
      tags:
      - Audience
      summary: Starts a new inactivity sync for the given audience.
      description: "Returns 400 if the audience does not have inactivity drop days configured.\n If a sync is already Pending for this audience, its id is returned and no new run is\n created. If one is currently Processing, it is aborted and replaced. Failed,\n Completed, and Aborted runs are left untouched and a fresh run is created."
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartAudienceInactivitySyncEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/state-recalculation:
    get:
      tags:
      - Audience
      summary: Returns the most recent audience state recalculation for the given audience, regardless of state.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLatestAudienceStateRecalculationEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
    post:
      tags:
      - Audience
      summary: Starts a new audience state recalculation for the given audience.
      description: "If a recalculation is already Pending for this audience, its id is returned and no new\n run is created. If one is currently Processing, it is aborted and replaced. Failed,\n Completed, and Aborted runs are left untouched and a fresh run is created."
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartAudienceStateRecalculationEndpoint_Output'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/initialize-users:
    post:
      tags:
      - Audience
      summary: "Uploads a CSV file containing user IDs and scores, then processes it in the background\n to seed the audience with those users."
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience to initialize.
        required: true
        schema:
          type: string
      requestBody:
        description: 'A CSV file with columns: userId, score.'
        content:
          multipart/form-data:
            schema:
              required:
              - file
              type: object
              properties:
                file:
                  $ref: '#/components/schemas/IFormFile'
        required: true
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/pause-distillation:
    post:
      tags:
      - Audience
      summary: Pauses the distillation campaign for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/jobs:
    get:
      tags:
      - Audience
      summary: Queries jobs for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      - name: page
        in: query
        description: The 1-based page index.
        schema:
          type: integer
        x-parameter-group: page
      - name: page_size
        in: query
        description: The number of items per page.
        schema:
          type: integer
        x-parameter-group: page
      - name: sort
        in: query
        description: Sort fields. Prefix with - for descending order (e.g. -created_at).
        schema:
          type: array
          items:
            enum:
            - name
            - -name
            - created_at
            - -created_at
            - status
            - -status
            type: string
        x-parameter-group: sort
      - name: job_id
        in: query
        description: Filter by job_id.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: name
        in: query
        description: Filter by name.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: definition_id
        in: query
        description: Filter by definition_id.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: status
        in: query
        description: Filter by status.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: created_at
        in: query
        description: Filter by created_at.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: logic
        in: query
        description: 'How to combine the field filters: "and" (default) requires every filter to match, "or" requires any of them to match.'
        schema:
          enum:
          - and
          - or
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryAudienceJobsEndpoint_PagedResultOfOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audiences:
    get:
      tags:
      - Audience
      summary: Queries all audiences visible to the caller.
      parameters:
      - name: page
        in: query
        description: The 1-based page index.
        schema:
          type: integer
        x-parameter-group: page
      - name: page_size
        in: query
        description: The number of items per page.
        schema:
          type: integer
        x-parameter-group: page
      - name: sort
        in: query
        description: Sort fields. Prefix with - for descending order (e.g. -created_at).
        schema:
          type: array
          items:
            enum:
            - name
            - -name
            - created_at
            - -created_at
            - status
            - -status
            - qualified_user_count
            - -qualified_user_count
            type: string
        x-parameter-group: sort
      - name: name
        in: query
        description: Filter by name.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: status
        in: query
        description: Filter by status.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: is_public
        in: query
        description: Filter by is_public.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: is_distilling
        in: query
        description: Filter by is_distilling.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: owner_mail
        in: query
        description: Filter by owner_mail.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: created_at
        in: query
        description: Filter by created_at.
        style: deepObject
        explode: true
        schema:
          type: object
          properties:
            eq:
              type: string
            neq:
              type: string
            gt:
              type: string
            gte:
              type: string
            lt:
              type: string
            lte:
              type: string
            contains:
              type: string
            starts_with:
              type: string
            ends_with:
              type: string
            in:
              type: array
              items:
                type: string
            not_contains:
              type: string
        x-parameter-group: filters
      - name: logic
        in: query
        description: 'How to combine the field filters: "and" (default) requires every filter to match, "or" requires any of them to match.'
        schema:
          enum:
          - and
          - or
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryAudiencesEndpoint_PagedResultOfOutput'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/rebuild-distilling-campaign:
    post:
      tags:
      - Audience
      summary: Rebuilds the distilling campaign for the specified audience.
      description: "Recalculates campaign filters and selections based on the audience's current settings\n (demographic filters, exit conditions, etc.)."
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/reconcile-user-counts:
    post:
      tags:
      - Audience
      summary: "Enqueues a background job that reconciles audience-row state derived\n from audience_state_counts."
      responses:
        '202':
          description: Accepted
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/recreate-external-audiences:
    post:
      tags:
      - Audience
      summary: Recreates external audiences for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      requestBody:
        description: Configuration for which external audiences to recreate.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecreateExternalAudiencesEndpoint_Input'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/resume-distillation:
    post:
      tags:
      - Audience
      summary: Resumes the distillation campaign for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/recruit:
    post:
      tags:
      - Audience
      summary: Starts recruiting users for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the audience.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '401':
          description: Unauthenticated
        '403':
          description: Forbidden
      security:
      - OpenIdConnect:
        - openid
        - profile
        - email
        - offline_access
  /audience/{audienceId}/boost-config:
    patch:
      tags:
      - Audience
      summary: Updates the boost configuration for the specified audience.
      parameters:
      - name: audienceId
        in: path
        description: The unique identifier of the a

# --- truncated at 32 KB (72 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/rapidata/refs/heads/main/openapi/rapidata-audience-api-openapi.yml