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

# Attentive

> Let the Dema Agent manage SMS and email subscriptions, record ecommerce events, and update customer attributes in Attentive when you ask.

## Overview

Once Attentive is connected, the Dema Agent can manage subscriptions and customer data directly inside a conversation — opt customers in or out of SMS/email subscriptions and look up subscription status by phone or email, record ecommerce events (add-to-cart, product view, purchase) that trigger Attentive journeys, set or read custom user attributes, send custom events to fire automations, and submit privacy/GDPR deletion requests.

The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied.

***

## Prerequisites

* An Attentive account with access to the custom-app management page.
* A custom app created in Attentive to obtain an API key (see below).

***

## Connect Attentive

<Steps>
  <Step title="Create a custom app in Attentive to get an API key">
    1. Log in to Attentive and open **App Marketplace → custom-app management** (`ui.attentivemobile.com/integrations/custom-app/management`).
    2. Click **+ Create App** (top-right).
    3. Enter an app name (e.g. `Dema Agent`) and a contact email.
    4. In **Permissions**, set each API the agent needs to **Write** (each defaults to **No Access**): Custom Attributes, Custom Events, eCommerce, Privacy Request, Product Catalog, Subscribers.
    5. Click **Create**.
    6. In the **Copy API key** dialog, click **Copy** and save the key — it is shown only once.

    <Note>
      The API key is shown only once. If you lose it, regenerate it in Attentive (**Built by you** tab → open the app → **API key → Regenerate**) and reconnect — regenerating invalidates the old key. Treat the key like a password.
    </Note>
  </Step>

  <Step title="Connect in Dema">
    In Dema, go to **Agents → Settings → Integrations**, find **Attentive**, and click **Connect**. Enter:

    * **API key** — the key you copied from Attentive.

    Click **Add**. Dema marks the integration as Active.
  </Step>
</Steps>

***

## Permissions to grant

Set each of these to **Write** when you create the custom app so the agent can read and act on your Attentive data:

| Permission        | What it covers                                            |
| ----------------- | --------------------------------------------------------- |
| Custom Attributes | Read and set custom user attributes                       |
| Custom Events     | Send custom events that trigger journeys                  |
| eCommerce         | Record add-to-cart, product view, and purchase events     |
| Privacy Request   | Submit GDPR/deletion requests                             |
| Product Catalog   | Read product catalog data                                 |
| Subscribers       | Subscribe and unsubscribe users; read subscription status |

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="A request failed for one API">
    Each API defaults to **No Access**. Make sure you set every API the agent needs to **Write** when creating the app, then reconnect.
  </Accordion>

  <Accordion title="I lost the API key">
    The key is shown only once. Regenerate it on the **Built by you** tab in Attentive, then reconnect in Dema with the new key.
  </Accordion>

  <Accordion title="I cannot reach the custom-app page">
    Email [api-tokens@attentivemobile.com](mailto:api-tokens@attentivemobile.com) to request access to the custom-app management page.
  </Accordion>
</AccordionGroup>

If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see.

***

## Additional resources

* [Create and manage custom apps](https://docs.attentive.com/docs/create-and-manage-custom-apps)
* [Attentive API authentication](https://docs.attentive.com/pages/authentication/)
