# ActiveCampaign

![ac_logo-blue-trans.svg](https://assets.relyanceuat.xyz/images/docs/8772126394381/8771802188301.svg)
ActiveCampaign is a cloud-based marketing and sales automation software with features for email marketing, lead scoring and web analytics, a CRM platform, and a live chat messaging platform. It allows organizations to send email campaigns, automate features, and manage contacts by staff group.

In order to integrate ActiveCampaign with Relyance AI you will need an ActiveCampaign **Subdomain** and **Api Token**.

#### In ActiveCampaign:

1. Login to your ActiveCampaign account.
2. Click on the cog wheel in the left-hand navigation menu to go to your **Settings** page.
3. Click on the **Developer** section in the settings navigation.
4. Copy the **Subdomain** from API Access section (in this case it will be ' *relyance_example* ').
5. Copy the **Key** to be used as your **Api Token** in Relyance.

![ActiveCampaign-1.png](https://assets.relyanceuat.xyz/images/docs/8772126394381/8772081097229.png)

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendors and Data Stores** filter.
5. Find the **ActiveCampaign** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Custom**.
8. Paste the **Subdomain** and **Api Token** into their respective fields.

![ActiveCampaign-2.png](https://assets.relyanceuat.xyz/images/docs/8772126394381/8771804611213.png)

The **Authentication** step asks for:

- **Subdomain**: required.
- **Api Token**: required; held as a secret.

9. Click **Authenticate**.
10. At this point, you should see the following result on the **Vendor** Integrations page:

![ActiveCampaign-3.png](https://assets.relyanceuat.xyz/images/docs/8772126394381/8771804607629.png)

11. Congratulations, you are now connected to **ActiveCampaign**.

<!-- failure-modes:begin (generated from the integration catalog; do not hand-edit) -->

## If the connection reports Connected but returns nothing

These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.

1. **A feature you enabled returns nothing.** Some scopes belong to a feature rather than to the connection: **Data subject requests** needs `Default`. Turning the feature on after the connection exists does not widen the grant it already holds, so re-authenticate the connection.
2. **A credential rotated at the vendor is not picked up here.** **Api Token** is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.
3. **Check the address fields before suspecting the credentials.** **Subdomain** identifies which tenant, region or host to talk to. A wrong value there fails authentication and looks exactly like a bad secret.

<!-- failure-modes:end -->

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

```hcl
resource "relyance_integration_connection" "activecampaign" {
  vendor = "activecampaign"
  name   = "<your connection name>"

  auth = {
    method = "api-token"
    params = {
      subdomain = "relyance46869"
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      api_token = var.activecampaign_api_token
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
