Webhook payload
Learn about the content of the payload received.
About webhook payload
You have the flexibility to specify which webhooks (ie events) you would like to receive. To optimize the volume of HTTP requests directed to your server, it's advisable to only subscribe to the events you're equipped to manage. For detailed guidance on setting up webhooks, refer to the "Subscribing to Swapcard's webhooks" section.
Delivery Headers
When you receive an HTTP POST request on the url configured for Swapcard's webhooks, it will include several specific headers:
Header | Description |
---|---|
Content-Type | Indicates the content type of the request (e.g., application/json). |
User-Agent | Identifies the agent sending the request (e.g., Swapcard/Webhook). |
X-Signature-256 | A HMAC hex digest used for request authentication. |
Delivery payload fields
The JSON body of each request will vary based on the action that initiated the request. Below is a list of top-level fields in the payload:
Field | Required | Type | Description |
---|---|---|---|
context | Yes | Context | Includes information such as the event ID, community ID (if the action happened on the community profile) and the user ID. |
eventProfile | Optional, present if action taken on profile | Profile | Details of the profile on which the action was taken |
eventExhibitor | Optional, present if action taken on exhibitor | Exhibitor | Details of the exhibitor on which the action was taken |
action | Yes | string, one of profile_update , profile_create , exhibitor_create , exhibitor_update | Specifies the action. |
datetime | Yes | ISO datetime string | Timestamp of the action |
To get the full payload detail of each webhook, have a look at the reference page.