start

Starts a new session and returns the variables that have changed for the user. If the user/device does not exist, a new user will be created (see the createDisposition option below). This method requires your production API clientKey.

Body Params

JSON request body.

string
required
Defaults to YOUR_APP_ID

The application ID. To find yours, select your app in the navigation column, and click Manage Apps. Then click Keys & Settings.

string
required
Defaults to YOUR_PROD_KEY

The Production key for your Leanplum App.

string
enum
required
Defaults to 1.0.6

The version of the Leanplum API to use. The current version is 1.0.6.

Allowed:
string
required
Defaults to hfarnsworth

The current user ID. You can set this to whatever your company uses for user IDs. Leave it blank to use the device ID. For more info, see selecting a user.

string

A unique ID for the device targeted by the request. You must provide a deviceId and/or a userId. See selecting a user.

boolean
Defaults to false

Whether the user is in Development Mode, i.e. the user associated with the request is a developer and not a user. This is important for reporting purposes. Default: false.

string
enum
Defaults to CreateIfNeeded

The policy that determines whether users are created by the API. Possible values:

  • CreateIfNeeded creates a user with the given IDs if one does not already exist.
  • CreateNever requires that the user already exists, otherwise the API action is skipped and a warning will be returned.

The default value for this method is CreateIfNeeded.

Allowed:
string

The version of the app used on this device. E.g. 2.0.1.

string

The name of the OS the current device is running. E.g. iOS.

string

The version number of the OS the current device is running. E.g. 6.0.

string

The name of the browser the current device is running. E.g. Chrome.

string

The version number of the browser the current device is running. E.g. 17.0.

string

A human-readable name representing the device.

string

The model name of the device. E.g. iPad.

string

The token used for Apple iOS push notifications on this device.

string

The registration ID used for Google Cloud Messaging push notifications on this device.

string

The JSON-encoded subscription used for web push notifications on this device.

string

A map of user attributes as key-value pairs. Each key must be a string. Attributes are saved across sessions. Only supplied attributes will be updated (i.e., if you omit an existing attribute, it will be preserved). Example: {"gender":"F","age":21}.

string

The current locale the user is in. E.g. en_US.

string

The country the user is in, specified by ISO 2-letter code. E.g. US for United States. Set to (detect) to detect the country based on the IP address of the user.

string

The region (state) the user is in. E.g. ca for California. Set to (detect) to detect the region based on the IP address of the user.

string

The city the user is in. E.g. San Francisco. Set to (detect) to detect the city based on the IP address of the user.

string

The location (latitude/longitude) of the user. E.g. 37.775,-122.4183. Set to (detect) to detect the location based on the IP address of the user.

string

The type of location that is provided (IP, CELL, or GPS). Default: IP.

string

The timezone abbreviation for the user. See list of timezone abbreviations.

number

The timezone offset from GMT in seconds.

boolean

Whether the app started in the background. In this case, the session won't be counted until resumeSession is executed. Default: false.

boolean

Whether to include default ("defaults in code") values in output. Default: true.

Response

Language
Credentials
URL
Response
Choose an example:
application/json