Skip to main content

Register an Inbound Webhook

  1. Go to Settings > Webhooks, under Developers, and find the Inbound Webhooks section.
  2. Click Add, then give the webhook a name and description.
  3. Save. Courier generates a unique URL to send events to.
The name is permanent, and it’s how you select the webhook when you set up the trigger below. See Inbound Webhooks for the full reference on registration and payload handling.

Configure the Webhook

Use the webhook URL that was generated in the previous step to configure the webhook in your system. Exercise a normal workflow to trigger various events to Courier, which will enable them as configuration options in the Automation trigger.

Inbound Webhook Payload

Courier accepts any payload up to 6Mb in size. If the payload is a JSON object, Courier will parse the payload and make the data available to you in the Automation. If the payload is not a JSON object, Courier will make the entire payload available to you in the Automation as a raw string. If the JSON object is an array, Courier will parse each object in the array and trigger an automation for each incoming event. For JSON objects, Courier will extract the following fields if they are present.
  • event - The name of the event that triggered the webhook. You can filter by the name when you set up the webhook trigger in Automations. If no string field named event is present, Courier will use “Custom” as the default name.
  • userId - A user identifier attached to the event. Courier will use this value to identify the user in the Automation, and automatically load associated profile data into the automation context.
  • properties.courier.automation - A JSON object containing one of the following fields:
    • template - The id of an existing automation template to invoke, instead of using a configured webhook trigger.
    • steps - A JSON object containing the steps for an ad-hoc automation to execute.

Using the Webhook trigger in an Automation

  1. Go to Automations and create a new automation
  2. Drag and drop “Webhook” from the list of triggers.
  3. In the Source field, select your registered inbound webhook name.
  4. After you select the webhook, you can select the event name from a list of any received events, or Custom if your payload did not contain named events.
The data payload in the webhook will be available to you in the Automation in the normal data object, accessed with refs.data. If you don’t see any options in the Event field, make sure you have sent at least one event to the webhook from the source system.