Optimizely Audiences API

Create and manage audience segments for targeting experiments and rollouts.

Operations 4

GET /audiences List audiences #
POST /audiences Create an audience #
GET /audiences/{audience_id} Get an audience #
PATCH /audiences/{audience_id} Update an audience #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/optimizely-audiences-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

optimizely-audiences-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Optimizely Audiences API
  version: '2.0'
  description: 'Operations tagged Audiences across 3 of this provider''s published API definitions: optimizely-feature-experimentation-openapi.yml, optimizely-web-experimentation-openapi.yml, optimizely-web-experimentation-optimizely-api-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.optimizely.com/v2
  description: Optimizely REST API v2 Management Server
- url: https://api.optimizely.com/flags/v1
  description: Optimizely Flags API v1 Server
tags:
- name: Audiences
  description: Create and manage audience segments for targeting experiments and rollouts.
paths:
  /audiences:
    get:
      operationId: listAudiences
      summary: List audiences
      description: Returns a list of audiences for the specified project.
      tags:
      - Audiences
      parameters:
      - $ref: '#/components/parameters/projectIdQuery'
      - $ref: '#/components/parameters/perPage'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Successfully retrieved the list of audiences
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Audience'
        '401':
          description: Authentication credentials are missing or invalid
      security:
      - bearerAuth: []
    post:
      operationId: createAudience
      summary: Create an audience
      description: Creates a new audience within the specified project.
      tags:
      - Audiences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudienceInput'
      responses:
        '201':
          description: Audience successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
      security:
      - bearerAuth: []
    servers:
    - url: https://api.optimizely.com/v2
      description: Optimizely REST API v2 Management Server
    - url: https://api.optimizely.com/flags/v1
      description: Optimizely Flags API v1 Server
  /audiences/{audience_id}:
    get:
      operationId: getAudience
      summary: Get an audience
      description: Retrieves the full details of a specific audience.
      tags:
      - Audiences
      parameters:
      - $ref: '#/components/parameters/audienceId'
      responses:
        '200':
          description: Successfully retrieved the audience
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Audience not found
      security:
      - bearerAuth: []
    patch:
      operationId: updateAudience
      summary: Update an audience
      description: Updates the specified audience with the provided fields.
      tags:
      - Audiences
      parameters:
      - $ref: '#/components/parameters/audienceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudienceInput'
      responses:
        '200':
          description: Audience successfully updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Audience'
        '400':
          description: Invalid request body
        '401':
          description: Authentication credentials are missing or invalid
        '404':
          description: Audience not found
      security:
      - bearerAuth: []
    servers:
    - url: https://api.optimizely.com/v2
      description: Optimizely REST API v2 Management Server
    - url: https://api.optimizely.com/flags/v1
      description: Optimizely Flags API v1 Server
components:
  parameters:
    audienceId:
      name: audience_id
      in: path
      required: true
      description: The unique identifier for the audience
      schema:
        type: integer
        format: int64
    projectIdQuery:
      name: project_id
      in: query
      required: true
      description: The unique identifier for the project to filter by
      schema:
        type: integer
        format: int64
    page:
      name: page
      in: query
      required: false
      description: Page number for pagination
      schema:
        type: integer
        default: 1
        minimum: 1
    perPage:
      name: per_page
      in: query
      required: false
      description: Number of results per page
      schema:
        type: integer
        default: 25
        minimum: 1
        maximum: 100
    page_2:
      description: 'Optional pagination argument that specifies the page to return. If you have 140 objects and you choose to return 100 objects per page you will be able to access the last 40 objects on page 2. The default value is 1.

        '
      in: query
      name: page
      required: false
      schema:
        default: 1
        type: integer
    per_page:
      description: Optional pagination argument that specifies the maximum number of objects to return per request
      in: query
      name: per_page
      required: false
      schema:
        default: 25
        maximum: 100
        type: integer
  schemas:
    Audience:
      type: object
      description: An audience segment for targeting
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the audience
        project_id:
          type: integer
          format: int64
          description: The project this audience belongs to
        name:
          type: string
          description: Human-readable name of the audience
        description:
          type: string
          description: Description of the audience criteria
        conditions:
          type: string
          description: JSON-encoded audience conditions
        created:
          type: string
          format: date-time
          description: Timestamp when the audience was created
        last_modified:
          type: string
          format: date-time
          description: Timestamp when the audience was last modified
    AudienceInput:
      type: object
      description: Input for creating or updating an audience
      properties:
        project_id:
          type: integer
          format: int64
          description: The project this audience belongs to
        name:
          type: string
          description: Human-readable name of the audience
        description:
          type: string
          description: Description of the audience
        conditions:
          type: string
          description: JSON-encoded audience conditions
    Audience_2:
      type: object
      description: An audience segment for experiment targeting
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the audience
        project_id:
          type: integer
          format: int64
          description: The project this audience belongs to
        name:
          type: string
          description: Human-readable name of the audience
        description:
          type: string
          description: Description of the audience criteria
        conditions:
          type: string
          description: JSON-encoded audience conditions
        is_classic:
          type: boolean
          description: Whether this is a classic audience
        created:
          type: string
          format: date-time
          description: Timestamp when the audience was created
        last_modified:
          type: string
          format: date-time
          description: Timestamp when the audience was last modified
    AudienceInput_2:
      type: object
      description: Input for creating or updating an audience
      properties:
        project_id:
          type: integer
          format: int64
          description: The project this audience belongs to
        name:
          type: string
          description: Human-readable name of the audience
        description:
          type: string
          description: Description of the audience criteria
        conditions:
          type: string
          description: JSON-encoded audience conditions
    Error:
      properties:
        code:
          type: string
        message:
          type: string
        messages:
          type: object
        uuid:
          format: uuid
          type: string
      type: object
    Audience_3:
      properties:
        archived:
          default: false
          description: Whether the Audience has been archived
          type: boolean
        conditions:
          description: A string defining the targeting rules for an Audience
          example: '["and", {"type": "language", "value": "es"}, {"type": "location", "value": "US-CA-SANFRANCISCO"}]'
          externalDocs:
            description: targeting rules for an Audience
            url: https://developers.optimizely.com/x/rest/guides/conditions/
          type: string
        created:
          description: The time the Audience was initially created
          format: date-time
          readOnly: true
          type: string
        description:
          description: A short description of the Audience
          example: People that speak spanish and are in San Francisco
          type: string
        experiment_count:
          description: Number of experiments by audience_id
          example: 123
          format: int64
          readOnly: true
          type: integer
        for_journey:
          default: false
          description: Whether the Audience has been part of journey or not
          type: boolean
        id:
          description: The unique identifier for the Audience
          example: 5000
          format: int64
          readOnly: true
          type: integer
        is_classic:
          description: Whether or not Audience is a classic Audience. If true, the Audience is only compatible with classic Experiments. Otherwise, the Audience may be used in Optimizely X Campaigns.
          type: boolean
        last_modified:
          description: The last time the Audience was modified
          format: date-time
          readOnly: true
          type: string
        name:
          description: The name of the Audience
          example: Spanish speaking San Franciscans
          type: string
        project_id:
          description: The ID of the Project the Audience was created in
          example: 1000
          format: int64
          type: integer
        segmentation:
          default: false
          description: True if the Audience is available for segmentation on the results page (Audiences can only be used for segmentation in Optimizely Classic). Set to False if you intend to use this Audience only in Optimizely X. Note that a maximum of 10 Audiences can have segmentation set to True in any given Optimizely Classic project.
          externalDocs:
            description: segmentation
            url: https://help.optimizely.com/Analyze_Results/The_Results_page#segmenting
          type: boolean
      required:
      - project_id
      type: object
    AudienceUpdate:
      properties:
        archived:
          description: True if the Audience has been archived
          type: boolean
        conditions:
          description: A string defining the targeting rules for an Audience
          type: string
        description:
          description: A short description of the Audience
          type: string
        for_journey:
          default: false
          description: Whether the Audience has been part of journey or not
          type: boolean
        name:
          description: The name of the Audience
          example: Spanish speaking San Franciscans
          type: string
        segmentation:
          description: True if the Audience is available for segmentation on the results page (Enterprise plans only)
          type: boolean
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 Bearer token or personal access token for authentication.
    OAuth2:
      description: Write applications that authenticate with the REST API via OAuth 2.0. Or, to authenticate using a personal token, see https://docs.developers.optimizely.com/web/docs/personal-token
      flows:
        authorizationCode:
          authorizationUrl: https://app.optimizely.com/oauth2/authorize
          scopes:
            all: Full access to your account
          tokenUrl: https://app.optimizely.com/oauth2/token
      type: oauth2
    apiKey:
      scheme: bearer
      type: http
x-refined-from:
- optimizely-feature-experimentation-openapi.yml
- optimizely-web-experimentation-openapi.yml
- optimizely-web-experimentation-optimizely-api-openapi.json