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
| Parameter | Type | Description |
|---|---|---|
id | UUID | The event filter id. |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | detail | Requested 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
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Filter identifier. |
projectId | string (UUID) | Project the filter belongs to. |
name | string | Filter name. |
description | string | null | Description; null if none. |
isActive | boolean | Always true: no endpoint modifies it. |
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. |
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.
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Block identifier. |
order | number | Block position (ascending). |
setOperator | SetOperatorEnum | null | Set operator that combines it with the previous block; null on the first. |
from | object | { table, joins } — base table and joins. |
select | object | { distinct, items } — columns or aggregates. |
timeWindow | object | null | Time window (union discriminated by timeOperator); null if not sent. |
where | object | Filter tree; AND/OR groups with column, record and related table leaves. |
groupBy | array | null | Grouping columns, or null. |
having | object | null | Filter 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
| Status | Description |
|---|---|
400 | The id is not a valid UUID, or format is neither detail nor compute. |
401 | Missing or invalid Authorization: Bearer. |
403 | The user does not have the event-criteria:view permission, or the x-tenant-id is not authorized. |
404 | No event filter with that id exists in the tenant (Event criteria not found). |