Skip to Content
SelloDeveloper docs
API ReferenceWebhooks

List the account's stored webhook events

Every webhook event raised since the event store started (#1458), whether or not it was delivered: an event raised with no endpoint, a disabled one or an event selection that left it out is still listed. Newest first by `createdAt`, then by `id` (byte order), keyset-paged: pass `nextCursor` back as `cursor` until it is null. A cursor is bound to the account, the key's live/test scope and the filters; a page size change is allowed. The API promises no snapshot across requests: an event deleted mid-traversal is gone, and a newer one needs a fresh traversal. A live key sees every event of its account; a test key sees `webhook.test` and the events of documents whose emisor is in sandbox now, never usage events. An unknown query parameter is a `400` (#1460); a repeated supported one is a `422`. Only an account-wide key may call it; a key pinned to one emisor gets a `403`.

GET
/v1/events

Authorization

ApiKeyAuth webhooks:write
headerAuthorizationBearer <token>

Per-consumer API key sent as a bearer token: Authorization: Bearer <key>. Keys are scoped to a single Sello account (tenant). Modeled as HTTP bearer (not apiKey) so every generated SDK emits the Bearer prefix the engine requires; the scheme name stays ApiKeyAuth for contract stability. Every key belongs to one world, and the key says which. A key minted for production reads sello_live_…; one minted for sandbox reads sello_test_…. Each emisor is likewise production or sandbox, fixed when it is provisioned. A write that binds a key to an emisor — creating a document, ingesting a supplier comprobante, filing a Mensaje Receptor — is checked against that pairing, and the check runs ONE WAY (ADR-0040). A sello_test_ key acting on a production emisor is REFUSED with 403 Wrong key environment: it would sign a legally binding comprobante with the real certificate, burn a real consecutivo and file it with Hacienda, none of which can be undone. A sello_live_ key acting on a sandbox emisor is ALLOWED: it produces a sandbox document, which is never metered, since the emisor alone decides whether a document is billable. That pairing is usually a mis-classified emisor rather than a deliberate choice, so Sello logs it for its own operators — nothing about your request changes. The classification is not the destination (ADR-0067). Which Hacienda hears a document is decided by the emisor's Hacienda endpoints, which are a separate fact from its sandbox / production classification. So a sello_test_ key is refused on a sandbox emisor too when that emisor's endpoints are production endpoints — the same 403 Wrong key environment, because the document would be legally binding whatever the classification says. That combination is a misconfiguration on Sello's side of the line, not something you can fix with a different key: ask Sello to correct the emisor. The refusal follows the KEY, not how it was minted: an account-wide sello_test_ key naming that emisor is refused on the same request path, and a sello_live_ key is unaffected. The prefix is not decoration and not a hint you may edit: it is part of the hashed secret, so a key that authenticates at all is byte-identical to the one Sello minted. Read it to tell your own keys apart; you cannot change a key's world by rewriting it. To move between worlds, use the key that belongs to the world you mean. A key also says which operations it may run (#750). Each /v1 operation names one permission in its security requirement, and a key holds a non-empty set of them, fixed when it is created: documents:read (list, status, PDF, XML), documents:write (create, email), received-documents:read (list, get), received-documents:write (ingest, respond) and webhooks:write (register the endpoint). A key created without naming any holds all five, and so does every key created before permissions existed. A key without the permission an operation needs is refused 403 https://sello.cr/problems/insufficient-permission, naming it in requiredPermission, before anything else the operation does — an idempotent replay included. /reference/* needs no permission: any valid key reads it. To change what a key may do, create a new key and revoke the old one.

Scope: webhooks:write

Query Parameters

limit?string

Page size, 1 to 100 (default 50). ASCII digits only.

Match^[0-9]+$
cursor?string

The nextCursor of the previous page. Opaque.

Length1 <= length <= 2048
type?string

Only events of this exact type.

Value in"document.accepted""document.rejected""document.failed""document.iva_rate_divergence""deferral.lapsed""usage.approaching_limit""usage.limit_reached""usage.limit_exceeded""webhook.test"
documentId?string

Only events about this document. Excludes account-level events (usage, webhook.test).

Formatuuid
emisorId?string

Only events about documents of this emisor. Excludes account-level events (usage, webhook.test).

Formatuuid

Header Parameters

Sello-Version?string

Date-based API version (e.g. 2026-06-15). The /v1 path segment is the stable major; this header picks the dated contract. Optional: when it is omitted the server uses the account's pinned version, read from the API key's account after the key is verified. An account's pinned version is set to the deployment's global default when the account is created, and a later change of that default never moves it. A pinned version the server does not serve is 400 https://sello.cr/problems/unsupported-version; the server never answers under another date instead. The value must be exactly a YYYY-MM-DD calendar date with a year from 0001 to 9999 (the server also checks the day exists, leap years included), else 400 https://sello.cr/problems/invalid-version. A valid date the server does not serve is 400 https://sello.cr/problems/unsupported-version; today the only supported date is 2026-06-15. A failure to resolve the version is 503 https://sello.cr/problems/version-resolution-unavailable. The response Sello-Version header carries the resolved date. /reference accepts the header and ignores it.

Match^\d{4}-\d{2}-\d{2}$

Response Body

One page of stored events.

application/json
  1. response

One page of GET /v1/events.

data*array<|||||>

The stored envelopes, exactly as they are delivered.

nextCursor*|

Pass as cursor for the next page; null on the last page.

Example Request
curl -X GET 'https://api.sello.cr/v1/events'
Example Response
{  "data": [    {      "id": "string",      "type": "document.accepted",      "createdAt": 0,      "apiVersion": "string",      "data": {        "documentId": "string",        "accountId": "string",        "emisorId": "string",        "clave": "stringstringstringstringstringstringstringstringst",        "status": "accepted",        "mensajeHacienda": {          "mensaje": "1",          "detalleMensaje": "string"        },        "document": {          "clave": "stringstringstringstringstringstringstringstringst",          "tipo": "FE",          "numeroConsecutivo": "stringstringstringst",          "emisorId": "ffed7f26-5af9-4c47-8187-286731b1e596",          "state": "created",          "indEstado": "aceptado",          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z",          "fechaEmision": "2019-08-24T14:15:22Z",          "receptor": {            "identificacion": {              "tipo": "01",              "numero": "string"            }          },          "total": "string",          "currency": "string",          "exchangeRate": {            "tipoCambio": "string",            "source": "caller",            "bccr": {              "valor": "string",              "fecha": "2019-08-24"            }          },          "respuestaXml": "string",          "mensajeHacienda": {            "mensaje": "1",            "detalleMensaje": "string"          },          "deferral": {            "status": "pending",            "collected": "string",            "outstanding": "string",            "lapsesAt": "2019-08-24T14:15:22Z"          },          "warnings": [            {              "code": "cabys_not_in_catalog",              "message": "string",              "line": 0,              "appliedRate": "string",              "catalogRate": "string",              "cabys": "string",              "suppliedRate": "string",              "bccrRate": "string",              "bccrDate": "string",              "tolerance": "string"            }          ]        }      }    }  ],  "nextCursor": "string"}

Register or replace the account's webhook endpoint

Self-register (or replace) the single webhook endpoint Sello POSTs signed events to — every type in the `webhooks` section (document verdicts and failures, IVA-rate divergences, usage crossings). The endpoint is scoped to your API key's ACCOUNT — the account is never taken from the body, so a key can only ever manage its own account's endpoint. Provide the HTTPS `url` and the HMAC signing `secret` (used to sign every delivery; verify it with the `@magiios/sdk` `verifyWebhook` helper). Because Sello SERVER-FETCHES the `url` with your secret attached, it is validated against an SSRF blocklist at registration: a non-`https` scheme or a private / loopback / link-local / metadata host is a `422` and is never stored. This is an idempotent upsert (one endpoint per account); the response returns the registered `url` + `enabled` flag and NEVER echoes the secret. The endpoint receives every emisor's events, so only an account-wide key may set it: a key pinned to one emisor is refused with a `403` before the body is read, and nothing is written. DEPRECATED in favour of `PUT`, which shares this handler; the `POST` keeps working and carries no `Deprecation` or `Sunset` header. While an Odoo connection holds the endpoint the write is refused with a `409`.

Send a stored event again

Queue a NEW delivery of one stored event to the account's current enabled endpoint, with the stored body bytes unchanged (same `id`, `createdAt` and `apiVersion`) and a fresh retry budget. The event selection does not apply. Delivered, dead-lettered, never-delivered and filtered-out events can all be resent. `409` while a customer delivery of the event is still pending or in flight, when no enabled endpoint is registered, or while an Odoo connection holds the endpoint. An open circuit does not refuse; the job waits for it. Requires an `Idempotency-Key`: within 24 hours of acceptance the same key replays the original `202` (even if the endpoint changed since), and the same key for another event is a `409`. A refusal reserves no key. Any request body is ignored. `404` for an event this key may not see.