Skip to main content
Listen to real-time events in your gigstack account. The Webhooks API allows you to configure endpoints that receive event notifications when specific actions occur in your system.

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

Retrieve all configured webhooks for your team. Query Parameters:
  • limit (integer, 1-100) - Number of results to return (default: 10)
  • status (string) - Filter by status: active or inactive
  • cursor (string) - Use next_cursor from the previous response, keeping the same team and status filter
  • team (string) - gigstack Connect: Target team ID
Example Request:
Example Response:
Results are ordered by creation time, newest first, with a stable ID tie-breaker. Continue while 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

Retrieve details of a specific webhook. Example Request:
Example Response:

Create Webhook

Create a new webhook endpoint to receive event notifications. Request Body:
Required Fields:
  • url (string) - Endpoint URL that receives the events. Use an HTTP or HTTPS URL without credentials or fragments; outbound delivery also checks public network destinations
  • events (array) - List of event types to subscribe to (see Available Events below)
Optional Fields:
  • description (string) - Human-readable description of the webhook
  • status (string) - active or inactive (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 - v1 or v2; omission on creation uses the team’s default.
  • type - gigstack_connect or null; Connect and teams.* events require a master team.
Example Request:
Example Response:
New endpoints do not return a legacy secret. Header values and signing keys are entered or rotated only in the authenticated browser. A newly generated signing key is returned once as signing_secret after a confirmed write; operation readback never returns it.

Update Webhook

Update an existing webhook’s configuration. Request Body: All fields are optional. Only include fields you want to update.
Example Request:

Delete Webhook

Permanently delete a webhook endpoint. Example Request:
Example Response:

Recover a configuration change

Save a fresh UUID v4 before POST or PUT. If the response is lost, read that same operation:
HTTP 200 means the read succeeded. Inspect 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 the apiAndWebhooks 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.synced always uses its own body. Configured endpoints use Webhook-Signature; existing legacy endpoints may additionally use X-Gigstack-Signature. It is sent only once.
  • invoice_batch.completed always uses its own body, and is delivered like sat.invoice.synced: one attempt with the same configured and legacy signature behavior. Despite the prefix, it is not an invoice.* resource event.
  • payment_batch.completed always uses its own body and is delivered exactly like invoice_batch.completed. It is not a payment.* resource event.

Webhook Structure

Webhook Object

Webhook Payload

Each delivery is an HTTP POST 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 v2 body has type and data.object.
  • A v1 body has event, team and webhook.
Saving a webhook in the dashboard switches it to 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:
  1. Add a secret header to the webhook in the dashboard, for example Authorization: Bearer <random token>.
  2. Reject any request that doesn’t carry it.
Custom headers can be configured through the authenticated browser API; agent and ordinary API credentials cannot submit these private fields. Explicitly configured headers/signing must resolve successfully before delivery; the sender does not silently send without them on credential lookup failure. Changing or disabling the new signing configuration does not rotate or disable an existing legacy signature. The legacy 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 2xx response counts as delivered.
  • 408, 429, 5xx, timeouts and network errors are retried with exponential backoff, up to 16 attempts in total.
  • Any other 4xx is final and is not retried, so don’t return a 4xx for 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.
A delivery can still be missed, so treat webhooks as notifications and reconcile periodically against the API, for example with 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, uses Webhook-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, install express 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:
Save this as receiver.cjs. The insert runs as one committed PostgreSQL statement; a duplicate delivery returns success without creating another work item.
Start it with node receiver.cjs and register its HTTPS route. This is a complete intake example; you must implement the worker and reconciliation for your product:
  1. Claim unprocessed rows durably, with a database transaction or a queue lease so concurrent workers do not process the same row at once.
  2. For sat.invoice.synced, read the SAT invoice using payload.data.uuid. For invoice_batch.completed, retrieve the batch using payload.data.id and page through its items. Use credentials belonging to the intended team.
  3. Upsert your own records using stable business IDs. Commit your changes and mark processed_at only after success. If your effect is in another system, use that system’s idempotency mechanism and reconcile uncertain outcomes.
  4. 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.
  5. Poll the relevant API periodically to discover missed notifications. Signed events are sent once: a 503 from this receiver does not cause gigstack to retry them. Alert on inbox failures and reconcile the gap.
Test intake separately from your worker: send the same correctly signed fixture twice and expect one row; alter its body without recomputing the signature and expect 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 on request.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 with file_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 no X-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; even expected_livemode: false can send a real HTTP request to that endpoint.
Use a fresh UUID for each deliberately new operation; the UUID above is illustrative. The backend loads the saved URL, headers and signing configuration. Do not supply a URL, raw payload, credentials or endpoint ID in the body. Saved inactive endpoints can be tested without enabling ordinary event delivery. The endpoint ID comes from the path, and 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

Preserve both the original UUID and mode, including after changing the account’s current mode. The result includes separate 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

  1. Start your local server:
  1. Create an ngrok tunnel:
  1. Use the ngrok HTTPS URL in your webhook:

Best Practices

  1. Subscribe to specific events - Only listen to events you need to reduce noise
  2. Use inactive status for testing - Create webhooks with status: "inactive" to test configuration before enabling
  3. Plan for missed and duplicate deliveries - Resource events are retried but can still arrive more than once or not at all, and sat.invoice.synced and invoice_batch.completed are never retried; de-duplicate, and reconcile periodically against the API
  4. Log webhook events - Keep audit logs of received webhooks for debugging
  5. Monitor webhook performance - Track delivery success rates and response times
  6. Version your webhook endpoints - Use versioned URLs (e.g., /webhooks/v1/gigstack) for easier updates
  7. Handle all event types - Include a default case for unknown event types to future-proof your integration

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