Reten Docs

Get Event Filter

Get an event filter by id, with its full definition — the nested query blocks.

GET /api/event-criterias/:id

Returns a single event filter with its full definition: the resource's base data plus the nested tree of query blocks (queryBlocks).

Auth: Required — event-criteria:view permission

Path Parameters

ParameterTypeDescription
idUUIDThe event filter id.

Query Parameters

ParameterTypeDefaultDescription
formatstringdetailRequested representation: detail | compute. Omitting it is equivalent to detail.

This page documents the detail branch. The compute branch returns a different shape and is documented in Compute format.

Any other format value responds 400.

Example

curl https://api.reten.ai/api/event-criterias/6d2a9c41-7e35-48b0-b1c9-0f8e7d6c5b4a \
  -H "Authorization: Bearer <token>" \
  -H "x-tenant-id: <tenant-id>" \
  -H "x-project-id: <project-id>"
import axios from 'axios';

const id = '6d2a9c41-7e35-48b0-b1c9-0f8e7d6c5b4a';
const response = await axios.get(
  `https://api.reten.ai/api/event-criterias/${id}`,
  { headers: { Authorization: 'Bearer <token>', 'x-tenant-id': '<tenant-id>', 'x-project-id': '<project-id>' } },
);
const criteria = response.data;

Response 200 OK

The base resource plus queryBlocks, ordered by order ascending. All fields use camelCase; instants are serialized to ISO 8601.

{
  "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",
  "queryBlocks": [
    {
      "id": "b7c1d2e3-4f50-4a61-8b72-9c8d7e6f5a40",
      "order": 0,
      "setOperator": null,
      "from": { "table": "event_transactions", "joins": [] },
      "select": {
        "distinct": true,
        "items": [
          {
            "kind": "column",
            "column": { "table": "event_transactions", "column": "event_id" }
          }
        ]
      },
      "timeWindow": null,
      "where": {
        "kind": "group",
        "logicalOperator": "AND",
        "children": [
          {
            "kind": "predicate",
            "column": { "table": "event_transactions", "column": "status" },
            "comparisonOperator": "EQUALS",
            "value": "Facturada"
          },
          {
            "kind": "semiJoinPredicate",
            "table": "event_transactions",
            "semiJoin": "products",
            "subWhere": {
              "kind": "group",
              "logicalOperator": "AND",
              "children": [
                {
                  "kind": "predicate",
                  "field": "categorization.category_name",
                  "comparisonOperator": "IN",
                  "value": ["Food Service", "HORECA"]
                }
              ]
            }
          }
        ]
      },
      "groupBy": null,
      "having": null
    }
  ]
}

Base 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.

The response does not carry compositions: an event filter is not composed with other filters.

queryBlocks[]

Array of query blocks, ordered by order ascending. Each block is returned exactly as it was sent, plus its resolved id.

FieldTypeDescription
idstring (UUID)Block identifier.
ordernumberBlock position (ascending).
setOperatorSetOperatorEnum | nullSet operator that combines it with the previous block; null on the first.
fromobject{ table, joins } — base table and joins.
selectobject{ distinct, items } — columns or aggregates.
timeWindowobject | nullTime window (union discriminated by timeOperator); null if not sent.
whereobjectFilter tree; AND/OR groups with column, record and related table leaves.
groupByarray | nullGrouping columns, or null.
havingobject | nullFilter tree over aggregates, or null.

Optional fields that were not sent are returned as null (setOperator, timeWindow, groupBy, having), and from.joins as [] if there were no joins.

The full structure of each field —including the three where leaves and the shape of value by operator— is in Definition.

Error Responses

StatusDescription
400The id is not a valid UUID, or format is neither detail nor compute.
401Missing or invalid Authorization: Bearer.
403The user does not have the event-criteria:view permission, or the x-tenant-id is not authorized.
404No event filter with that id exists in the tenant (Event criteria not found).