Back

ActiveCampaign API Essential Guide

Jul 31, 20246 minute read

What type of API does ActiveCampaign provide?

ActiveCampaign offers multiple types of APIs, including REST and GraphQL:

REST API

ActiveCampaign provides a REST API that allows developers to interact with various resources and perform operations on the platform. The REST API uses standard HTTP methods like GET, POST, PUT, DELETE etc. to interact with resources.

Key points about the REST API:

  • Uses standard HTTP methods
  • Resources are accessed via unique URLs
  • Responses are typically in JSON format
  • Stateless communication

GraphQL API

ActiveCampaign also offers a GraphQL API, specifically for ecommerce functionality.

Key points about the GraphQL API:

  • Provides more flexibility than REST for querying data
  • Single endpoint for all queries
  • Allows requesting only specific data needed
  • Used for ecommerce data like orders, products, recurring payments

Considerations

  • The REST API is more widely used for general ActiveCampaign functionality
  • The GraphQL API is focused specifically on ecommerce data
  • Both APIs can be used together depending on the integration needs

So in summary, ActiveCampaign provides both REST and GraphQL APIs, with REST being the primary API for most functionality and GraphQL focused on ecommerce data. Developers can choose the appropriate API based on their specific integration requirements.

Does the ActiveCampaign API have webhooks?

Yes, the ActiveCampaign API has webhooks. Here are the key points about ActiveCampaign's webhook functionality:

Webhook Availability

ActiveCampaign provides webhooks that allow you to receive real-time data updates about your contact and campaign activity.

Types of Events You Can Subscribe To

You can subscribe to various types of events, including:

  1. Campaign-related events:

    • A campaign starts sending
    • A campaign link was clicked by a contact
  2. Contact-related events:

    • A new contact is subscribed
    • A contact on an account is updated
  3. Custom Object events:

    • Create, update, or delete events for custom objects
  4. Account-related events:

    • Account contact updates

Webhook Configuration

  • You can choose when a webhook should run based on specific actions or sources.
  • Sources include public (triggered by contacts), admin (triggered by users), api (triggered by API calls), and system (triggered by automated processes).

Webhook Data

  • Each webhook sends specific data fields as POST parameters to your specified URL.
  • The data fields vary depending on the event type but generally include information about the contact, campaign, or object involved in the event.

Best Practices

  1. ActiveCampaign guarantees "at least once" delivery for webhooks, so it's important to create an idempotent system to handle potential duplicate events.

  2. Webhooks will be automatically deactivated if they return an HTTP 410 (gone) response.

  3. You can process webhook data using any programming language that can read POST data.

API Endpoints for Webhook Management

ActiveCampaign provides API endpoints for managing webhooks, including:

  • Creating a webhook
  • Retrieving a webhook
  • Updating a webhook
  • Deleting a webhook
  • Listing all webhooks
  • Listing all webhook events

In summary, ActiveCampaign's API offers a robust webhook system that allows you to subscribe to a wide range of events, providing real-time updates for various activities within your ActiveCampaign account.

Rate Limits and other limitations

Based on the search results provided, here are the key points regarding the API rate limits for ActiveCampaign:

API Rate Limit

ActiveCampaign has a rate limit of 5 requests per second per account. This is the standard rate limit for their API.

Key Points to Consider

  1. There is no specific daily limit mentioned, but exceeding the rate limit may result in temporary throttling.

  2. If you exceed the allowed rate of API calls, ActiveCampaign will throttle your requests. This means your API calls will be temporarily slowed down or rejected until your usage falls back within the acceptable limits.

  3. ActiveCampaign offers a custom rate limit solution for users with high demands. Users can contact ActiveCampaign for this option.

Best Practices

To manage the API rate limits effectively, consider the following best practices:

  1. Optimize API call frequency by batching requests or combining multiple actions into a single call.

  2. Implement retry logic in your API calls to handle cases where you might hit the rate limit.

  3. Regularly monitor your API usage to stay within the rate limits.

  4. Use webhooks for real-time updates instead of frequently polling the API.

Error Codes

ActiveCampaign uses HTTP status codes to indicate errors. Some relevant error codes include:

  • 403: The request could not be authenticated or the authenticated user is not authorized to access the requested resource.
  • 422: The request could not be processed, usually due to a missing or invalid parameter.
  • 429: The user has sent too many requests in a given amount of time ("rate limiting").

Summary

ActiveCampaign's API has a rate limit of 5 requests per second per account. While there's no specific daily limit, exceeding this rate can result in throttling. It's important to design your API integrations with these limits in mind and implement best practices to optimize your API usage. For users with high demands, ActiveCampaign offers custom rate limit solutions.

Latest API Version

Based on the search results provided, the most recent version of the ActiveCampaign API is version 3. Here are the key points:

  1. The latest API version supported is version 3.

  2. ActiveCampaign API version 3 is structured around REST, HTTP, and JSON.

  3. While version 1 of the API is still available and supported, all new functionality is added to the RESTful version 3 of the API.

  4. The developers recommend using version 3 of the API.

  5. Version 3 of the API uses HTTP methods for indicating actions on resources and HTTP status codes for expressing error states.

  6. Resources in version 3 are represented in JSON following a conventional schema.

  7. There are no plans to sunset version 1 of the API at this time, but if they do, they will provide plenty of advance notice.

It's important to note that while version 1 is still supported, using the most recent version (version 3) is recommended as it includes all new functionality and follows modern API design principles such as REST and JSON.

How to get a ActiveCampaign developer account and API Keys?

To get a developer account for ActiveCampaign to create an API integration, you need to request a Developer Sandbox Account. Here's how you can do it:

  1. Request a Developer Sandbox Account:

    • Visit the ActiveCampaign Developer Portal.
    • Look for the "Request a Developer Sandbox Account" option.
    • Fill out the request form provided by ActiveCampaign.
  2. Key points to consider:

    • Developer Sandbox Accounts are free.
    • These accounts allow you to explore and test the ActiveCampaign platform.
    • You can use the sandbox account to build native apps, integrations, or custom-built solutions.
  3. Limitations of Developer Sandbox Accounts:

    • You can add up to 100 contacts.
    • You can send up to 100 emails.
    • There are no SMS credits for automations.
    • The account is limited to 1 user.
  4. Next steps after getting the account:

    • Explore the ActiveCampaign API documentation.
    • Familiarize yourself with the available resources, such as contacts or deals.
    • Consider using App Studio for building native ActiveCampaign apps.
    • Learn about Webhooks for real-time data updates.
  5. Best practices:

    • Join the ActiveCampaign developer community to share tips and get your questions answered.
    • Use the sandbox environment to thoroughly test your integration before moving to a production environment.
    • Keep up to date with the latest API changes and updates through the developer portal.

By following these steps, you'll be able to obtain a Developer Sandbox Account and start working on your ActiveCampaign API integration. Remember that the ActiveCampaign team will review your request and get in touch with you regarding your sandbox account.

What can you do with the ActiveCampaign API?

Based on the search results provided, here is a summary of the data models you can interact with using the ActiveCampaign API, along with key points for each:

Contacts

  • Create, retrieve, update, and delete contact records
  • Sync contacts (create or update)
  • Add custom fields to contacts
  • Segment contacts based on various criteria

Campaigns

  • Create, retrieve, update, and delete campaigns
  • Get campaign statistics (opens, clicks, bounces, etc.)
  • Order campaigns by various fields (e.g., send date)
  • Filter campaigns by type (e.g., single, series)

Custom Objects

  • Create and manage custom object schemas
  • Populate custom object records via API or web interface
  • Retrieve, update, and delete custom object records
  • Use custom object data in automations and email campaigns

Webhooks

  • Create, retrieve, update, and delete webhooks
  • List all webhooks and webhook events
  • Manage webhook payloads

Automations

  • Create and manage automations
  • Use custom object data within automations
  • Trigger automations based on custom object events

Email Campaigns

  • Create and manage email campaigns
  • Use custom object data within email campaigns

Key Points:

  • The API uses REST architecture and JSON for data exchange
  • Authentication is done using an API key provided in the "Api-Token" header
  • Pagination is supported for retrieving large datasets efficiently
  • Filtering and ordering options are available for most endpoints
  • Metadata is provided in API responses, including total record counts

Best Practices:

  1. Use pagination parameters (limit, offset) to control the number of results per request
  2. Implement proper error handling for API responses
  3. Utilize filtering and ordering to optimize data retrieval
  4. Store sensitive information like API keys in separate configuration files
  5. Consider rate limits and implement appropriate throttling in your API calls

This overview covers the main data models and functionalities available through the ActiveCampaign API. For more detailed information on specific endpoints and their usage, refer to the official ActiveCampaign API documentation.