PHPackages                             xdubois/activecampaign-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xdubois/activecampaign-api

ActiveLibrary[API Development](/categories/api)

xdubois/activecampaign-api
==========================

A PHP package for interacting with the ActiveCampaign API v3

v1.0.0(4mo ago)13.5k↓21.4%MITPHPPHP ^7.4|^8.0

Since Feb 12Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/xdubois/activecampaign-api)[ Packagist](https://packagist.org/packages/xdubois/activecampaign-api)[ Docs](https://github.com/xdubois/activecampaign-api)[ RSS](/packages/xdubois-activecampaign-api/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

ActiveCampaign API PHP Package
==============================

[](#activecampaign-api-php-package)

[![Latest Version](https://camo.githubusercontent.com/62369015b8d457e1a3be534b131199e323770c18fcf78ec2638eaa3bee780e5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f786475626f69732f61637469766563616d706169676e2d6170692e737667)](https://packagist.org/packages/xdubois/activecampaign-api)[![PHP Version](https://camo.githubusercontent.com/c06fb16e7e67e375d17799557e47b3f60c6467649c1d4c7b92b46601eda53476/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f786475626f69732f61637469766563616d706169676e2d6170692e737667)](https://packagist.org/packages/xdubois/activecampaign-api)[![License](https://camo.githubusercontent.com/1b1743633c6d01a20c326285f02bf058f24e46783d8804aaf006a2a24fe6718b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f786475626f69732f61637469766563616d706169676e2d6170692e737667)](https://packagist.org/packages/xdubois/activecampaign-api)

PHP SDK for the ActiveCampaign API v3, covering Deals, Contacts, Accounts, Custom Objects, and Custom Fields endpoints.

Features
--------

[](#features)

- Full coverage of ActiveCampaign API v3 endpoints (Contacts, Deals, Accounts, Custom Objects, Custom Fields)
- Configuration class with timeouts, retry logic, and rate-limit handling
- Typed exception hierarchy mapping HTTP status codes (401, 404, 422, 429)
- PHP 7.4+ with full type hints and return type declarations

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- Guzzle HTTP client 7.0+
- Valid ActiveCampaign account and API credentials

Installation
------------

[](#installation)

```
composer require xdubois/activecampaign-api
```

Configuration
-------------

[](#configuration)

### Basic Setup

[](#basic-setup)

```
use xdubois\ActiveCampaign\ActiveCampaignAPI;

$api = new ActiveCampaignAPI('your-api-token', 'https://yourapp.api-us1.com');
```

### Advanced Setup

[](#advanced-setup)

```
use xdubois\ActiveCampaign\ActiveCampaignAPI;
use xdubois\ActiveCampaign\Configuration;

$config = new Configuration(
    'your-api-token',
    'https://yourapp.api-us1.com',
    timeout: 60,           // Request timeout in seconds
    connectTimeout: 10,    // Connection timeout in seconds
    maxRetries: 3,         // Number of retry attempts
    retryDelay: 1.0        // Delay between retries in seconds
);

$api = new ActiveCampaignAPI($config);
```

Usage
-----

[](#usage)

### Contacts

[](#contacts)

```
// Create a contact
$contact = $api->contacts()->create([
    'contact' => [
        'email' => 'john@example.com',
        'firstName' => 'John',
        'lastName' => 'Doe',
        'phone' => '+1234567890'
    ]
]);

// Get a contact
$contact = $api->contacts()->get(123);

// Update a contact
$updatedContact = $api->contacts()->update(123, [
    'contact' => [
        'firstName' => 'Jane'
    ]
]);

// List contacts with filtering
$contacts = $api->contacts()->list([
    'limit' => 20,
    'offset' => 0,
    'search' => 'john@example.com'
]);

// Sync a contact (create or update)
$syncedContact = $api->contacts()->sync([
    'contact' => [
        'email' => 'john@example.com',
        'firstName' => 'John Updated'
    ]
]);
```

### Deals

[](#deals)

```
// Create a deal
$deal = $api->deals()->create([
    'deal' => [
        'title' => 'New Website Project',
        'value' => 500000, // Value in cents
        'currency' => 'USD',
        'group' => 1,      // Pipeline ID
        'stage' => 1,      // Stage ID
        'contact' => 123   // Contact ID
    ]
]);

// Add a note to a deal
$note = $api->deals()->createNote(456, [
    'note' => [
        'note' => 'Initial client meeting went well'
    ]
]);
```

Error Handling
--------------

[](#error-handling)

```
use xdubois\ActiveCampaign\Exceptions\AuthenticationException;
use xdubois\ActiveCampaign\Exceptions\RateLimitException;
use xdubois\ActiveCampaign\Exceptions\ValidationException;
use xdubois\ActiveCampaign\Exceptions\NotFoundException;
use xdubois\ActiveCampaign\Exceptions\ActiveCampaignException;

try {
    $contact = $api->contacts()->create($data);
} catch (AuthenticationException $e) {
    // 401/403
    echo "Authentication failed: " . $e->getMessage();
} catch (ValidationException $e) {
    // 422
    echo "Validation failed: " . $e->getMessage();
    $errors = $e->getValidationErrors();
} catch (RateLimitException $e) {
    // 429
    echo "Rate limited. Retry after: " . $e->getRetryAfter() . " seconds";
} catch (NotFoundException $e) {
    // 404
    echo "Resource not found: " . $e->getMessage();
} catch (ActiveCampaignException $e) {
    // All other API errors
    echo "API error: " . $e->getMessage();
    $context = $e->getContext();
}
```

Contributing
------------

[](#contributing)

Contributions are welcome. For major changes, please open an issue first to discuss what you would like to change, then submit a pull request.

License
-------

[](#license)

MIT - see [LICENSE](LICENSE).

Links
-----

[](#links)

- [ActiveCampaign API Documentation](https://developers.activecampaign.com/reference/overview)
- [Package on Packagist](https://packagist.org/packages/xdubois/activecampaign-api)
- [Issues and Feature Requests](https://github.com/xdubois/activecampaign-api/issues)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance74

Regular maintenance activity

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

141d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2227133?v=4)[mdubois](/maintainers/xdubois)[@xdubois](https://github.com/xdubois)

---

Top Contributors

[![xdubois](https://avatars.githubusercontent.com/u/2227133?v=4)](https://github.com/xdubois "xdubois (8 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (5 commits)")

---

Tags

phpapicrmemail marketingactivecampaign

### Embed Badge

![Health badge](/badges/xdubois-activecampaign-api/health.svg)

```
[![Health](https://phpackages.com/badges/xdubois-activecampaign-api/health.svg)](https://phpackages.com/packages/xdubois-activecampaign-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k409.0k6](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
