Global Webhooks

Some external apps require webhooks to be configured on the global level rather than per-connection.

Global Webhooks are a way to handle this.

Each global webhook has a key and provides a function to handle data sent to the webhook.

Configuration

When a connector is added to a workspace, integration.app generates a global webhook URL unique to the connector and workspace.

The developer needs to take this URL and provide it to the external app as a webhook (usually as part of the OAuth application configuration).
You should provide details on how to do this in the connector documentation.

Implementation

Handle

The handle function is called when data is sent to the webhook.

Arguments:

  • query – object, webhook request query received from the external app
  • data – object, webhook request body received from the external app (parsed based on Content-Type)
  • headers – object, webhook request headers received from the external app
  • parameters – connector parameters configured on the integration the webhook belongs to
  • rawBody – string, raw unparsed body of the webhook request (useful for signature verification or when you need access to the original request body)

Result:

  • events – list of events. Each event has the following properties:
    • selector (string) – selector to find matching external event subscriptions (see [doc:connector-builder/events])
    • payload – arbitrary event payload that will be passed to matched subscriptions.
  • response – object, optional HTTP response with properties:
    • headers – object
    • status – number
    • data – HTTP body (based on Content-Type)