← ActiveCampaign

Create Contact with ActiveCampaign API

Pipedream makes it easy to connect APIs for ActiveCampaign and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Create Contact with the ActiveCampaign API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Create Contact with the ActiveCampaign API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Create Contact action
    1. Connect your ActiveCampaign account
    2. Configure Contact's email
    3. Optional- Configure Contact's first name
    4. Optional- Configure Contact's last name
    5. Optional- Configure Contact's phone
    6. Optional- Select one or more Contact's field values
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Create Contact on ActiveCampaign
Description:Create a new contact. See the docs [here](https://developers.activecampaign.com/reference#create-a-contact-new).
Version:0.0.2
Key:activecampaign-create-contact

Code

import activecampaign from "../../activecampaign.app.mjs";

export default {
  key: "activecampaign-create-contact",
  name: "Create Contact",
  description: "Create a new contact. See the docs [here](https://developers.activecampaign.com/reference#create-a-contact-new).",
  type: "action",
  version: "0.0.2",
  props: {
    activecampaign,
    email: {
      propDefinition: [
        activecampaign,
        "contactEmail",
      ],
    },
    firstName: {
      propDefinition: [
        activecampaign,
        "contactFirstName",
      ],
    },
    lastName: {
      propDefinition: [
        activecampaign,
        "contactLastName",
      ],
    },
    phone: {
      propDefinition: [
        activecampaign,
        "contactPhone",
      ],
    },
    fieldValues: {
      propDefinition: [
        activecampaign,
        "contactFieldValues",
      ],
    },
  },
  async run({ $ }) {
    let fieldValues;

    if (Array.isArray(this.fieldValues)) {
      fieldValues =
        this.fieldValues.map(({
          label: value,
          value: field,
        }) => ({
          field,
          value,
        }));
    }

    const response =
      await this.activecampaign.createContact({
        $,
        data: {
          contact: {
            email: this.email,
            firstName: this.firstName,
            lastName: this.lastName,
            phone: this.phone,
            fieldValues,
          },
        },
      });

    if (!response.contact) {
      throw new Error(JSON.stringify(response));
    }

    $.export("$summary", `Successfully created contact "${response.contact.email}"`);

    return response;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
ActiveCampaignactivecampaignappThis component uses the ActiveCampaign app.
Contact's emailemailstring

Email address of the new contact. Example: test@example.com

Contact's first namefirstNamestring

First name of the new contact. Example: John

Contact's last namelastNamestring

Last name of the new contact. Example: Doe

Contact's phonephonestring

Phone number of the contact.

Contact's field valuesfieldValuesstring[]Select a value from the drop down menu.

Authentication

ActiveCampaign uses API keys for authentication. When you connect your ActiveCampaign account, Pipedream securely stores the keys so you can easily authenticate to ActiveCampaign APIs in both code and no-code steps.

You can find your Base URL and API Key in your Developer Settings in your account. See the ActiveCampaign API docs for more info.

About ActiveCampaign

Email marketing, marketing automation, and CRM tools