For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ“’Managing Audiences

Programs can set audiences for different tier payouts or allowlists. Each audience can have entries that are:

Type
Description

Static

Entered manually or via API

Dynamic

Users that matched a specific condition automatically

Getting user audiences

Use getUserAudiences to check which audiences a user belongs to:

import { Fuul } from '@fuul/sdk';

await Fuul.getUserAudiences({
  user_identifier: '0x1234...',
  user_identifier_type: 'evm_address',
});

Updating audiences via API

Audience write operations (add, remove, batch, badges) are HTTP-only. The SDK exposes getUserAudiences only; all other audience management is done via the Fuul API:

Action
API endpoint
Reference

Get user's audiences

GET /v1/audiences/audience-segments/user

List all segments

GET /v1/audiences/audience-segments

Get segment entries

GET /v1/audience-segments/{segmentId}/entries

Add entries (batch)

POST /v1/audience-segments/{segmentId}/entries/batch

Remove entry

DELETE /v1/audience-segments/{segmentId}/entries/{userIdentifier}

Create badge

POST /v1/audience-segments/{segmentId}/badge

Update badge

PATCH /v1/audience-segments/{segmentId}/badge

Delete badge

DELETE /v1/audience-segments/{segmentId}/badge

Example: add users to an audience

A service_role API key is required for audience management endpoints.

Last updated