Reten Docs

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

ParameterTypeDefaultDescription
pagenumber1Page number (integer, minimum 1).
per_pagenumber25Items per page (integer, minimum 1, maximum 100).
searchstring-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:

FieldTypeDescription
idstring (UUID)Criteria identifier.
projectIdstring (UUID)Project the criteria belongs to.
namestringCriteria name.
descriptionstring | nullDescription; null if none.
isActivebooleanWhether the criteria is active.
isRootbooleantrue only for the project's root audience (see Projects).
ownerIdstring (UUID)Creating user.
updatedBystring (UUID)Last user who edited it.
createdAtstring (ISO 8601)Creation date.
updatedAtstring (ISO 8601)Last update date.
queryBlockCountnumberNumber of query blocks in the criteria.
compositionCountnumberNumber of compositions in the criteria.

Pagination Fields

FieldTypeDescription
pagenumberCurrent page.
per_pagenumberItems per page.
totalnumberTotal count of criterias matching the filters.
total_pagesnumberceil(total / per_page).
has_nextbooleantrue if there is a next page.
has_previousbooleantrue if there is a previous page.

Error Responses

StatusDescription
400Invalid parameter (e.g. per_page greater than 100, page less than 1, unknown property).
401Missing or invalid Authorization: Bearer.
403The user does not have the audience-criteria:view permission, or the x-tenant-id is not authorized.