Go to AiFunnels

AiFunnels Help Center

Search for any help questions or topics.

🔧 How to add users trough API

Avatar
Senaid Bacinovic
Updated 3 months ago
This tutorial explains how to connect your GoHighLevel (GHL) account to AiFunnels using a custom webhook. This will allow you to automatically create a new user in AiFunnels when a specific event occurs in your GHL workflow.


Required

To get started, you will need your AiFunnels Api Key.
  • You will find your api key when you click Automation button in White label -> Users page
  • Warning: This is a secure credential. Do not share it publicly.


Step 1: Add a Custom Domain in AiFunnels

Before you begin, make sure you have added and configured a custom domain within your AiFunnels account. This is a required prerequisite for the webhook to work correctly.


Step 2: Create a New GHL Workflow

  1. In your GoHighLevel account, navigate to the Automation page where you will see workflows.
  2. Create a new workflow or open an existing one that you want to integrate with AiFunnels.


Step 3: Add a Custom Webhook Action


  1. Inside your GHL workflow, click the (+) button to add a new action.
  2. Search for and select the Custom Webhook action.


Step 4: Configure the Webhook

This is the most critical part of the setup. Carefully enter the following details into the webhook settings.
  1. Method: Set this to POST.
  2. URL: Enter the API endpoint URL for creating an account: https://wl-api.aifunnels.ai/v1/users
  3. Headers: Add one header (x-api-key) and set it to your api key from the AIFunnels
  4. Body: This is where you will send the user's data. You must add the following required fields:
    • first_name
    • last_name
    • email
    • account_type_id (can be 1 (business), 2 (agency), 5 (freemium)
    • send_email (can be true or false)
Here is an example of what the webhook body should look like:

JSON
{
  "first_name": "{{contact.first_name}}",   "last_name": "{{contact.last_name}}",   "email": "{{contact.email}}",   "account_type_id": 1,   "send_email": true }
  • Note: The values in double curly braces, like {{contact.email}}, are GHL's dynamic fields. This will automatically pull the information from the contact that triggers the workflow.


Step 5: Save and Test

  1. Save the webhook action within your workflow.
  2. To test the integration, trigger the workflow with a test contact that has an email address and a first name/last name if you included them.
  3. After the workflow runs, check your AiFunnels account to confirm that a new user was created successfully.
If you encounter any issues, double-check that your AiFunnels Api Key is entered correctly and that the required fields (first_name, last_nameemail,  account_type, send_email) are included in the webhook body.
Did this answer your question?
😞 😐 😃