API Limits

Make the most of Leanplum's API

Our API currently limits what you can call and track.

General limitations

  • You may use up to 500 distinct user attribute names per app.
  • You may use up to 500 event names per app.
  • You may use up to 500 state names per app.
  • You may use up to 200 distinct parameter names across all events and states per app.
  • You may have up to 1500 events per session (SDK limit only).
  • You may have up to 1500 states per session (SDK limit only).
  • By default, apps cannot use the API to send us historical data. Contact us if you need to do so.
  • The total size of your variables must be < 1 MB. (There is no fixed maximum number of characters for a String.)

📘

devMode rate limit

Development mode gives your team members real-time information and additional logging for internal testing purposes. To ensure low latency, API calls with the devMode=true flag will be rate limited to 1 request per second (QPS) per user. The limit of 1 QPS is to avoid conflicting queries for the same user at the same time. When this limit is exceeded, the API will return an HTTP 429 error and SDK will return a 408.

Naming events, states, user attributes, and parameters

Rules apply to names and values:

  • Length must be greater than 0 and fewer than 140 characters.
  • Must not start with a period (.) or hyphen (-).
  • Must not end with a forward slash (/).
  • Must not contain commas (,), vertical pipes (|), double quotes ("), curly braces ({), tabs, newlines, or return characters.
  • Must not be numeric.
  • Must not use the same name for different events and states, e.g. you should not name a state cart and an event cart.

Naming rules for variables and message arguments

  • Dots within names (.) indicate grouping. Objective-C macros use _ instead of .
  • Dots, square brackets, parentheses, and backslashes [].()\ that should appear in the name must be escaped with a leading backslash. Dots used for grouping should not be escaped.
  • User IDs and Device IDs must be at most 400 characters.

Method-specific limits

Method

Limitations

clientkey

multi: Batches multiple API actions within a single request to the API. Each unique user lookup in a request is a billable API call.

Limited to 50 users and/or 500 actions in a single call. All calls in a batch with more than this will be ignored and the server will return a 403 status. Each unique user lookup in a request is a billable API call.

production

multi (import): Imports a CSV file with API actions to be executed.

Each unique user lookup in a batch is a billable API call.

development

downloadFile: Redirects to a file from Content Management.

Must be the only API method in a batch.

production

heartbeat: Indicates that the current session is still in progress, so not to automatically end it.

Sessions automatically time out after two hours of inactivity in the open app, or 30 minutes of inactivity if the session was paused first.

production

setDeviceAttributes: Sets attributes for the current device.

At least one of the following must be set to create/update a device: appVersion, systemName, systemVersion, browserName, browserVersion, deviceName, deviceModel, iosPushToken, gcmRegistrationId, or webPushSubscription.

production

deleteUser: Permanently removes a user from our database. This does not remove the user's activity from analytics.

If you want to bulk delete users, use multi (import mode) or contact your CSM. This method requires your development API clientKey.

development

uploadFile: Uploads up to 16 files or 50 MB at a time to use in the Leanplum content management system.

Uploads up to 16 files or 50 MB at a time to use in Leanplum’s filepicker. (Uploads up to 16 files or 50 MB at a time to use in the Leanplum content management system.)

development

deleteAndroidNotificationChannel: Permanently removes an Android notification channel from Leanplum.

Cannot delete default channel. To delete the default, mark another channel as default first.

development

exportData: Exports raw data to downloadable files. Data is split into roughly 256 MB files, and is not necessarily ordered. Exports can be made in JSON or CSV format.

Data becomes available to export every 2 hours, and only for complete sessions. You cannot export data that has become available more than 60 days ago. You may only export data 24 times per day. Exports with invalid arguments do not count towards this limit.

data export

exportReport: Exports statistics for an A/B test, message, bookmarked report, or user activity in your app (as in the Analytics tab of the dashboard) over a specified period of time.

Report data becomes available to export every 2 hours, and only for complete sessions. You may only export report data 100 times per day per app. Exports with invalid arguments do not count towards the limit.

data export

exportUsers: Exports multiple user IDs.

This may be executed up to 10 times successfully per day.

data export

addPostback: Adds a postback rule to be triggered on incoming data.

The maximum number of postbacks allowed is three.

data export