Appearance
Connect a Webhook Consumer to Relayter
A Webhook Consumer receives Relayter events at an endpoint in your system. You can route different event types to the same HTTPS URL or to separate URLs.
Create the connection
- Go to Team settings → Connections.
- Click Add connection.
- Enter a connection Name.
- Select Webhook Consumer as the Connection type.
- Optional: add receivers who should receive connection updates.
- Save the connection.
Relayter generates a Consumer Secret and Consumer Authentication value. Use these values to verify requests sent to your endpoint, and store them as credentials.
Add an event
- Open the connection and click Add event.
- Select the Relayter Event your system should receive.
- Enter the HTTPS Endpoint to which Relayter should post the event.
- Set the event Status to Enabled.
- Save the event.
Relayter only accepts HTTPS endpoint URLs. An event with a Disabled or Unhealthy status does not send data.
Verify incoming requests
Relayter sends each event as a JSON POST request with these headers:
| Header | Use |
|---|---|
Authorization | Bearer token containing the Consumer Authentication value. |
WebHook-Request-Origin | Identifies the Relayter event source. |
WebHook-Request-Timestamp | Request time in milliseconds. |
WebHook-Request-Signature | Hex-encoded HMAC-SHA256 signature. |
To verify the signature, concatenate the exact JSON request body, a period, and the timestamp header value. Calculate an HMAC-SHA256 digest using the Consumer Secret and compare its hexadecimal value with WebHook-Request-Signature.
text
signed message = <exact request body>.<Webhook-Request-Timestamp>Use a timing-safe comparison in your application. Also verify the bearer token and reject timestamps outside the age your integration permits.
Respond to Relayter
Return a response promptly. Relayter accepts 200, 201, 202, and 204 responses. Use 202 when you have accepted the event for asynchronous processing but have not finished processing it.
Repeated or terminal delivery failures can change the event status to Unhealthy. The connection details show its status and reason.
Read the payload
The request body contains a CloudEvents-style envelope with the event data. See Understand Webhook Event Payloads for the envelope, product payload, assets, exports, and expiring file URLs.