Reten Docs

List Event Filters

Paginated list of the tenant's event filters, with search by name — summary only, without the definition tree.

GET /api/event-criterias

Returns a paginated list of the tenant's event filters, with an optional search by name. Each element is a summary: the base resource plus the condition count — it does not include the definition tree.

Auth: Required — event-criteria:view permission

This endpoint does not return queryBlocks, only conditionCount. To get the full definition of a filter 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/event-criterias?search=factura&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/event-criterias',
  {
    headers: { Authorization: 'Bearer <token>', 'x-tenant-id': '<tenant-id>', 'x-project-id': '<project-id>' },
    params: { search: 'factura', 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": "6d2a9c41-7e35-48b0-b1c9-0f8e7d6c5b4a",
      "projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
      "name": "Proyecto Food Service",
      "description": "Ventas facturadas con al menos una línea de categoría Food Service u HORECA",
      "isActive": true,
      "ownerId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "updatedBy": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "createdAt": "2026-07-15T14:32:07.481Z",
      "updatedAt": "2026-07-15T14:32:07.481Z",
      "conditionCount": 2
    },
    {
      "id": "9f3a1c22-4b7e-4c31-9a8d-2f5e6b7c8d90",
      "projectId": "3f6c2b1a-8d4e-4f7a-9b2c-5e1d0a7f6c34",
      "name": "Venta oficial — solo facturada",
      "description": null,
      "isActive": true,
      "ownerId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "updatedBy": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "createdAt": "2026-07-10T09:12:44.005Z",
      "updatedAt": "2026-07-10T09:12:44.005Z",
      "conditionCount": 1
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total": 2,
    "total_pages": 1,
    "has_next": false,
    "has_previous": false
  }
}

Element Fields

FieldTypeDescription
idstring (UUID)Filter identifier.
projectIdstring (UUID)Project the filter belongs to.
namestringFilter name.
descriptionstring | nullDescription; null if none.
isActivebooleanAlways true: no endpoint modifies it.
ownerIdstring (UUID)Creating user.
updatedBystring (UUID)Last user who edited it.
createdAtstring (ISO 8601)Creation date.
updatedAtstring (ISO 8601)Last update date.
conditionCountnumberNumber of conditions in the filter (see below).

What conditionCount counts

It is the sum of the leaves of the where of all query blocks: each leaf counts 1, no matter what type it is.

  • A column leaf (predicate) counts 1.
  • A record leaf (recordPredicate) counts 1, even if its subWhere has several sub-filters: it is one condition, not the sum of its parts.
  • A related table leaf (semiJoinPredicate) counts 1, for the same reason.
  • AND/OR groups do not count: they are traversed to reach the leaves.

A filter with status = 'Facturada' and a record filter over attributes with two sub-filters has conditionCount: 2.

conditionCount measures the definition tree, which is what whoever builds it sees. It does not measure the size of any serialization of the filter.

Pagination Fields

FieldTypeDescription
pagenumberCurrent page.
per_pagenumberItems per page.
totalnumberTotal count of filters matching the search.
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 (per_page greater than 100, page less than 1, unknown property).
401Missing or invalid Authorization: Bearer.
403The user does not have the event-criteria:view permission, or the x-tenant-id is not authorized.