Webhooks

Start unattended jobs from new documents, using callbacks or a durable event inbox.


Finbar creates a document.published event when a new eligible document is ready to read. Subscribe to a company, a set of companies, or a personal watchlist. Use signed HTTP callbacks, poll the event inbox, or combine both. Polling works for an unattended machine without a public endpoint.

Subscriptions belong to the billing account and require a paid plan with public API access. Authorized users and clients on that account can manage them. Each account supports up to 1,000 subscriptions. Delivery and inbox reads do not use your document-read quota; reading the document uses the normal allowance.

Set up an unattended job

  1. Create a personal REST API credential with Read & write access. See authentication.
  2. Create or select a watchlist through REST or the MCP manage_watchlists tool.
  3. Create a subscription and persist its ID. For a polling machine:
curl --fail-with-body --silent --show-error \
  'https://api.finbar.com/v1/webhooks' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: earnings-watchlist-v1' \
  --data '{"watchlist_id":"YOUR_WATCHLIST_UUID","delivery_mode":"poll"}'
  1. Poll /v1/webhooks/{webhook_id}/events, saving received events and the returned checkpoint atomically before starting work. See the polling contract below.
  2. Read the document using its document_id, then run your job.

Setup requires read and write. A running poller only needs read, including when it reads the published documents. Credentials must already grant requested scopes; rotating a credential does not add permissions.

The repository includes a runnable Python receiver, poller and durable job worker in finbar/manual/webhooks/example/, including setup commands and restart tests. It groups initial work by company and reporting period and can optionally run follow-up jobs for later documents.

Select documents and delivery

Supply exactly one selector:

FieldMeaning
entity_idOne company ID; compatible with existing subscriptions
entity_idsA fixed set of up to 1,000 company IDs
watchlist_idA live personal watchlist; new members apply to future publications

A watchlist subscription requires the billing account to belong to the watchlist owner. Personal machine clients use their owner's lists. Team machine clients can subscribe with explicit entity IDs instead.

Optionally provide document_types, such as ["FULL_FINANCIAL_REPORT"]. Omitted or empty filters include all document types. See document types. Membership removal or a filter change cancels affected pending work. Removing and re-adding a company does not restore old events. Renaming a list preserves its subscription; deleting it permanently disables dependent subscriptions.

delivery_modeCallback URLBehavior
webhook (default)RequiredSigned HTTP delivery and retained inbox
pollOmitInbox only; no signing secret
bothRequiredSigned delivery with polling available for recovery

Callbacks must use public HTTPS on port 443. Private addresses, embedded URL credentials and fragments are rejected. Finbar does not follow redirects.

For callback modes, creation returns a base64-encoded 32-byte signing_secret. Save it securely. Inspect and list endpoints never return secrets. Creation, secret rotation, test delivery and replay accept Idempotency-Key: reuse the same key and request on retries for up to 24 hours. Different input with the same key returns 409 idempotency_conflict. Creation/rotation retries recover the original secret during that window. Keys are scoped to actor, account and operation; use a fresh key for a new operation.

Publication semantics

Each qualifying document produces a separate event. This does not define a single company-level earnings event. To start one initial job, deduplicate by company and reporting period in your own workflow; handle later documents as optional follow-ups. If period information is missing, use document ID.

Documents already ready when you subscribe are excluded. Reprocessing and metadata corrections do not produce another event. Email alerts and webhooks exclude documents with a reporting year before 2023, or at least two years behind the latest available document for that entity. The comparison includes all document types and uses the reporting period year, falling back to the report date. Documents without a usable year are excluded. This same existing eligibility check applies to retries, replay and inbox reads.

{
  "id": "962410e0-738c-4479-b90b-85674cc3b350",
  "type": "document.published",
  "occurred_at": "2026-10-28T12:00:00Z",
  "subscription_id": "53948a28-5a7b-4396-84b1-3e4b87d36013",
  "document": {
    "document_id": "D-YOUR_DOCUMENT_ID",
    "entity_id": "O-YOUR_ENTITY_ID",
    "period": {"year": 2026, "period_type": "Q", "period": 3},
    "publish_date": "2026-10-28T00:00:00Z",
    "report_date": "2026-09-30T00:00:00Z",
    "status": "PARSED",
    "type": "FULL_FINANCIAL_REPORT"
  }
}

The event contains document metadata, not text or storage URLs. Use document reads for content. Synthetic events have "test": true and placeholder document IDs: verify and acknowledge them, but never start production work or try to read their document.

New events use the document read contract's nullable dates, including the temporary safeguard for publication timestamps equal to report timestamps. occurred_at records when Finbar marked the document ready; it is separate from the issuer's publication date. Events already stored retain their original payloads, including date metadata.

Poll and recover

GET /v1/webhooks/{webhook_id}/events returns items, next_cursor, has_more and retention_days: 30. Each item has sequence, created_at, event, and an optional cancelled_reason.

  • Start without cursor to read the retained inbox. Use limit from 1–100 (default 50).
  • Store events, job intents and next_cursor in one durable transaction. Reuse that cursor on the next request, including after an empty page.
  • Continue immediately while has_more is true; otherwise wait before polling.
  • Skip items with cancelled_reason and events marked test, while still advancing the checkpoint. Use event ID to deduplicate callback/poll overlap.
  • A checkpoint older than retained history returns 410 event_retention_gap. Stop, reconcile missed work against document reads, and explicitly establish a new checkpoint. Do not silently reset it.

Cursors are bound to the account and subscription. The sequence follows durable inbox insertion order, so concurrent event creation cannot insert behind a saved checkpoint. It does not imply publication-time ordering. Events remain available for 30 days independently of HTTP delivery success or retry exhaustion.

Poll requests share an account limit of 60 per minute, burst 10. Management uses a separate limit of 60 per minute, burst 10. Honor Retry-After on 429, and retry temporary failures with backoff. Keep the last committed checkpoint.

Verify callbacks

Requests include Webhook-Id (event ID), Webhook-Timestamp (Unix seconds for this attempt), and Webhook-Signature (one or more space-separated v1= HMAC signatures). Base64-decode the signing secret. Sign the exact bytes of:

Webhook-Id + "." + Webhook-Timestamp + "." + raw_request_body

Use HMAC-SHA256 and compare hexadecimal digests in constant time. Accept a matching signature from any configured current/overlapping key. Reject timestamps more than five minutes from your clock and keep clocks synchronized. Verify the raw body before trusting any event fields. Each attempt gets a fresh timestamp.

After verification, commit the event to durable storage and return 2xx promptly. Run the job separately. Delivery is at least once; retries, replay and polling can all supply an event you have already processed. A durable event-ID uniqueness constraint prevents duplicate job admission. A stable downstream job key is also needed when a worker crashes after an external action but before recording success.

Requests time out after 10 seconds. Network failures and non-2xx responses are retried for up to 24 hours, with increasing, jittered delays capped at one hour. Exhaustion marks that delivery failed; later events continue. Manual replay keeps the event ID and attempt history, and starts a fresh 24-hour retry window. It requires a retained, currently eligible event and an active, unpaused callback subscription. Replaying a pending delivery does not create a second delivery.

Maintain and diagnose

Reads require read. Request read and write to create or maintain subscriptions.

Method and pathPurpose
GET /v1/webhooksList account subscriptions
GET /v1/webhooks/{webhook_id}Inspect settings and health
PATCH /v1/webhooks/{webhook_id}Change url, document_types, paused or alert_user_id
DELETE /v1/webhooks/{webhook_id}Stop future and queued delivery
GET /v1/webhooks/{webhook_id}/deliveriesDelivery status, cumulative attempts and last failure
GET /v1/webhooks/{webhook_id}/eventsPoll retained events
GET /v1/webhooks/{webhook_id}/events/{event_id}Inspect one retained event
POST /v1/webhooks/{webhook_id}/testCreate a clearly marked synthetic event
POST /v1/webhooks/{webhook_id}/events/{event_id}/replayRequeue an eligible real event
POST /v1/webhooks/{webhook_id}/rotate-secretReturn a replacement signing secret

Selectors and delivery mode are fixed at creation. Patch a callback URL without recreating the subscription. Pausing suspends HTTP attempts while inbox collection and polling continue; it does not extend an existing retry window.

Rotation signs with both old and new keys for 24 hours. Install the returned key on your receiver, then retire the old one after secret_overlap_until. A second rotation is rejected during this overlap. Use an idempotency key to recover a lost rotation response.

Health includes last_event_at, last_polled_at, last_success_at, consecutive_failures, failure_started_at, retention_start, and on inspect next_attempt_at when queued work exists. History excludes response bodies and secrets. Optional alert_user_id selects a registered member of the billing account for a sustained-failure email (at least three failures over 15 minutes) and a recovery email. An empty string removes the recipient. Arbitrary email addresses are not accepted.

Revoking the creating credential does not delete a subscription. Account eligibility is checked before dispatch; an account interruption does not cause old publications to be delivered after restoration. A request already in flight may complete after a pause, deletion, membership change or loss of account access.