Retire the previous signing secret now
End the rotation overlap early (#741). After a secret change at the same `url`, Sello signs each delivery with the new secret and the previous one for 24 hours. This stops the previous signature on every delivery signed after the call commits, without changing the current secret, the `url` or `enabled`. A request already signed with the old secret is not revoked: a receiver that still trusts it accepts it within its replay tolerance. Idempotent: with no overlap open the endpoint is returned unchanged. `404` when no endpoint is registered, `409` while an Odoo connection holds it. Only an account-wide key may call it; a key pinned to one emisor gets a `403`.
ApiKeyAuth webhooks:writeAuthorizationBearer <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
Sello-Version?stringDate-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.
^\d{4}-\d{2}-\d{2}$The previous secret is retired; previousSecretExpiresAt is null.
application/json- response
The registered webhook endpoint. The signing secret is NEVER included.
url*stringThe registered HTTPS callback URL.
urienabled*booleanWhether deliveries are currently enabled.
previousSecretExpiresAt*|When the previous signing secret stops signing new deliveries, or null when no rotation overlap is open (#741).
date-timeeventTypes?array<>|The endpoint's event selection (#1458). Null (the default) means every current and future event type; [] means no automatic delivery; a list means only its members, so a type added later stays out until you add it. Exact names, no duplicates. It filters automatic deliveries only: resend and the portal test button ignore it, and every event is stored either way.
curl -X POST 'https://api.sello.cr/v1/webhooks/endpoint/expire-previous-secret'{ "url": "http://example.com", "enabled": true, "previousSecretExpiresAt": "2019-08-24T14:15:22Z", "eventTypes": [ "document.accepted" ]}Remove the account's webhook endpoint
Remove the endpoint, which stops every delivery: an event with no endpoint is not queued. `204` with no body on success, `404` when none was registered, `409` while an Odoo connection holds it. Only an account-wide key may remove it; a key pinned to one emisor gets a `403` (#758).
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`.