Pular para o conteúdo principal
POST
/
api
/
workspace
/
{workspaceId}
/
dashboards
/
aggregate
Run a widget aggregation
curl --request POST \
  --url https://app.alana.shopping/api/workspace/{workspaceId}/dashboards/aggregate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "event_types": [
    "<string>"
  ],
  "group_by": "<string>",
  "aggregation": "count",
  "time_window_days": 183,
  "value_field": "value",
  "limit": 100
}
'
{
  "rows": [
    {
      "key": "<string>",
      "value": 123,
      "secondary": 123
    }
  ],
  "generated_at": "2023-11-07T05:31:56Z",
  "cache_hit": true
}

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication via Auth0. Users authenticate through Auth0 Universal Login. Include the access token in the Authorization header: Authorization: Bearer <token>

Cabeçalhos

X-Active-Brand
string<uuid>
X-Active-Catalog
string<uuid>

Optional catalog scope for the aggregation

Parâmetros de caminho

workspaceId
string
obrigatório

The workspace ID

Pattern: ^ws_[a-z0-9]+$

Parâmetros de consulta

brand_id
string<uuid>

Corpo

application/json
event_types
string[] | null
obrigatório

Filter by event types (canonical or custom). null/empty = all events.

Maximum array length: 50
Pattern: ^[a-z][a-z0-9_]{1,62}$
group_by
string
obrigatório

One of: none, event_type, session, day, hour, product_id; OR metadata. where key matches /^[a-z_][a-z0-9_]{0,62}$/

aggregation
enum<string>
obrigatório
Opções disponíveis:
count,
count_distinct,
sum,
avg
time_window_days
integer
obrigatório
Intervalo obrigatório: 1 <= x <= 365
value_field
enum<string>

Required when aggregation is sum or avg; ignored for count/count_distinct

Opções disponíveis:
value,
amount,
price,
quantity,
duration_ms,
score,
rating,
session_id,
product_id,
agent_id,
customer_id
limit
integer
padrão:100
Intervalo obrigatório: 1 <= x <= 1000

Resposta

Aggregation result rows

rows
object[]
obrigatório
generated_at
string<date-time>
obrigatório
cache_hit
boolean
obrigatório
Last modified on April 25, 2026