skip to Main Content
  1. Home
  2. Knowledge Base
  3. Webhooks
  4. Incoming Webhook Triggers

Incoming Webhook Triggers

Uncanny Automator and Uncanny Automator Pro support both incoming webhooks and outgoing webhooks, giving your WordPress site a powerful tool for interfacing with external systems.

To use webhook triggers, you’ll need to create a Recipe for Everyone, since a webhook is an anonymous incoming request that’s not triggered by a logged-in user.

Receive data from a webhook

There are different webhook triggers, but they all behave the same way. For this example, we’ll use the Webhooks > Receive data from a webhook trigger.

Incoming webhook trigger

The trigger provides a webhook URL for you to copy and paste into the software or service that will be sending the webhook to your WordPress site. Each webhook URL is specific to a recipe and will trigger the actions of that recipe.

The data in a webhook is organized into key/value pairs. The key describes what the value is.  Here’s an example of data you might receive from a webook, organized into key/value pairs:

Key Value
first_name Ken
last_name Smith
email ken@automatorplugin.com
username kensmith

This example data could represent a user you want to create (or update) on your WordPress website. If you know the keys your webhook will be sending, you can manually enter the webhook keys and value types:

Or, if the software or service you are using support sending a test webhook, you can use the “Get samples” button to automatically listen for an incoming webhook and set the keys automatically. If a webhook is received at the webhook URL within 60 seconds, you’ll see the following dialog that shows the data received:

Important: Collecting samples only works when the related trigger and recipe are in Draft status.

Clicking Use these fields will add them to the trigger:

To create this user, you would set the Recipe to create a new user using the data from the webhook, then perform any desired Actions on the user.  You could also set the Recipe to select an existing user that matches that data, and perform the Actions on them instead.  See Recipes for Everyone for more information.

Receive nested data from a webhook

All Incoming Webhook triggers accept multidimensional data. For this example, we’ll use the Automator > Receive data from a webhook trigger.

The trigger provides a webhook URL for you to copy and paste into the software or service that will be sending the webhook to your WordPress site. Each webhook URL is specific to a recipe and will trigger the actions of that recipe.

The data in a webhook is organized into key/value pairs. The key describes what the value is. Your nested data keys will be joined together with a forward-slash / to identify parent/child pair. Here’s an example of data you might receive from a webook, organized into key/value pairs:

Key Value
user/id 123
user/first_name Ken
user/last_name Smith
user/email ken@automatorplugin.com
user/username kensmith
address/line1 123 Main St.
address/line2 Unit 123
address/city Toronto
address/province ON
address/country Canada

This example data could represent a user you want to create (or update) on your WordPress website. If you know the keys your webhook will be sending, you can manually enter the webhook keys and value types. Or, if the software or service you are using support sending a test webhook, you can use the “Get samples” button to automatically listen for an incoming webhook and set the keys automatically. If a webhook is received at the webhook URL within 60 seconds, you’ll see the following dialog that shows the data received:

Sample JSON data received by Automator Pro trigger:

{
  "user": {
    "id": "123",
    "first_name": "Ken",
    "last_name": "Smith",
    "email": "ken@automatorplugin.com",
    "username": "kensmit",
    "phone": "123-456-7890"
  },
  "address": {
    "line1": "123 Main St.",
    "line2": "Unit 123",
    "city": "Toronto",
    "province": "ON",
    "country": "Canada"
  }
}

Clicking Use these fields will add them to the trigger:

To create this user, you would set the Recipe to create a new user using the data from the webhook, then perform any desired Actions on the user.  You could also set the Recipe to select an existing user that matches that data, and perform the Actions on them instead.  See Recipes for Everyone for more information.

Incoming Data formats

Automator Pro’s Incoming webhook triggers now accept multiple data formats for incoming data including any n-level deep nested data. By default, the Data format in your incoming trigger is set to Auto which automatically identifies x-www-form-urlencoded, JSON, and XML formats. If the “Get sample” timer runs out without identifying the sample data (and you are sure that sample data is sent from your end), change your Data format to match the format that your software or service sending the data in and try “Get sample” again.

Security headers

Custom security headers may be included in the incoming webhook trigger, but one important note is how WordPress can change dashes to underscores. As an example, trying to use “x-api-key” may require using “x_api_key” instead.

Back To Top