CRM Data Export
📊 CRM Data Export API
ActiveCampaign integration provides comprehensive CRM data export with support for pagination, filtering, and multi-field ordering.
📋 API Endpoints
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /v1/integrations/activecampaign/export/contacts | Export contact data | ✅ JWT |
| GET | /v1/integrations/activecampaign/export/deals | Export deal data | ✅ JWT |
| GET | /v1/integrations/activecampaign/export/accounts | Export account data | ✅ JWT |
🔧 Common Query Parameters
All export endpoints support these parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
page | Integer | Page number | 1 |
limit | Integer | Records per page | 20 |
orders[field] | String | Sort direction (ASC/DESC) | - |
filters[field] | String | Filter by field value | - |
📖 Export Contacts
Endpoint: GET /export/contacts
Basic Request
GET /v1/integrations/activecampaign/export/contacts
Authorization: Bearer {jwt_token}
Response
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "1",
"email": "john.doe@example.com",
"phone": "+1234567890",
"firstName": "John",
"lastName": "Doe",
"cdate": "2020-06-12T01:49:23-05:00",
"udate": "2020-06-12T01:49:24-05:00",
"orgid": "1",
"orgname": "Acme Corporation",
"hash": "206bc0036b925e82bc6f98c7799bf4ef",
"gravatar": "1",
"deleted": "0",
"anonymized": "0",
"scoreValues": [],
"accountContacts": ["1"],
"links": {
"bounceLogs": "https://...api-us1.com/api/3/contacts/1/bounceLogs",
"contactAutomations": "https://...api-us1.com/api/3/contacts/1/contactAutomations",
"contactData": "https://...api-us1.com/api/3/contacts/1/contactData",
"contactLists": "https://...api-us1.com/api/3/contacts/1/contactLists",
"contactTags": "https://...api-us1.com/api/3/contacts/1/contactTags",
"contactDeals": "https://...api-us1.com/api/3/contacts/1/contactDeals",
"deals": "https://...api-us1.com/api/3/contacts/1/deals",
"fieldValues": "https://...api-us1.com/api/3/contacts/1/fieldValues",
"notes": "https://...api-us1.com/api/3/contacts/1/notes",
"organization": "https://...api-us1.com/api/3/contacts/1/organization"
},
"organization": "1"
}
],
"pagination": {
"page": "1",
"limit": "20",
"total": "150",
"next_page": 2,
"prev_page": null
}
}
Contact Fields
| Field | Type | Description |
|---|---|---|
id | String | Contact ID |
email | String | Email address |
phone | String | Phone number |
firstName | String | First name |
lastName | String | Last name |
cdate | DateTime | Created date |
udate | DateTime | Updated date |
orgid | String | Organization ID |
orgname | String | Organization name |
hash | String | Contact hash |
gravatar | String | Gravatar enabled (0/1) |
deleted | String | Deleted flag (0/1) |
anonymized | String | Anonymized flag (0/1) |
scoreValues | Array | Lead scoring values |
accountContacts | Array | Associated account IDs |
links | Object | Related resource URLs |
organization | String | Primary organization ID |
Pagination Example
GET /v1/integrations/activecampaign/export/contacts?page=2&limit=50
Authorization: Bearer {jwt_token}
Ordering Example
# Sort by email ascending
GET /v1/integrations/activecampaign/export/contacts?orders[email]=ASC
Authorization: Bearer {jwt_token}
# Sort by first name descending
GET /v1/integrations/activecampaign/export/contacts?orders[firstName]=DESC
Authorization: Bearer {jwt_token}
Filtering Example
# Filter by first name
GET /v1/integrations/activecampaign/export/contacts?filters[firstName]=John
Authorization: Bearer {jwt_token}
# Filter by email
GET /v1/integrations/activecampaign/export/contacts?filters[email]=john@example.com
Authorization: Bearer {jwt_token}
Combined Example
GET /v1/integrations/activecampaign/export/contacts?page=1&limit=100&orders[email]=ASC&filters[firstName]=John
Authorization: Bearer {jwt_token}
📖 Export Deals
Endpoint: GET /export/deals
Basic Request
GET /v1/integrations/activecampaign/export/deals
Authorization: Bearer {jwt_token}
Response
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "1",
"hash": "3baba795",
"owner": "1",
"contact": "1",
"organization": "3",
"group": "1",
"stage": "1",
"title": "Deal 1",
"description": "Deal 1 description",
"percent": "0",
"value": "10000",
"currency": "usd",
"status": "0",
"cdate": "2020-06-12T22:56:20-05:00",
"mdate": "2020-06-12T22:56:20-05:00",
"nextdate": null,
"nexttaskid": null,
"edate": null,
"winProbability": null,
"winProbabilityMdate": null,
"activitycount": "1",
"nextdealid": "1",
"isDisabled": false,
"account": "3",
"customerAccount": "3",
"links": {
"dealActivities": "https://...api-us1.com/api/3/deals/1/dealActivities",
"contact": "https://...api-us1.com/api/3/deals/1/contact",
"contactDeals": "https://...api-us1.com/api/3/deals/1/contactDeals",
"group": "https://...api-us1.com/api/3/deals/1/group",
"nextTask": "https://...api-us1.com/api/3/deals/1/nextTask",
"notes": "https://...api-us1.com/api/3/deals/1/notes",
"account": "https://...api-us1.com/api/3/deals/1/account",
"organization": "https://...api-us1.com/api/3/deals/1/organization",
"owner": "https://...api-us1.com/api/3/deals/1/owner",
"stage": "https://...api-us1.com/api/3/deals/1/stage",
"tasks": "https://...api-us1.com/api/3/deals/1/tasks",
"dealCustomFieldData": "https://...api-us1.com/api/3/deals/1/dealCustomFieldData"
}
}
],
"pagination": {
"page": "1",
"limit": "20",
"total": "45",
"next_page": 2,
"prev_page": null
}
}
Deal Fields
| Field | Type | Description |
|---|---|---|
id | String | Deal ID |
hash | String | Deal hash |
owner | String | Owner user ID |
contact | String | Associated contact ID |
organization | String | Organization ID |
group | String | Pipeline group ID |
stage | String | Pipeline stage ID |
title | String | Deal title |
description | String | Deal description |
percent | String | Completion percentage |
value | String | Deal value (cents) |
currency | String | Currency code (usd, eur, etc.) |
status | String | Deal status (0=open, 1=won, 2=lost) |
cdate | DateTime | Created date |
mdate | DateTime | Modified date |
nextdate | DateTime | Next task date |
nexttaskid | String | Next task ID |
edate | DateTime | Expected close date |
winProbability | String | Win probability percentage |
activitycount | String | Number of activities |
isDisabled | Boolean | Disabled flag |
account | String | Account ID |
links | Object | Related resource URLs |
Ordering Example
# Sort by value descending (highest first)
GET /v1/integrations/activecampaign/export/deals?orders[value]=DESC
Authorization: Bearer {jwt_token}
# Sort by title ascending
GET /v1/integrations/activecampaign/export/deals?orders[title]=ASC
Authorization: Bearer {jwt_token}
Filtering Example
# Filter by status (0=open)
GET /v1/integrations/activecampaign/export/deals?filters[status]=0
Authorization: Bearer {jwt_token}
# Filter by stage
GET /v1/integrations/activecampaign/export/deals?filters[stage]=1
Authorization: Bearer {jwt_token}
📖 Export Accounts
Endpoint: GET /export/accounts
Basic Request
GET /v1/integrations/activecampaign/export/accounts
Authorization: Bearer {jwt_token}
Response
{
"success": true,
"message": "SUCCESS",
"data": [
{
"id": "1",
"name": "Acme Corporation",
"accountUrl": "https://acme.com",
"createdTimestamp": "2020-06-12T07:46:53-05:00",
"updatedTimestamp": "2020-06-12T07:47:00-05:00",
"contactCount": "5",
"dealCount": "3",
"links": {
"notes": "https://...api-us1.com/api/3/accounts/1/notes",
"accountCustomFieldData": "https://...api-us1.com/api/3/accounts/1/accountCustomFieldData",
"accountContacts": "https://...api-us1.com/api/3/accounts/1/accountContacts",
"emailActivities": "https://...api-us1.com/api/3/accounts/1/emailActivities",
"contactEmails": "https://...api-us1.com/api/3/accounts/1/contactEmails"
}
}
],
"pagination": {
"page": "1",
"limit": "20",
"total": "30",
"next_page": 2,
"prev_page": null
}
}
Account Fields
| Field | Type | Description |
|---|---|---|
id | String | Account ID |
name | String | Account name |
accountUrl | String | Account website URL |
createdTimestamp | DateTime | Created timestamp |
updatedTimestamp | DateTime | Updated timestamp |
contactCount | String | Number of contacts |
dealCount | String | Number of deals |
links | Object | Related resource URLs |
Ordering Example
# Sort by name descending
GET /v1/integrations/activecampaign/export/accounts?orders[name]=DESC
Authorization: Bearer {jwt_token}
# Sort by created timestamp ascending (oldest first)
GET /v1/integrations/activecampaign/export/accounts?orders[createdTimestamp]=ASC
Authorization: Bearer {jwt_token}
Filtering Example
# Filter by name
GET /v1/integrations/activecampaign/export/accounts?filters[name]=Acme
Authorization: Bearer {jwt_token}
📊 Pagination Details
Response Structure
{
"pagination": {
"page": "1", // Current page number
"limit": "50", // Records per page
"total": "150", // Total record count
"next_page": 2, // Next page number (null if last page)
"prev_page": null // Previous page number (null if first page)
}
}
Navigation Pattern
// First page
GET /export/contacts?page=1&limit=50
// Next page
GET /export/contacts?page=2&limit=50
// Last page calculation
const lastPage = Math.ceil(total / limit);
🔧 Advanced Query Examples
Multi-Field Ordering
# Sort by status (ascending), then value (descending)
GET /v1/integrations/activecampaign/export/deals?orders[status]=ASC&orders[value]=DESC
Authorization: Bearer {jwt_token}
Multi-Field Filtering
# Filter by first name AND organization
GET /v1/integrations/activecampaign/export/contacts?filters[firstName]=John&filters[orgid]=1
Authorization: Bearer {jwt_token}
Complex Query
# Paginated, filtered, and ordered
GET /v1/integrations/activecampaign/export/contacts?page=2&limit=100&orders[email]=ASC&filters[deleted]=0
Authorization: Bearer {jwt_token}
⚠️ Error Handling
| Error | Status | Response |
|---|---|---|
| No credentials found | 400 | { success: false, errno: 400, message: "Unauthorised Access." } |
| Invalid credentials | 401/403 | Error from ActiveCampaign API |
| Rate limit exceeded | 429 | Error from ActiveCampaign API |
| Invalid parameters | 400 | Error from ActiveCampaign API |
📝 Important Notes
- 🔑 Authentication Required: Must save credentials before exporting
- 📊 Pagination: Default limit is 20, maximum depends on ActiveCampaign plan
- 🔍 Filtering: Case-sensitive exact match filtering
- 📈 Ordering: Multiple fields supported for complex sorting
- ⚡ Performance: Large exports (10,000+ records) require multiple requests
- 🌍 Base URL: Uses stored account-specific base URL
- 🔄 Live Data: Always fetches current data from ActiveCampaign
🚀 Best Practices
For Large Exports
- Use Pagination: Don't fetch all at once
- Optimize Page Size: 100-250 records is optimal
- Implement Progress Tracking: Show progress for long exports
- Handle Errors: Implement retry logic for failed pages
- Cache Results: Store frequently accessed data
For Performance
- Filter Early: Apply filters to reduce data transfer
- Limit Fields: Request only needed fields (if API supports)
- Batch Processing: Use queue-based processing for large syncs
- Monitor Rate Limits: Respect ActiveCampaign's rate limits
Example Queue Implementation
// Queue job for large contact export
{
type: 'activecampaign-export-contacts',
account_id: '12345',
user_id: 'user_abc',
page_size: 100,
filters: { deleted: '0' },
orders: { email: 'ASC' }
}