Overview
Webhooks enable you to build event-driven integrations by receiving automatic HTTP POST notifications when events occur in your gigstack account. Configure which events to listen for and where to receive them.Key Features
- Real-time Notifications - Instant event delivery to your endpoints
- Event Filtering - Subscribe only to events you need
- Status Control - Enable/disable webhooks without deletion
- Multi-event Support - Single webhook can listen to multiple event types
- Automatic Retries - Failed deliveries of resource events are retried with backoff (see Delivery Behavior)
Endpoints
List Webhooks
limit(integer, 1-100) - Number of results to return (default: 10)status(string) - Filter by status:activeorinactivecursor(string) - Usenext_cursorfrom the previous response, keeping the same team and status filterteam(string) - gigstack Connect: Target team ID
has_more is true; pass next_cursor as the next request’s cursor.
A cursor used with a different team or status filter returns HTTP 400. This is
cursor pagination, not a snapshot: configuration changes between requests can
change the remaining results.
Get Webhook
Create Webhook
url(string) - Endpoint URL that receives the events. Use an HTTP or HTTPS URL without credentials or fragments; outbound delivery also checks public network destinationsevents(array) - List of event types to subscribe to (see Available Events below)
description(string) - Human-readable description of the webhookstatus(string) -activeorinactive(default:active). Only inactive endpoints may have an empty events list.operation_id(UUID v4) - Persist before the request; use it for recovery. Required for secret changes.expected_revision(string) - Revision returned by GET; required when updating secrets.version-v1orv2; omission on creation uses the team’s default.type-gigstack_connector null; Connect andteams.*events require a master team.
New endpoints do not return a legacysecret. Header values and signing keys are entered or rotated only in the authenticated browser. A newly generated signing key is returned once assigning_secretafter a confirmed write; operation readback never returns it.
Update Webhook
Delete Webhook
Recover a configuration change
Save a fresh UUID v4 before POST or PUT. If the response is lost, read that same operation:operation.status: processing or
outcome_unknown requires status reads and operator reconciliation, with no automatic
new UUID or repeated secret entry. conflict means configuration was not installed;
refresh the endpoint and explicitly review a new operation. A completed historical
operation can have data: null if the endpoint was subsequently deleted. Reading it
never recreates an endpoint. data is the current saved endpoint, not a frozen snapshot.
Review private configuration in the browser
Configuration applies to the team’s live and test events. Creating or updating requires current administrator authority. Personal administrators on v2 plans need theapiAndWebhooks feature; legacy plan access is preserved. Status reads and authorized
deletion remain available after a downgrade.
For a saved endpoint, GET /webhooks/{id}?team=TEAM&configuration_access=true verifies
the current credential and admin role. configuration_access identifies the team,
endpoint, actor and revision, and can_configure reports the current plan gate.
Default GET remains a safe endpoint read. Neither returns secret values.
The authenticated browser may send security: { "headers": { ... } } or
signing: { "enabled": true, "rotate": true } with the stable operation ID and current
revision. Omission preserves existing headers; an empty headers object clears them.
A replacement supplies the whole header set. Do not enter secrets into MCP/CLI
arguments, prompts, shell history or an agent transcript. A new signing key is shown
only on the first successful browser response and cannot be recovered from GET.
DELETE accepts an optional expected_revision body. It removes only that endpoint,
retains stored secret resources, and preserves sibling endpoints. After an uncertain
response, GET the endpoint: 404 proves absence, not which caller removed it.
Available Events
A webhook can subscribe to any of these event types:
Master teams also accept
teams.created, teams.sat.completed,
teams.stripe.completed, teams.openpay.completed, and teams.sat.manifest.signed.
Delivery families.
- Resource events use the webhook’s payload version, retry policy, and configured headers/signing.
sat.invoice.syncedalways uses its own body. Configured endpoints useWebhook-Signature; existing legacy endpoints may additionally useX-Gigstack-Signature. It is sent only once.invoice_batch.completedalways uses its own body, and is delivered likesat.invoice.synced: one attempt with the same configured and legacy signature behavior. Despite the prefix, it is not aninvoice.*resource event.payment_batch.completedalways uses its own body and is delivered exactly likeinvoice_batch.completed. It is not apayment.*resource event.
Webhook Structure
Webhook Object
Webhook Payload
Each delivery is an HTTPPOST to your URL with Content-Type: application/json. Respond with any 2xx status within 10 seconds.
Payload versions
Each webhook sends resource events in one of two body formats:
The webhook object returned by the API does not include its version, but you can tell the two apart by shape:
- A
v2body hastypeanddata.object. - A
v1body hasevent,teamandwebhook.
v2.
v1 body
A
v1 body has no unique delivery id. Do not permanently de-duplicate by event
plus data.id: two legitimate customer.updated events for one customer have the
same pair. Store each received notification and make processing idempotent by reading
the current resource and upserting its state in your application. Include the team
and mode in your local resource key. For irreversible effects, reconcile the business
operation rather than treating a notification as authority to repeat it.
Prefer v2 when you need a stable delivery ID. Saving a webhook in the dashboard
switches it to v2; update your parser before doing so. A duplicate v2 delivery can
contain a newer resource state, so use it as a signal to reconcile current state,
not as a permanent historical snapshot.
Teams on the legacy v1.1 default receive the same object wrapped as { "payload": { … } }. For invoice.created, their data also includes a customer object with the full address, and date is shifted by −6 hours.
v2 body
Headers
Resource events support optional signing and custom headers. To authenticate with a custom header:
- Add a secret header to the webhook in the dashboard, for example
Authorization: Bearer <random token>. - Reject any request that doesn’t carry it.
X-Gigstack-Signature exists only when an old endpoint still has its legacy secret. New endpoint creation does not generate that field. Do not recreate an endpoint expecting a new legacy signature.
SAT sync event body
sat.invoice.synced is sent by the SAT download service. Its body is the same regardless of the webhook’s payload version:
Compared with resource events, the type is in
event, the time is created_at in seconds, and there is no livemode.
data fields
Invoice batch event body
invoice_batch.completed is sent once, when every accepted invoice of an income invoice batch has a final status. Like the SAT event, its body is the same regardless of the webhook’s payload version, the type is in event and created_at is in seconds:
Payment batch event body
payment_batch.completed is sent once, when every accepted payment of a payment batch has a final status. Same conventions as the invoice batch event: the type is in event, created_at is in seconds, and data.rejected is a count:
data.counts holds the accepted payments by final status: registered, failed, duplicate (queued is 0). Read the details with GET /payments/register/batch/{id}.
Delivery Behavior
Deliveries go to every active webhook subscribed to the event. Order across events is not guaranteed, and the same event can arrive more than once. Resource events- Each attempt times out after 10 seconds.
- A
2xxresponse counts as delivered. 408,429,5xx, timeouts and network errors are retried with exponential backoff, up to 16 attempts in total.- Any other
4xxis final and is not retried, so don’t return a4xxfor a failure you want redelivered. - Webhooks are never disabled automatically because of failed deliveries.
sat.invoice.synced, invoice_batch.completed and payment_batch.completed
- One attempt with a 10-second timeout. It is never retried, and your response is ignored.
GET /payments, GET /invoices/sat for SAT invoices, or GET /invoices/income/batch/{id} and GET /payments/register/batch/{id} for a batch.
Verifying Signatures
There are two signature formats; verify the one configured for your endpoint. Configured delivery signing, including SAT and invoice-batch events, usesWebhook-Id, Webhook-Timestamp (Unix seconds), and
Webhook-Signature: v1,<base64 HMAC-SHA256>. The signed string is
Webhook-Id + "." + Webhook-Timestamp + "." + rawBody. Use the complete signing-key
string, including its whsec_ prefix, as the HMAC key; do not base64-decode it.
Compare signatures in constant time, reject timestamps outside a short tolerance,
and deduplicate deliveries. Signing must be explicitly enabled and configured.
The receiver examples below apply to the legacy X-Gigstack-Signature on
existing SAT and invoice-batch endpoints. That format signs only the raw request
bytes with the previously stored legacy secret and prefixes the hex digest with
sha256=. It is not interchangeable with Webhook-Signature. New endpoint
creation does not return a legacy key.
Node.js / Express
This example is a receiver for signed SAT and invoice-batch events only. It verifies the original bytes and commits the event to PostgreSQL before replying. It does not import an invoice or complete your business workflow in the request. Use a separate route with a configured secret header for unsigned resource events; do not disable signature verification to mix the two families. In your own integration project, installexpress and pg. Set DATABASE_URL to
your database, GIGSTACK_WEBHOOK_ID to this webhook’s ID and
GIGSTACK_WEBHOOK_SECRET to its previously stored legacy secret. Keep them in your local secret
configuration. Use your database provider’s required TLS settings.
Create this inbox table in that database:
receiver.cjs. The insert runs as one committed PostgreSQL statement;
a duplicate delivery returns success without creating another work item.
node receiver.cjs and register its HTTPS route. This is a complete
intake example; you must implement the worker and reconciliation for your product:
- Claim unprocessed rows durably, with a database transaction or a queue lease so concurrent workers do not process the same row at once.
- For
sat.invoice.synced, read the SAT invoice usingpayload.data.uuid. Forinvoice_batch.completed, retrieve the batch usingpayload.data.idand page through its items. Use credentials belonging to the intended team. - Upsert your own records using stable business IDs. Commit your changes and mark
processed_atonly after success. If your effect is in another system, use that system’s idempotency mechanism and reconcile uncertain outcomes. - On failure, retain the row, record a redacted error, and retry it with a bounded policy. A restart must resume unfinished rows; an in-memory set cannot do this.
- Poll the relevant API periodically to discover missed notifications. Signed
events are sent once: a
503from this receiver does not cause gigstack to retry them. Alert on inbox failures and reconcile the gap.
401;
stop the database and expect no 200; restart the worker and confirm unfinished rows
are processed. These are integration checks to run in your own environment, not claims
that this PostgreSQL example was exercised against a live webhook in the docs audit.
Python / Flask
This is a signature-verification helper, not a complete receiver. Call it onrequest.get_data() before parsing JSON, then persist/enqueue the verified event
before returning 2xx, following the inbox requirements above.
PHP
This helper performs signature verification only. Read the raw request bytes withfile_get_contents('php://input'), pass the signature header and stored secret,
and persist/enqueue the verified event before acknowledging it.
Resource-event authentication and processing
Resource events have noX-Gigstack-Signature. Configure a secret custom header in
the dashboard and compare it in constant time on a separate resource-event route.
Use the authenticated browser configuration flow to set the private header. Keep that route closed
until the header is configured, and do not accept unsigned requests on the signed route.
For a v2 resource event, persist the delivery with its id before acknowledgment,
then reconcile data.object with the corresponding GET endpoint. For v1/v1.1,
retain each notification with your own inbox ID; the resource identity is not a
unique delivery ID. Handle deletion notifications using the last known state and
an idempotent local tombstone. Keep the two payload versions’ field names and
millisecond timestamps distinct from the signed events’ second-based timestamps.
Testing Webhooks
Using webhook.site
For development and testing, use webhook.site to inspect webhook payloads:Send a test event through the API
Use a verified personal credential (Firebase sign-in or a signed personal MCP credential). An ordinary team API key cannot submit these manual operations. Save the operation UUID before sending, and explicitly confirm the selected team, mode and outbound delivery. A test uses a saved endpoint and an existing resource in your authorized scope; evenexpected_livemode: false can send a real HTTP request to that endpoint.
team is required. A connected endpoint can select an authorized
source_team_id; the backend checks its active connection and billing relationship.
Read delivery status after a timeout
submission and delivery fields.
submission: submitted means the queue accepted the operation; only
delivery: delivered reports successful receiver delivery. submission: unknown
with delivery: pending does not establish whether submission happened. Readback
is read-only and never retries a send. Do not automatically repeat the POST or
create a fresh UUID after a timeout. The receiver must tolerate duplicate delivery.
Retry a stored event or send current state
A retry body contains
operation_id, expected_livemode, confirmed: true and
acknowledge_duplicate_delivery: true. The log ID comes from the path.
A current-state send also requires event and resource_id, like a test. Its optional
log_id supplies context only; it does not restore the old payload.
For v2 payloads, the worker refreshes resource state at delivery even when retrying
a stored event. The receipt states payload_semantics and
v2_state: current_at_delivery; it does not promise exact historical receiver bytes.
Older logs, oversized events or deleted resources without a provable retained snapshot
may return 409 with original_webhook_snapshot_unavailable. Do not invent a payload
or silently substitute current state. Review a separate current-state send if the
resource still exists. Changed permissions, mode, endpoint or resource scope stop the
operation before delivery. The browser uses these same server operations; receiver
CORS support is not required for a browser-side fallback.
Local Testing with ngrok
- Start your local server:
- Create an ngrok tunnel:
- Use the ngrok HTTPS URL in your webhook:
Best Practices
- Subscribe to specific events - Only listen to events you need to reduce noise
- Use inactive status for testing - Create webhooks with
status: "inactive"to test configuration before enabling - Plan for missed and duplicate deliveries - Resource events are retried but can still arrive more than once or not at all, and
sat.invoice.syncedandinvoice_batch.completedare never retried; de-duplicate, and reconcile periodically against the API - Log webhook events - Keep audit logs of received webhooks for debugging
- Monitor webhook performance - Track delivery success rates and response times
- Version your webhook endpoints - Use versioned URLs (e.g.,
/webhooks/v1/gigstack) for easier updates - Handle all event types - Include a default case for unknown event types to future-proof your integration
Related Resources
- Payments API - Process payments that trigger webhook events
- Invoices API - Create invoices that generate webhook events
- Receipts API - Manage receipts with webhook notifications
- Clients API - Customer management with webhook events
Error Handling
Errors use the standard error envelope.Validation Error (400)
Returned when the body is invalid: a malformed url, an unknown event type, or a missing required field. details lists each problem as field: problem.
Webhook Not Found (404)
For additional assistance, contact support@gigstack.io