New policy for creating new users with our API

Our API now includes an optional argument for production methods -- createDisposition -- which allows you to control whether or not Leanplum automatically creates a new user profile for a non-existing user (based on the user ID you pass in the call).

The createDisposition argument accepts two possible strings:

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

This is a substantial change to many of our API methods. Previously, when an API call was made with a new user ID, Leanplum would automatically create a new, blank user profile with that ID. 

Important: If your API calls rely on Leanplum creating new users, you will likely need to update them to use createDisposition=CreateIfNeeded (see the table of methods below). 

Each API method has its own default setting for the createDisposition option.

Methods that will not create new users by default

You can change this behavior by adding createDisposition=CreateIfNeeded to the call.

method default for createDisposition 
advance CreateNever
getVars CreateNever
heartbeat CreateNever
pauseSession CreateNever
pauseState CreateNever
resumeSession CreateNever
resumeState CreateNever
sendMessage CreateNever
stop CreateNever

Methods that will create new users by default

You can change this behavior by adding createDisposition=CreateNever to the call.

method default for createDisposition
setDeviceAttributes CreateIfNeeded
setTrafficSourceInfo  CreateIfNeeded
setUserAttributes CreateIfNeeded
start CreateIfNeeded
track CreateIfNeeded


Was this article helpful?
Have more questions? Submit a request