Skip to main content
The Automation API is a REST-compliant service that lets you programmatically perform most actions available in the Kameleoon web interface. Use the Automation API to build custom software that interacts with the Kameleoon platform and its core features. For example, you can use the Automation API to:
  • Connect Kameleoon with Git repositories to manage variation code.
  • Design custom dashboards populated with real-time experiment results.
  • Automate the creation of goals and segments across multiple projects.
Kameleoon might change endpoints and parameters in new versions of the Automation API. Subscribe to updates on the Kameleoon changelog for notifications about planned changes.
The Automation API doesn’t support high request volumes. Limit calls to 12 times per minute per account or user. Don’t use the Automation API for high-frequency tracking of every website visitor. For larger request volumes, use the Data API.
Contact the Kameleoon team to request an enhancement to the Automation API. Kameleoon appreciates your feedback and can quickly add existing UI features to the API.

Tutorials

Create an experiment

This tutorial provides step-by-step instructions for performing key tasks on the Kameleoon platform. You will learn how to:

Retrieve experiment results

After you launch an experiment, it generates results that provide insights into performance. Learn how to request results and identify the winning variation in the Retrieving Experiments Results tutorial.

Authentication

The Automation API uses the OAuth 2.0 framework for authorization. Kameleoon supports two primary flows depending on your use case:
  • Client credentials flow: Use this flow if you are a Kameleoon customer using the API for internal purposes. This flow allows you to programmatically manage your own account and web properties.
  • Authorization code flow: Use this flow if you are a technology partner integrating an app with Kameleoon. This flow allows you to securely access data on behalf of other Kameleoon users.

Client credentials flow

The Client credentials flow uses the fewest steps of the two authentication methods. To use this flow, exchange your client credentials for an access token.
Find your client_id and client_secret on the Kameleoon platform. Click your profile icon in the top-right corner, then click My profile. Click See my API credentials, and copy the values. For the full procedure, including how to generate a new client secret, see API credentials.

1. Obtain an access token

Send a POST request to the token endpoint with your credentials.
curl
The authorization server responds with a JSON object containing the access_token:

2. Access the API

Include the access token as a Bearer token in the Authorization HTTP header of your requests.
curl
  • Access tokens remain valid for 2 hours by default.
  • The Client credentials flow doesn’t use refresh tokens.
  • You must use HTTPS for all API requests. Requests made over plain HTTP will fail.

Authorization code flow

The Authorization Code flow allows third-party developers to integrate their apps with Kameleoon data. You must obtain explicit permission from a user to access their account resources.
Contact your Kameleoon Technical Account Manager to request an OAuth app. You must provide a redirect URL for your app. Kameleoon will then provide a client_id and client_secret.

1. Redirect the user for authorization

Redirect users from your app to the authorization URL:
After the user grants permission, Kameleoon redirects the user to your app URL with an authorization code:

2. Obtain access and refresh tokens

Exchange the authorization code for tokens. Base64 encode the client_id:client_secret string and include it in the Authorization: Basic header.
curl
The response contains both access and refresh tokens:

3. Refresh an expired token

To obtain a new access token without re-authorizing the user:
curl

Rate limiting

Rate limiting for the Automation API occurs per user access token. Kameleoon uses two rate-limiting windows:
  • 10-second interval: Up to 50 requests.
  • 1-hour interval: Up to 1,000 requests.
If you exceed these limits, the API returns an HTTP 429 Too Many Requests error. To minimize rate limiting:
  • Implement caching: Store API responses locally and avoid calling the API on every page load.
  • Use the Data API: If your app requires real-time tracking at scale, use the Data API.

HTTP status codes

Query parameters

For endpoints that retrieve multiple objects, use query parameters to paginate, filter, or sort data.

Pagination

Queries return 20 items per page by default (maximum 200). Use perPage=-1 to retrieve the maximum limit.

Filtering

You must percent-encode filters when sending them in a URL. Example: filter=[{"field":"name","operator":"EQUAL","parameters":["Test"]}]

Sorting