Activecampaign API - add multiple users to a list at once?

Viewed 1205

I am just starting out with the activecampaign / php API. I need to add multiple users to a list, and I was wondering if there is a way to add an array of users instead a single user.

According to https://www.activecampaign.com/api/example.php?call=contact_add I can update a list with 1 user per API call.

$contact = array(
    "email"              => "test@example.com",
    "first_name"         => "Test",
    "last_name"          => "Test",
    "p[{$list_id}]"      => $list_id,
    "status[{$list_id}]" => 1, // "Active" status
);

$contact_sync = $ac->api("contact/sync", $contact);

Looping this does not seem optimal - it would seem much better if I could simply pass an array of users when I connect to the API.

Any help or hints would be much appreciated!

1 Answers

There is not currently a way to bulk add contacts to lists.

Also, the endpoint you listed (contact_add) is for creating a new contact, which is great if you want to create a contact and add the contact to a list all at the same time. To add an existing contact to a list, you should use contact_sync.

You can submit requests for new endpoints and functionality through ActiveCampaign's website (must log into account to do so).

Related