> For the complete documentation index, see [llms.txt](https://docs.gpt4business.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpt4business.ai/getting-started/integrations/instagram.md).

# Instagram

**Step 1:** Select an AI Agent from your dashboard

**Step 2:** Navigate to the Integrations tab

<figure><img src="/files/JQu9l6kqIFuk3SQhGHpy" alt=""><figcaption></figcaption></figure>

**Step 3:** Click on the Instagram integration

<figure><img src="/files/7V4UfyjskLLeIfmcdHqr" alt=""><figcaption></figcaption></figure>

**Step 4:** Create/ Connect your Instagram Business account

**Step 5:** Enable the AI Agent to be active

### Connecting a GPT4Business.ai Custom AI Agent to Instagram DMs via GoHighLevel (GHL)

This feature allows businesses to seamlessly connect a GPT4Business.ai AI Agent with Instagram DMs through a GoHighLevel (GHL) automation workflow. The AI Agent can automatically respond to messages received on Instagram, providing dynamic and real-time customer support.

#### Step-by-Step Guide: Integrating AI Agent with Instagram DMs

1. Obtain the API Details and Set Up GHL Integration

* Log in to the GPT4Business.ai dashboard and navigate to your white-labeled version of the platform.
* Retrieve the white-label API endpoint and API token from the API documentation.
* Log in to GoHighLevel (GHL) and ensure your Instagram account is connected in the Integrations tab.

2. Create a Trigger in GoHighLevel

* Go to Automation Workflows in GHL and create a new workflow.
* Add a Trigger:
  * Select Customer Replied as the trigger event.
  * Add a Filter: Set the Reply Channel to Instagram DM.
* Save the trigger to capture user messages coming from Instagram DMs.

3. Set Up the Webhook Action to Send Messages to the AI Agent

* Add a Webhook Action step to the workflow.
* Configure the webhook using the following details:
  * Method: POST
  * URL: Use the white-label API endpoint specific to your account.
  * Headers:
    * Key: Authorization
    * Value: Token YOUR\_API\_TOKEN (replace YOUR\_API\_TOKEN with your API key).
* In the Body section of the webhook, include the required parameters:
  * chatbot\_uuid: Retrieve this value from your AI Agent settings in the GPT4Business.ai dashboard.
  * query: Map this to the user’s message from the Instagram DM trigger (use the custom variable).
  * user\_key: Use the Contact ID from the GHL trigger to identify the user.
* Save the webhook configuration.

4. Test the Webhook

* Select a test contact and send a test request to the AI Agent.
* Verify the response: The AI Agent will process the message and return a dynamic answer.
* Ensure a 200 OK response is received, indicating successful integration.

5. Send the AI Agent’s Response Back to Instagram DM

* Add a third and final Action Step in the workflow:
  * Select Send Instagram DM Message.
  * Use the AI Agent’s response (from the webhook) as the Message Body.
* Save the action step and activate the workflow.

### How It Works

* When a user sends a message via Instagram DM, the workflow is triggered.
* The user’s message is sent to the GPT4Business.ai AI Agent via the webhook.
* The AI Agent processes the message and generates a response.
* The response is sent back to the user via Instagram DM, completing the automation.

## Dynamic Channel Support&#x20;

The same workflow can be replicated for other social media messaging channels supported by GHL, such as:

* Facebook Messenger
* WhatsApp
* SMS

### To adapt the workflow for a different channel:

* Change the Reply Channel filter to the desired platform.
* Modify the final action step to send the message back through the corresponding channel.

### Benefits of This Integration

* Automated Customer Support: Respond to inquiries instantly and efficiently through Instagram DMs or other messaging channels.
* Dynamic Responses: AI Agents provide accurate and tailored answers based on user queries.
* Multi-Channel Compatibility: Easily scale this solution to Facebook Messenger, SMS, and more.
* White-Label Branding: Maintain full control over the branding and experience through the white-label API.

### Conclusion

This integration allows businesses to leverage GPT4Business.ai AI Agents to automate responses to Instagram DMs via GoHighLevel workflows. The process ensures seamless communication, dynamic responses, and multi-channel support, enhancing customer engagement and satisfaction.

For further assistance or troubleshooting, refer to the API documentation or reach out to the GPT4Business.ai support team.
