> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Moosend Integration

> Connect Moosend with ChatbotX to create or update a subscriber in the selected mailing list when the contact reaches the action in a Flow.

The **Moosend** integration adds contacts from ChatbotX to a mailing list directly from a Flow. The action uses the email address to create a subscriber or update an existing subscriber in the selected list.

For example, after a customer submits an email address to receive product updates, ChatbotX adds it to the appropriate mailing list for future email marketing campaigns in Moosend.

## Prepare your API Key

Get your **API Key** from Moosend before connecting the integration. This key allows ChatbotX to access your mailing lists and send subscriber data to your account.

<Steps>
  <Step title="Sign in to Moosend">
    Sign in to the Moosend account that you want to connect to ChatbotX.
  </Step>

  <Step title="Open Settings">
    From the top navigation bar, select **More > Settings**.
  </Step>

  <Step title="Select API key">
    From the settings menu on the left, select **API key** to view the key for your account.
  </Step>

  <Step title="Copy the API Key">
    Select **Copy** to copy the current key. To replace it, select **Generate new API Key** and store the new key securely.

    See the official [Get the API key](https://docs.moosend.com/users/moosend/en/use-the-api-key-to-connect-to-the-moosend-web-api.html) guide.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/cb1-ekIarD9eBHxf/images/moosend_api_key_settings.png?fit=max&auto=format&n=cb1-ekIarD9eBHxf&q=85&s=4908c33520524a68fe83263baf25634a" alt="Moosend API Key Settings" width="2993" height="1416" data-path="images/moosend_api_key_settings.png" />
    </Frame>
  </Step>
</Steps>

<Warning>
  The API Key provides full API access to your Moosend account. Do not share it in emails, messages, public screenshots, or customer-facing documents.
</Warning>

## Connect Moosend to ChatbotX

<Steps>
  <Step title="Open Settings">
    In your ChatbotX workspace, select **Settings** from the left menu.
  </Step>

  <Step title="Select Integrations">
    Select the **Integrations** tab, then open **Moosend**.
  </Step>

  <Step title="Open the connection window">
    Select **Connect** to open the **Connect Moosend** window.
  </Step>

  <Step title="Enter the API Key">
    Paste your Moosend key into the **API Key** field, then select **Confirm**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/cb1-ekIarD9eBHxf/images/connect_moosend_in_chatbotx_integrations.png?fit=max&auto=format&n=cb1-ekIarD9eBHxf&q=85&s=223ff496cbc0b6fbd576097f41d6abb6" alt="Connect Moosend in ChatbotX Integrations" width="3183" height="1549" data-path="images/connect_moosend_in_chatbotx_integrations.png" />
    </Frame>
  </Step>
</Steps>

After the key is verified, ChatbotX saves the connection and loads the mailing lists from your Moosend account for use in Flows.

## Add Moosend to a Flow

Place the Moosend action after the step that collects the customer's email address. The action requires a valid email address before it can add a subscriber to a mailing list.

<Steps>
  <Step title="Open the Flow">
    Select **Flows**, then open the Flow that you want to use to collect subscribers.
  </Step>

  <Step title="Add Actions">
    In the Send Message node, select **+ Create**, then select **Actions**.
  </Step>

  <Step title="Select Email Actions">
    Open **Email Actions** and select **Add Contact to Moosend**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/cb1-ekIarD9eBHxf/images/select_add_contact_to_moosend_action.png?fit=max&auto=format&n=cb1-ekIarD9eBHxf&q=85&s=cd0b5688fc182b6f9092fdc2fcb4c174" alt="Select Add Contact to Moosend Action" width="3184" height="1884" data-path="images/select_add_contact_to_moosend_action.png" />
    </Frame>
  </Step>

  <Step title="Open the configuration">
    Select **Edit** on the action to choose a mailing list and email field.
  </Step>
</Steps>

## Configure Add Contact to Moosend

Configure both fields in the **Add Contact to Moosend** window, then select **Save**.

| Field            | Configuration                                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| **Moosend list** | Select the Moosend mailing list that receives the subscriber. Create the list in Moosend before configuring the action.                         |
| **Email Field**  | Select the ChatbotX field that stores the customer's email address. Moosend uses this address to create or identify the subscriber in the list. |

<Frame>
  <img src="https://mintcdn.com/chatbotx/cb1-ekIarD9eBHxf/images/configure_add_contact_to_moosend.png?fit=max&auto=format&n=cb1-ekIarD9eBHxf&q=85&s=81cd127b1916afdc4cdab6af66958314" alt="Configure Add Contact to Moosend" width="3181" height="1886" data-path="images/configure_add_contact_to_moosend.png" />
</Frame>

The action provides two outcomes that you can connect to the next nodes in the Flow:

* **Success**: Moosend processed the request to add or update the subscriber.
* **Error**: The request failed because the email address, API Key, mailing list, or connection is invalid.

Connect each outcome to a different node to send a confirmation or handle the error.

## Example: Collect subscribers for product updates

A fashion retailer wants to send new collection updates to customers who subscribe through the chatbot.

<Steps>
  <Step title="Collect the email address">
    Use Get User Data to ask for the customer's email address and save the response in the **Email** field.
  </Step>

  <Step title="Add the subscriber to Moosend">
    Run **Add Contact to Moosend**, then select the destination mailing list and the **Email** field.
  </Step>

  <Step title="Handle the result">
    Connect **Success** to a subscription confirmation message. Connect **Error** to a branch that asks the customer to check the email address or transfers the conversation to a support agent.
  </Step>
</Steps>

## Test the integration

Before you Publish the Flow, test it with an email address that you can access.

* Open the selected mailing list in Moosend and confirm that the subscriber appears.
* Confirm that the Flow follows the **Success** branch for a valid email address.
* Enter an invalid email address to test the **Error** branch.
* If the mailing list does not appear, check the connection and reopen the action.
* If the API Key is no longer valid, generate a new key and reconnect Moosend in ChatbotX.

<Warning>
  The Moosend API may add a previously unsubscribed subscriber again when the action runs. Use this action only after the customer agrees to receive marketing emails. Do not use it to override an unsubscribe request.
</Warning>
