Replace the account's webhook endpoint
Register (or replace) the single webhook endpoint Sello POSTs signed events to — the replace of this resource, and the method to use (#758). Same body, same validation and same answers as the deprecated `POST`: the endpoint is scoped to your API key's ACCOUNT, never the body; the `url` is checked against an SSRF blocklist at registration (a non-`https` scheme or a private / loopback / link-local / metadata host is a `422`, never stored); the response returns `url` + `enabled` and NEVER the secret. Only an account-wide key may set it: a key pinned to one emisor is refused with a `403` and nothing is written. While an Odoo connection holds the endpoint (`managedBy: odoo-connection` on the `GET`) the write is refused with a `409` and nothing changes. A new `secret` at the same `url` starts a 24-hour overlap: each delivery carries a `v1` signature for the new secret first and one for the previous secret last, until `previousSecretExpiresAt`. Set `expirePreviousSecret` to skip the overlap. A new `url` clears it.
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}$application/json- body
Registration for the account's single webhook endpoint. url MUST be an https URL on a public host (validated against an SSRF blocklist server- side; a private/loopback/metadata target is a 422). secret is the HMAC signing secret every delivery is signed with — store it, verify inbound deliveries with it; the API NEVER returns it. enabled (default true) toggles delivery without deleting the endpoint.
url*stringThe HTTPS callback URL Sello POSTs signed events to.
uri1 <= length <= 2048secret*stringHMAC-SHA256 signing secret. Sent write-only — the API never returns it.
16 <= length <= 256enabled?booleanWhether deliveries are enabled. Defaults to true.
trueexpirePreviousSecret?booleanRetire the previous signing secret with this write instead of keeping it for the 24-hour rotation overlap. Use it when the old secret may have leaked. It stops new signatures only: a request already signed with the old secret stays valid at a receiver that still trusts it, within that receiver's replay tolerance.
falseeventTypes?array<>|The event selection. Omitted or null selects every event type: a PUT or POST replaces the whole registration, so leaving it out resets an earlier selection.
The webhook endpoint was registered (or replaced).
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 PUT 'https://api.sello.cr/v1/webhooks/endpoint' \ -H 'Content-Type: application/json' \ -d '{ "url": "http://example.com", "secret": "stringstringstri"}'{ "url": "http://example.com", "enabled": true, "previousSecretExpiresAt": "2019-08-24T14:15:22Z", "eventTypes": [ "document.accepted" ]}Read the account's webhook endpoint
What is registered: the `url`, whether delivery is `enabled`, when it was created and last changed, and `managedBy` — `odoo-connection` when an Odoo connection's callback holds the endpoint (the writes then answer `409`), otherwise null. NEVER the signing secret. A `404` when no endpoint is registered. Only an account-wide key may read it; a key pinned to one emisor gets a `403` (#758).
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).