Example Usage of

Add contact to automation

Description: Add an existing contact to an existing automation.
Endpoint: /admin/api.php?api_action=automation_contact_add
HTTP method: POST
Supported output formats: xml, json, serialize
Requires authentication: true
* indicates requirement. Underlined params include in URL, otherwise as part of the post body. POST data must be formatted as
Content-Type: application/x-www-form-urlencoded
. We don't accept any other input formats like JSON.
Variable Description
api_key*Your API key
api_outputxml, json, or serialize (default is XML)
contact_id*The ID of the contact you want to have added to the automation (either this or contact_email is required)
contact_email*The email address of the contact you want to have added to the automation (either this or contact_id is required)
automation*The automation ID's (can be multiple as comma-separated) to add the contact to
Example response:
Variable Description
result_messageContact added to automation

PHP Example

This is an example of using the automation_contact_add call with PHP. You can replicate the same idea in virtually any other programming language. The example shown is using serialize as the output format. You can change that to XML or JSON if you would like.


// Set up an object instance using our PHP API wrapper.
define("ACTIVECAMPAIGN_URL", "https://{ACCOUNT}.api-us1.com");

$post_data = array(
	"contact_email" => "abc@def.com", // include this or contact_id
	"automation" => "3,5", // one or more
$response = $ac->api("automation/contact/add", $post_data);

echo "<pre>";
echo "</pre>";?>

Questions? Discuss this API call in our developer forum

You can install activecampaign-api-php by downloading (.zip) or cloning the source:

git clone git@github.com:ActiveCampaign/activecampaign-api-php.git