Documentation Index

Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt

Use this file to discover all available pages before exploring further.

Import

Prev Next
Post
/import/profile

Used to create new user profiles and/or set attributes for these profiles.


This method is used to import or update the system fields for user profiles as well as any custom profile attributes, similar to importing a CSV using the interface and using the same field names listed in the attributes guide.

Further information on user profiles, device profiles and attributes can be found in the guide on user data.


The attributes being updated are listed in the columns parameter, and the individual values are set in an array of arrays in the rows parameter, keeping the same column order. There are a number of reserved field names you can use in the list of column headers to set system user profile attributes.


You must set a user_id and if setting email or mobile_number, the email and SMS subscription status must also be set. Custom Profile Attributes can also be set by adding the attribute key name in the list of column headers.

If you are setting a JSON value into a custom attribute, it must be provided as a JSON string, so the value must be escaped.


Note: For optimal imports, limit your use of this method to 10,000 records in a single request. If you are importing more records, batch the data into multiple requests.


Asynchronous mode

By default, this method will process records asynchronously, when 100 records or more are given. This allows the API request to respond more quickly, and the import process to be optimised for larger datasets.

For asynchronous imports, a 202 response code is given. The task ID in the response can be used to check the import status using the Task Info method.

Body parameters
Import user profiles with email and SMS
{
  "apptoken": "YOUR_APPTOKEN",
  "columns": [
    "user_id",
    "email",
    "email_subscription",
    "mobile_number",
    "sms_subscription",
    "first_name"
  ],
  "rows": [
    [
      "fe56bc676be78",
      "sam@example.com",
      "1",
      "353850123456",
      "1",
      "Sam"
    ],
    [
      "fe56bc676be79",
      "joe@example.com",
      "1",
      "447700900900",
      "1",
      "Joe"
    ]
  ]
}
Import using device_id
{
  "apptoken": "YOUR_APPTOKEN",
  "columns": [
    "device_id",
    "language",
    "timezone",
    "country",
    "region",
    "first_name"
  ],
  "rows": [
    [
      "12345",
      "en",
      "Europe/Dublin",
      "Ireland",
      "Europe",
      "Sam"
    ],
    [
      "12346",
      "en",
      "Europe/London",
      "UK",
      "Europe",
      "Joe"
    ]
  ]
}
Import array attribute
{
  "apptoken": "YOUR_APPTOKEN",
  "columns": [
    "user_id",
    "order"
  ],
  "rows": [
    [
      "user",
      "[\"frapuccino\", \"iced latte\"]"
    ]
  ]
}
Import JSON object attribute
{
  "apptoken": "YOUR_APPTOKEN",
  "columns": [
    "user_id",
    "order"
  ],
  "rows": [
    [
      "user1",
      "{\"order_total\":12.34, \"item_count\":3, \"item_name\":\"socks\", \"properties\": {\"colour\":\"red\", \"size\":\"M\"}}"
    ]
  ]
}
object
apptoken
string Required

Your App Token

columns
Array of string Required

The attributes you would like to set, must include either user_id or email

string
rows
string (json) Required

The values for the attributes per user. Array of rows, where each row is an array of values.

async
boolean

Optional. Default enabled for requests with 100 records or more. If set to 0 your request will be processed completely before API response is returned. This should only be used during development for small numbers of records. In most cases this parameter should be omitted.

Responses
200

200

Result
{
  "success": "True",
  "code": "200"
}
object
success
boolean
Defaulttrue
ExampleTrue
code
integer
Default0
Example200
202

202

Result
{
  "success": "True",
  "code": "202",
  "task_id": "123456"
}
object
success
boolean
Defaulttrue
ExampleTrue
code
integer
Default0
Example202
task_id
integer
Default0
Example123456
400

400

Result
{
  "success": "False",
  "code": "400",
  "message": "General error information"
}
Expand All
object
success
boolean
Defaulttrue
ExampleFalse
code
integer
Default0
Example400
message
string
ExampleGeneral error information
errors
Array of object
object
text
Array of string
string