Documentation CRM Custom Webhook

CRM integration

Custom Webhook

  • CategoryCRM
  • AuthSecret token

Overview

The Custom Webhook trigger starts a campaign whenever another tool you use sends a contact's details to a URL that MessageMind gives you. You pick it as the trigger when you build a campaign under Campaigns in the Workspace. Each request finds the contact by phone number or email, or creates them, and starts the campaign for that person. A Custom Webhook goal has its own URL and moves someone who is already in the campaign on to the step after the goal.

What MessageMind can do with it

  • Start a campaign from any tool that can send a request to a URL with a header of your choice, for example Zapier, Make or your own code.
  • Find the contact by phone number or email, or create a new contact when there's no match.
  • Fill in the contact's company from companyName when their record doesn't have one yet.
  • Save the extra values you send as custom fields on the contact. They're available as variables, such as {{order_id}}, in messages and in conditions.
  • Move someone who is already in the campaign straight to the step after a Custom Webhook goal when your tool calls that goal's URL.
  • Reuse values from a goal request, such as an order number, in the steps after the goal.

Requirements

  • Access to Campaigns in the Workspace. A team member's role has to allow creating campaigns.
  • A tool that can send a POST request with a JSON body and add its own header, such as Zapier, Make or a developer's script.
  • A name plus a phone number or an email address for every contact you send.
  • A connected channel for each message step you plan to use. Send WhatsApp Template needs WhatsApp, Send SMS needs Twilio SMS and Send Email needs an email channel.

How to connect

  1. Click Workspace in the top bar, then click Campaigns in the left rail.
  2. Click Create campaign, type a Campaign name, keep Create an Automation selected and click Create. The new campaign opens in the editor.
  3. Click Add a Trigger. In the Choose a trigger window, click Custom Webhook under Webhook. The Configure trigger window opens.
  4. Click Copy next to Webhook URL and paste the URL into your other tool as the address to send to.
  5. Set your tool to send a POST request with the content type application/json.
  6. Back in MessageMind, click Copy next to Secret token.
  7. In your tool, add a header named X-Webhook-Token and paste the token as its value.
  8. Under Custom fields, click Add field for each extra value you want to send. Type its Field name (for example order_id) and pick a Type.
  9. Click Copy above the sample at the bottom of the window and paste it into your tool as the body of the request.
  10. Replace the example values with data from your tool. name, phone, email and companyName stay at the top level, and each custom field goes inside customFields, laid out the way the sample shows.
  11. Under Runs On Contact, keep Once if each contact should go through the campaign only one time, or pick Multiple Times.
  12. Click Save.
  13. Add the rest of your steps, then click Save in the top-right corner of the editor.
  14. Turn the switch at the top of the editor from Draft to Published and click Save again.
  15. Send a test from your tool with your own name and phone number or email. In the Campaigns list, click the Execution Logs icon on the campaign's row to see your run.

Authentication and permissions

Mechanism
Your tool sends the campaign's Secret token in a header named X-Webhook-Token with every request.
Credentials
The Webhook URL and the Secret token, both in the Configure trigger window of the Custom Webhook trigger. Each campaign has its own token, and its Custom Webhook goals use the same one.

Available data and actions

Reads

  • name, phone, email and companyName from each request sent to the trigger URL.
  • The custom field values your tool sends inside customFields.
  • On a goal URL, the phone or email that identifies the contact, plus the fields you list under Variables from this webhook.

Configuration

  • To change the trigger later, open the menu on the trigger card and click Edit. Save the window, then save the campaign.
  • You can add or remove custom fields at any time. Field names are kept in lowercase with underscores, so typing Order ID gives order_id.
  • Regenerate, under Secret token, replaces the token as soon as you click it. Paste the new one into every tool that sends to this campaign.
  • Runs On Contact is set to Once by default. Multiple Times lets the same contact go through the campaign again.
  • With Multiple Times, a switch lets contacts who are still in the campaign enter again. If you leave it off, choose what happens to a request that arrives during an active run: Discard trigger ignores it, and Queue for later starts the new run when the current one finishes.
  • Maximum runs per contact also appears with Multiple Times. Leave it empty for no limit.
  • To add a Custom Webhook goal, click Goal in Add Step, then pick Custom Webhook under Webhook in the Choose a goal window. The Set goal window shows the goal's own Webhook URL and the campaign's Secret token.
  • In a goal, click Add variable and fill in a label and the field to read from the request, such as order_id. For a value nested inside another, use dots, as in customer.address.city.
  • Under If a contact never matches, a goal can Wait until met, Continue anyway or End automation.

Example workflows

Welcome a lead from your website form

  1. A visitor fills in the contact form on your website and picks the service they're interested in.
  2. Your automation tool sends their name, phone number and a custom field called service to the campaign's Webhook URL.
  3. MessageMind creates the contact, saves service on their record and starts the campaign.
  4. Send WhatsApp Template sends your approved welcome template, with the service filled in from the variable.
  5. Add/Remove Pipeline Stage puts the lead into your New leads stage so your team can follow up.

Stop chasing once a quote is accepted

  1. When a quote goes out, your quoting software sends the customer's name, email and quote_number to the trigger URL.
  2. Send Email sends a follow-up with the quote number in it.
  3. A Delay waits 3 days, then Send SMS sends a reminder.
  4. Next comes a Goal set to Custom Webhook, with Wait until met. When the customer accepts, your quoting software sends their email to the goal's URL.
  5. A customer who accepts during the 3-day wait skips the reminder and goes straight to the step after the goal.
  6. Add/Remove Pipeline Stage moves them into your Won stage.

Disconnect and reconnect

  • To stop requests from starting the campaign, switch it to Draft and click Save.
  • To shut out a tool that still has the token, click Regenerate under Secret token, then paste the new token into the tools you want to keep.
  • Changing the campaign's trigger to something else, or deleting the campaign, also stops the URL from working.
  • Remove the URL from your other tool as well, so it stops sending requests.
  • Contacts that came in this way keep their details and custom field values in Contacts.