Back

Keap API Essential Guide

Aug 12, 20246 minute read

What type of API does Keap provide?

Key API Types

  • REST (Representational State Transfer) - A popular architectural style for web APIs that uses HTTP methods and is based on resources.

  • SOAP (Simple Object Access Protocol) - An XML-based protocol for exchanging structured data.

  • GraphQL - A query language and runtime for APIs that allows clients to request specific data.

  • RPC (Remote Procedure Call) - A protocol for executing procedures on remote systems.

Considerations

When determining what type of API a company uses, some key things to consider are:

  • The company's documentation and developer resources
  • The data formats supported (e.g. JSON, XML)
  • The protocols and methods used (e.g. HTTP verbs for REST)
  • How requests and responses are structured

Without examining Keap's specific API details, it's not possible to definitively categorize their API. Many modern web APIs tend to use REST or GraphQL approaches, but companies may use various API types depending on their needs.

To get an accurate answer, I would recommend checking Keap's official API documentation or contacting their developer support team for the most up-to-date information on their API architecture.

Does the Keap API have webhooks?

Yes, the official Keap API does offer webhooks (also called REST Hooks). Here are the key points about Keap's webhook functionality:

Webhook Availability

  • Keap offers REST Hooks to notify you of changes in your data.
  • These webhooks are treated like subscriptions that can be managed via the REST API.

Event Types

You can subscribe to various event types, including:

  • contact.edit - Triggered when a contact is edited
  • contactGroup.applied - Triggered when a tag is applied to a contact
  • contactGroup.removed - Triggered when a tag is removed from a contact

The full list of available event types is not static and can change over time. To get the most up-to-date list of available event types, you need to make an API call to retrieve them.

Webhook Payload

The payload for each webhook type differs based on the object type involved. For example, here's a sample payload for the contactGroup.applied event:

{ "event_key": "contactGroup.applied", "object_type": "contactGroup.batch", "object_keys": [ { "contact_details": [ { "id": 2579, "timestamp": "2022-05-31T18:57:19Z" }, // ... more contacts ], "tag_id": 113 }, // ... more tag applications ], "api_url": "" }

Setting Up Webhooks

To use webhooks, you need to:

  1. Set up an endpoint on your server to receive the webhook calls.
  2. Create a subscription for the events you want to listen to.
  3. Process the incoming webhook payloads on your server.

Best Practices

  • Always verify the current list of available event types before setting up new webhooks, as the list can change.
  • Use tools like http://ptsv2.com/ to test and explore webhook payloads.
  • Be prepared to handle changes in webhook availability, as events may be removed following feature deprecations.

Remember that the webhook functionality allows for real-time updates, eliminating the need for constant polling and improving the efficiency of your integrations with Keap.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Keap API:

Personal Access Tokens or Service Account Keys

  • 10 queries per second
  • 240 queries per minute
  • 30,000 queries per day (resets at 12:00 AM UTC)
  • Can only access a single authorized Keap application

OAuth2 Bearer Tokens

  • 1,500 queries per minute
  • 150,000 queries per day (resets at 12:00 AM UTC)
  • Limits apply across all Keap applications accessed with that key/secret pair

Additional Limits

  • There is a per-second spike policy of 25 calls per second
  • The throttling limits apply to the client_id, so they are shared across all Keap accounts accessed by that client_id

Monitoring Usage

  • Response headers provide information on quota and throttle limits remaining
  • Developers can use these headers to monitor usage and adjust request rates as needed

Key Points

  • OAuth2 tokens have higher limits than personal access tokens
  • Daily quotas reset at midnight UTC
  • Limits are per client_id, not per Keap account accessed
  • Response headers allow monitoring of remaining quota and throttle limits

The API uses a token bucket model for throttling, with tokens replenished over time up to the maximum limits. Proper monitoring and rate limiting on the client side is recommended to avoid hitting throttle limits.

Latest API Version

Based on the search results provided, I can answer your question about the most recent version of the Keap API:

The most recent version of the Keap API is version 2 (v2) REST API.

Key points to consider:

  • Keap (formerly known as Infusionsoft) offers both v1 and v2 REST APIs.
  • The v2 REST API is the latest and most up-to-date version of the Keap API.
  • There is also an older XML-RPC API, but it is not considered the most recent version.

Best practices:

  • When developing new integrations or applications, it's generally recommended to use the most recent API version (v2 in this case) to ensure access to the latest features and improvements.
  • Always refer to the official documentation for the most accurate and up-to-date information on API versions and functionality.
  • Keep in mind that while newer versions offer more features, they may also have different implementation requirements compared to older versions.

It's important to note that API versions can change over time, so it's always a good idea to check the official Keap developer documentation for the most current information on API versions and their features.

How to get a Keap developer account and API Keys?

Here are the key steps to get a developer account for Keap to create an API integration:

  1. Sign up for a Keap Developer account:

    • Go to the Keap Developer website (https://developer.infusionsoft.com/)
    • Click on the "Build" section to create a developer account
  2. Create a Sandbox Application:

    • After creating your developer account, you can request a Sandbox Application to test and develop your integration
  3. Set up OAuth2 authentication:

    • Follow the OAuth2 workflow to link your integration to a Keap app programmatically
    • The OAuth2 setup guide can be found at: https://developer.infusionsoft.com/getting-started-oauth-keys/
  4. Generate API keys:

    • Once your developer account is set up, you can generate API keys to authenticate your requests
    • As of July 10, 2024, legacy API keys are being phased out. You'll need to use OAuth2 or Personal Access Tokens/Service Access Tokens instead
  5. Review API documentation:

    • Familiarize yourself with the API documentation, usage guidelines, and code examples provided in the developer portal

What can you do with the Keap API?

Based on the search results provided, here are the key data models you can interact with using the Keap API, along with bullet points outlining what is possible for each:

Contacts

  • Create new contacts
  • Update existing contacts
  • Retrieve contact details
  • Search for contacts by email or name
  • Merge contacts
  • Add/remove tags from contacts
  • Add contacts to follow-up sequences
  • Pause/resume follow-up sequences for contacts
  • Remove contacts from follow-up sequences
  • Link/unlink contacts
  • Run action sequences on contacts

Orders

  • Create new orders
  • Add items to existing orders
  • Retrieve order details

Invoices

  • Create invoices
  • Pay invoices
  • Retrieve invoice payments
  • Calculate invoice tax
  • Delete invoices
  • Add manual payments to invoices
  • Add commissions to invoices

Products

  • Retrieve product inventory
  • Increment/decrement inventory
  • Increase/decrease product inventory

Subscriptions

  • Create contact subscriptions
  • Create subscription invoices
  • Update subscription billing dates
  • Delete subscriptions

Payments

  • Validate new and existing credit cards
  • Retrieve credit card details
  • Retrieve available payment options
  • Create custom recurring payments
  • Deactivate credit cards

Email

  • Opt-in/opt-out email addresses
  • Retrieve opt-in status
  • Create/update email templates
  • Send emails from templates
  • Log sent emails
  • Retrieve merge fields

Files

  • Upload files
  • Retrieve files
  • Get download URLs for files
  • Replace files
  • Rename files

Affiliates

  • Retrieve affiliate clawbacks, commissions, payments
  • Get affiliate redirect links
  • Retrieve affiliate program details

Discounts

  • Create various types of discounts (order, subscription, shipping, product, category)
  • Retrieve discount details
  • Assign products to discounts

Webforms

  • Retrieve webform HTML
  • Get webform IDs

Custom Data

  • Create/update custom fields
  • Query custom data tables
  • Create/retrieve/update/delete custom data records

This list covers the major data models and operations available through the Keap API based on the provided search results. The API provides extensive capabilities for managing customer relationships, sales, marketing, and business operations within the Keap platform.