CSV File Reference

To upload new users or user-level attributes, your CSV must include the user ID in the first column, with the user attributes you want to upload in the following columns.

📘

File Size

The maximum CSV file size is 100MB

❗️

Check the file encoding

Check the file's encoding to ensure it doesn't have a Byte Order Mark. To check the encoding, you can open the file in Sublime Text and click File > Save with Encoding > "UTF-8" (not "UTF-8 with BOM").

Data Types

The following user data can be uploaded directly from the dashboard via "Upload User Data" from the Audiences page.

Field

Field Type

Description

userId

String

The user ID.

createDisposition

String

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

newUserId

String

If supplied, updates the user of the current session with newUserId.

totalSessions

Integer

The total number of sessions that a user has had in their lifetime.

timeSpentInApp

Unix Timestamp

The total number of seconds spent in the app in the user's lifetime.

locale

String

The current locale the user is in.

country

String

The country the user is in, specified by ISO 2-letter code.

region

String

The region (state) the user is in.

city

String

The city the user is in.

location

String

The location (latitude/longitude) of the user.

locationAccuracyType

String

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

timezone

String

The timezone abbreviation for the user.

timezoneOffsetSeconds

Integer

The timezone offset from GMT in seconds.

devMode

Boolean

Whether the user is in Development Mode, i.e. the user associated with the request is a developer and not a user.

created

Unix Timestamp

Use this to set the date and time the user was created. The value has to be in Unix time.
This will allow you to target users based on "time of first run," etc.

lastActive

Unix Timestamp

Use this to set the date and time the user was last active. The value has to be in Unix time.
This will allow you to target users based on "last active," etc.

User Attributes

Field

Field Type

Description

userAttributes

String

The name of the user attribute.
Example: userId,userAttributes.facebook_id
user1,123456
We highly recommend validating the data here, for example, if it's an email.

userAttributeValuesToAdd

String

A map of values to add to existing user attribute sets.
Example:
userId,userAttributesValuesToAdd
user1,"{someAttribute:someValue}"
Where someAttribute is the user attribute holding a list, someValue is a new element added to the list.

userAttributeValuesToRemove

String

A map of values to remove from existing user attribute sets.

userAttributeValuesToIncrement

String

A map of values to increment onto existing user attributes.

Example CSV file content:

userId,country,city,userAttributes.age,userAttributes.friends
user1,Germany,Berlin,24,"[Jimmy, Sara, Amy]"
📘

Email User Attribute

You can add users' email addresses as an attribute in the CSV file.
email is the default email user attribute. This can be modified from App Settings > Email > Email User Attribute

Events

Field

Field Type

events.eventName.count

Integer

New lifetime count of for the current user.

Always set when doing historical uploads (meaning when users have no recorded occurrences of the event yet in Leanplum)

events.eventName.firstTime

Unix Timestamp

Time that the event first occurred, in seconds since midnight UTC on January 1, 1970.

events.eventName.lastTime

Unix Timestamp

Time that the event last occurred, in seconds since midnight UTC on January 1, 1970.

events.eventName.countIncrement

Integer

Amount to increment the lifetime count of eventName.

events.eventName.value

Number (Float)

New lifetime value of for the current user.

events.eventName.valueIncrement

Number (Float)

Amount to increment the lifetime value of eventName.

Email

Field Type

Description

unsubscribeChannelsToAdd

String

Set to "Email" to unsubscribe users from all marketing emails.

unsubscribeChannelsToRemove

String

Set to "Email" to resubscribe users from all marketing emails.

unsubscribeCategoriesToAdd

String/List

Set to the IDs of the categories you wish to unsubscribe users from.

unsubscribeCategoriesToRemove

String/List

Set to the IDs of the categories you wish to subscribe users to