Audiences

Create and manage the targeting rules that tests and flags can be limited to.

An audience is a set of targeting rules. A visitor is in the audience when every rule matches, and an audience without rules matches everyone. Audiences belong to the organization and are shared by all environments.

Paths start with /api/agent/organizations/{organizationId}/audiences. Reading needs any role; creating, changing and deleting need editor or higher.

Rules

RuleValues
countryISO 3166-1 alpha-2 code, from IP geolocation, e.g. NL
devicewearable, mobile, tablet, console, smarttv, embedded, desktop
browserchrome, safari, firefox, edge, ie, samsung internet, social, other
osmac os, ios, android, windows, unix
pointercoarse (touch), fine (mouse)

Create an audience

curl -X POST https://improve.obelism.studio/api/agent/organizations/$ORG/audiences \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Dutch mobile","rules":{"country":"NL","device":"mobile"}}'
{
	"audience": {
		"audienceId": "aud_01H8XYZ",
		"name": "Dutch mobile",
		"slug": "dutch-mobile",
		"rules": { "country": "NL", "device": "mobile" },
		"createdAt": "2026-10-08T12:00:00.000Z",
		"updatedAt": "2026-10-08T12:00:00.000Z"
	}
}

slug is optional and defaults to the slugified name. A slug you send must already be lowercase letters, digits and -.

Other operations

MethodPathDoes
GET/audiencesList the audiences
GET/audiences/{audienceId}Get one audience
PATCH/audiences/{audienceId}Change the fields you send; rules is replaced whole
DELETE/audiences/{audienceId}Delete the audience (204)

Tests and flags refer to an audience by its audienceId. Deleting an audience doesn't update the tests and flags that use it, so point them at another audience first.

On this page