Making requests

All API requests must be made to The API is very flexible and supports GET and POST request formats. Our docs, generally, use POST examples for methods that might update/change Leanplum data (e.g. start or setUserAttributes), but both GET and POST request methods are acceptable.

Request formats


The top-level arguments are sent as GET parameters in the request. As part of the HTTP specification, a URL must be at most 2,083 characters, so it's best for small API requests. All characters in the URL should be URL encoded.


Properly encoded this is:


The top-level arguments can be either in the URL or in the request body. Generally, our docs show the action argument set in the URL for POST requests, but this is not necessary; all arguments can be set in the POST body with the request sent to Alternatively, more (even all) arguments can be placed in the URL. However, all characters in the URL should be URL encoded.


The Content-Type of the POST request must be JSON or multipart form data.

Example of a POST request with JSON:


Content-Type: application/json
  "appId": "APP_ID",
  "clientKey": "CLIENT_KEY",
  "apiVersion": "1.0.6",
  "userId": "USER_ID",
  "userAttributes": {
    "Interests": [

Multiple actions can be batched together. It's highly recommended to batch API actions, especially for the same user. Do not make multiple concurrent API requests for the same user. See Batching requests for more.