# Últimos eventos de la organización

GET `https://api.bydomu.com/v1/events/recent`

Esta referência é gerada a partir do código da API, por isso as descrições estão em espanhol. Nomes, parâmetros e exemplos são iguais em qualquer idioma.

Hasta 20 eventos reales recientes, del más nuevo al más viejo, opcionalmente de un solo tipo. Pensado para el paso de «datos de ejemplo» al configurar un disparador.

Permissão pedida

`events:read`

Cabeçalho obrigatório

`X-API-Key` · chave secreta

Nível de acesso

Nível 2 · automático na Inmobiliaria Pro

## Parâmetros de consulta

1 · todos opcionais

`type` string · opcional

Tipo exacto del catálogo, p. ej. `deal.won` ≤ 100 chars

## Resposta 200

`RecentDomainEvent[]` · 10 campos

**`data[]` id · type · aggregateType · aggregateId · payload · actorKind · actorUserId · occurredAt · dispatchStatus · lastError**

`id` string

`type` string

`aggregateType` string

`aggregateId` string

`payload` any Datos propios del evento

`actorKind` string USER, NOA, SYSTEM, API, AUTOMATION, INTEGRATION

`actorUserId` string

`occurredAt` string

`dispatchStatus` string PENDING, PROCESSING, DISPATCHED, FAILED

`lastError` string

## Erros possíveis

com a forma `{ "error": { "code", "message" } }`

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **403** FORBIDDEN
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl "https://api.bydomu.com/v1/events/recent" \
  -H "X-API-Key: $BYDOMU_API_KEY"
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data } = await bydomu.events.listRecent();
```

Python:

```python
import os, requests

r = requests.get(
    "https://api.bydomu.com/v1/events/recent",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]}
)
data = r.json()
```

**Resposta · 200 · exemplo**

```json
{
  "data": [
    {
      "id": "5f3a0c1e-7d2b-4f7e-9a51-0b6c1d2e3f40",
      "type": "deal.won",
      "aggregateType": "deal",
      "aggregateId": "clx1deal001",
      "payload": {
        "stageName": "Ganado"
      },
      "actorKind": "USER",
      "actorUserId": "clx1usr001",
      "occurredAt": "2026-09-22T14:30:00.000Z",
      "dispatchStatus": "PENDING",
      "lastError": "timeout"
    }
  ]
}
```
