Skip to main content

Audiences API

The Audiences API returns the audience profiles configured for the caller's company. Audiences are used by AutoGenerator and other generation endpoints to tailor content tone, depth, and structure.

Full schemas and try-it-out forms live in the interactive API Reference.

Authentication

All endpoints require a Bearer token:

Authorization: Bearer YOUR_API_KEY

See Getting Started → Authentication.

Response envelope

Every endpoint returns the canonical envelope: { "success": true, "data": { ... } } on success or the standard error envelope on error.

Endpoint summary

MethodPathDescriptionSync/Async
GET/api/v1/audiencesList audience profilesSync
POST/api/v1/audiences/searchSearch audience profilesSync

All endpoints are in the auto_generator rate-limit category. See Developer Guide → Usage quotas and rate limits.


GET /api/v1/audiences — List audiences

Returns the audiences configured for the caller's company. Pagination is not yet implemented; the full list is returned.

Query parameters

ParameterTypeRequiredDescription
featurestringnoFilter by feature scope.
idstringnoFilter to a single audience by id.
sortstringnoSort expression (for example name:asc).

Example

curl "https://api.prezent.ai/api/v1/audiences?sort=name:asc" \
-H "Authorization: Bearer $API_KEY"

Success response (200)

{
"success": true,
"data": {
"items": [
{ "id": "aud_exec", "name": "Executives" },
{ "id": "aud_sales", "name": "Sales team" }
],
"next_cursor": null
}
}

next_cursor is currently always null (cursor-based pagination is on the roadmap).


POST /api/v1/audiences/search — Search audiences

Free-text and field-filtered search across audience profiles.

Query parameters

ParameterTypeRequiredDescription
featurestringnoFilter by feature scope.

Request body

FieldTypeRequiredDescription
querystringnoFree-text search query.
idstringnoFilter to a single audience by id.
sortstringnoSort expression.
filterByobjectnoField-level filter.
filterByCollectionobjectnoCollection-level filter.
fieldsarray of stringnoSubset of fields to return.
extraFieldsarray of stringnoAdditional fields to include beyond defaults.
limitintegernoMaximum number of results (default 15).

Example

curl -X POST https://api.prezent.ai/api/v1/audiences/search \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "query": "executive", "limit": 10 }'

Success response (200)

{
"success": true,
"data": {
"items": [
{ "id": "aud_exec", "name": "Executives" }
],
"next_cursor": null
}
}

Errors

Common error codes:

  • 400INVALID_INPUT.
  • 401INVALID_API_KEY, EXPIRED_API_KEY, UNAUTHORIZED.
  • 404ENDPOINT_NOT_FOUND.
  • 429RATE_LIMIT_EXCEEDED, THROTTLED.
  • 500 / 503 / 504 — standard server-side codes.

See the full catalog in Developer Guide → Error codes.