Create Contacts (Opt-ins) using Landbot API

Ana Updated by Ana

In this article, we will configure the HTTP request needed to make subscribers for your WhatsApp.

  1. Go to the Growth tools section of your WhatsApp channel.
  1. Then select the Opt-in form.
  2. Generate an opt-in snippet by clicking on the "Create opt-in form" right-top button.
  1. You'll find a few options to customize it. You can choose, optionally, if after generating the subscriber you want to send a template. And also optionally, a bot to be launched. Consider that the bot will be launched automatically only after the first user input.

Once you've made those decisions, press the "Save & copy snippet" button.

  1. After the snippet is created, a URL field is populated. Copy the URL.

  1. Use that URL to make a POST request that will create the subscriber for a WhatsApp number.
curl --location --request POST 'https://messages.landbot.io/wa/W-1196-TCODZM8SIJ5CP1ZE/opt_in?phone=XXXXXXXXX' \

Replace the phone value with a valid number.

  1. Optionally, you can add parameters to the URL. For example, in the case of tracking purposes you add a source param that includes the origin of your leads:
https://messages.landbot.io/wa/W-1196-TCODZM8SIJ5CP1ZE/opt_in?phone=XXXXXXXXX&source=facebookleads

How did we do?

APIs

MessageHooks - Landbot Webhooks

Contact