Set up webhooks

Register an HTTPS receiver, verify signed events, watch record changes and inspect notification attempts.

2 min read

Webhooks notify your backend when a Sage command completes or a watched resource changes. They are separate from the OAuth callback that returns a customer to your app after pairing.

Add an endpoint#

  1. Open Connections → View → Webhooks for the company.
  2. Select Add endpoint in the Endpoints card.
  3. Enter your receiver's public HTTPS Endpoint URL. Localhost and private network destinations are not supported.
  4. Select Copy secret and store the signing secret securely on your receiving server before registering. It will not be shown again.
  5. To receive record changes as well as command completions, enable Watch Sage records, choose the resources and a check interval.
  6. Select Register endpoint.
Add webhook endpoint dialog with an example HTTPS URL, masked signing secret and Watch Sage records option
Portal preview with example project and company data.

Command completion events are included by default. Record watching needs permission to list those resources. Supported polling intervals are every minute, every five minutes and every 15 minutes. Each connection supports up to ten webhook endpoints.

Webhooks tab with an Endpoints card and Add endpoint action
Portal preview with example project and company data.

Verify notifications on your server#

  1. Keep the raw request body before parsing JSON.
  2. Read webhook-timestamp and compute HMAC-SHA256 with the signing secret over timestamp + "." + rawBody.
  3. Compare the hexadecimal digest with the v1= value in webhook-signature using a constant-time comparison. Reject stale timestamps according to your receiver's replay policy.
  4. Deduplicate using webhook-id. Persist the event durably before responding with a successful 2xx status.
  5. Process the saved event asynchronously. Delivery has a five-second timeout and does not follow redirects.

Use the OpenAPI event schemas for each payload. A command completion can report failure; inspect the result. Notification delivery success means your receiver accepted the event, not that a Sage write succeeded.

Inspect webhook activity#

Open Webhook activity to see creation time, destination, status and attempts. Failed delivery can mean a signature mismatch in your receiver, an unreachable endpoint, a redirect, a timeout or a non-2xx response.

Webhook activity showing example delivered and failed notifications with attempt counts
Portal preview with example project and company data.

Automatic retries back off and stop after 12 attempts. The portal does not have a manual Retry action. Fix the receiving endpoint and reconcile any missed data through the API when automatic retries are exhausted.

Understand record changes#

Record notifications use polling. The next interval starts after a scan completes, so scan time, queue wait and retries add delay. Rapid edits can be coalesced, and a record created and deleted between scans can be missed. Handle event sequence and reset information in the schema, and use periodic reconciliation when you need a complete copy.

Remove an endpoint#

On Webhooks, select Remove, type remove in the modal and confirm. Future deliveries stop and pending deliveries for that endpoint are cancelled. The Sage connection itself stays linked.