List Audiences
Paginated list of the active project's audience criterias, with search by name — summary only, without the definition tree.
GET /api/audience-criterias
Returns a paginated list of the active project's audience criterias, with an optional search by name. Each element is a summary: the base resource plus the counts of query blocks and compositions — it does not include the full definition tree.
Auth: Required — audience-criteria:view permission
This endpoint does not return queryBlocks or compositions, only their
counts (queryBlockCount, compositionCount). To get the full definition
of a criteria use GET /:id.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (integer, minimum 1). |
per_page | number | 25 | Items per page (integer, minimum 1, maximum 100). |
search | string | - | Filters by name (partial match, case-insensitive). Does not search in description. |
The order is fixed: descending by creation date
(createdAt), most recent first.
Example
curl "https://api.reten.ai/api/audience-criterias?search=clientes&per_page=25" \
-H "Authorization: Bearer <token>" \
-H "x-tenant-id: <tenant-id>" \
-H "x-project-id: <project-id>"import axios from 'axios';
const response = await axios.get(
'https://api.reten.ai/api/audience-criterias',
{
headers: { Authorization: 'Bearer <token>', 'x-tenant-id': '<tenant-id>', 'x-project-id': '<project-id>' },
params: { search: 'clientes', per_page: 25 },
},
);
const { data, pagination } = response.data;Response 200 OK
Wraps the results in PaginatedResponseDto<T>. Each element of data uses
camelCase; the pagination fields use snake_case.
{
"data": [
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
"name": "Clientes activos últimos 30 días",
"description": "Usuarios con al menos una compra pagada en el último mes",
"isActive": true,
"isRoot": false,
"ownerId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"updatedBy": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"createdAt": "2026-06-15T09:30:00.000Z",
"updatedAt": "2026-06-15T09:30:00.000Z",
"queryBlockCount": 2,
"compositionCount": 1
},
{
"id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
"name": "Clientes VIP",
"description": null,
"isActive": true,
"isRoot": false,
"ownerId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"updatedBy": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"createdAt": "2026-06-10T14:00:00.000Z",
"updatedAt": "2026-06-10T14:00:00.000Z",
"queryBlockCount": 1,
"compositionCount": 0
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total": 2,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}Element Fields
Each element of data is the base resource plus two counts derived from its
relations:
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Criteria identifier. |
projectId | string (UUID) | Project the criteria belongs to. |
name | string | Criteria name. |
description | string | null | Description; null if none. |
isActive | boolean | Whether the criteria is active. |
isRoot | boolean | true only for the project's root audience (see Projects). |
ownerId | string (UUID) | Creating user. |
updatedBy | string (UUID) | Last user who edited it. |
createdAt | string (ISO 8601) | Creation date. |
updatedAt | string (ISO 8601) | Last update date. |
queryBlockCount | number | Number of query blocks in the criteria. |
compositionCount | number | Number of compositions in the criteria. |
Pagination Fields
| Field | Type | Description |
|---|---|---|
page | number | Current page. |
per_page | number | Items per page. |
total | number | Total count of criterias matching the filters. |
total_pages | number | ceil(total / per_page). |
has_next | boolean | true if there is a next page. |
has_previous | boolean | true if there is a previous page. |
Error Responses
| Status | Description |
|---|---|
400 | Invalid parameter (e.g. per_page greater than 100, page less than 1, unknown property). |
401 | Missing or invalid Authorization: Bearer. |
403 | The user does not have the audience-criteria:view permission, or the x-tenant-id is not authorized. |