Optimizely · Capability

Optimizely Feature Experimentation REST API — Audiences

Optimizely Feature Experimentation REST API — Audiences. 4 operations. Lead operation: List audiences. Self-contained Naftiko capability covering one Optimizely business surface.

Run with Naftiko OptimizelyAudiences

What You Can Do

GET
Listaudiences — List audiences
/v1/audiences
POST
Createaudience — Create an audience
/v1/audiences
GET
Getaudience — Get an audience
/v1/audiences/{audience-id}
PATCH
Updateaudience — Update an audience
/v1/audiences/{audience-id}

MCP Tools

list-audiences

List audiences

read-only idempotent
create-audience

Create an audience

get-audience

Get an audience

read-only idempotent
update-audience

Update an audience

idempotent

Capability Spec

feature-experimentation-audiences.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Optimizely Feature Experimentation REST API — Audiences
  description: 'Optimizely Feature Experimentation REST API — Audiences. 4 operations. Lead operation: List audiences. Self-contained
    Naftiko capability covering one Optimizely business surface.'
  tags:
  - Optimizely
  - Audiences
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    OPTIMIZELY_API_KEY: OPTIMIZELY_API_KEY
capability:
  consumes:
  - type: http
    namespace: feature-experimentation-audiences
    baseUri: https://api.optimizely.com/v2
    description: Optimizely Feature Experimentation REST API — Audiences business capability. Self-contained, no shared references.
    resources:
    - name: audiences
      path: /audiences
      operations:
      - name: listaudiences
        method: GET
        description: List audiences
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createaudience
        method: POST
        description: Create an audience
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: audiences-audience_id
      path: /audiences/{audience_id}
      operations:
      - name: getaudience
        method: GET
        description: Get an audience
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updateaudience
        method: PATCH
        description: Update an audience
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.OPTIMIZELY_API_KEY}}'
  exposes:
  - type: rest
    namespace: feature-experimentation-audiences-rest
    port: 8080
    description: REST adapter for Optimizely Feature Experimentation REST API — Audiences. One Spectral-compliant resource
      per consumed operation, prefixed with /v1.
    resources:
    - path: /v1/audiences
      name: audiences
      description: REST surface for audiences.
      operations:
      - method: GET
        name: listaudiences
        description: List audiences
        call: feature-experimentation-audiences.listaudiences
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createaudience
        description: Create an audience
        call: feature-experimentation-audiences.createaudience
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/audiences/{audience-id}
      name: audiences-audience-id
      description: REST surface for audiences-audience_id.
      operations:
      - method: GET
        name: getaudience
        description: Get an audience
        call: feature-experimentation-audiences.getaudience
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updateaudience
        description: Update an audience
        call: feature-experimentation-audiences.updateaudience
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: feature-experimentation-audiences-mcp
    port: 9090
    transport: http
    description: MCP adapter for Optimizely Feature Experimentation REST API — Audiences. One tool per consumed operation,
      routed inline through this capability's consumes block.
    tools:
    - name: list-audiences
      description: List audiences
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: feature-experimentation-audiences.listaudiences
      outputParameters:
      - type: object
        mapping: $.
    - name: create-audience
      description: Create an audience
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: feature-experimentation-audiences.createaudience
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-audience
      description: Get an audience
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: feature-experimentation-audiences.getaudience
      outputParameters:
      - type: object
        mapping: $.
    - name: update-audience
      description: Update an audience
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: feature-experimentation-audiences.updateaudience
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.