Gainsight PX Data Loader

Updated 1 month ago by Angelo Matheou

Utility script to update Gainsight PX user and account data using the Gainsight PX REST API. Requires active Gainsight PX subscription and Gainsight PX API key (see below for details). An input file containing either user or account data in CSV format is used to update and optionally insert the corresponding records into Gainsight PX. If any errors are encountered during the process, they are logged to the screen and the process continues.



Download script to your local computer using this link: Gainsight PX_loader

Depends on python (>= v2.7) being installed locally and being present in the path. Most Macs already have Python installed.

There is an install script that will perform the remaining steps on OSX/Mac, download here:

Run install script:

bash ./


Download script to your local computer using this link: Gainsight PX_loader

Python (>= 2.7.9) should be installed, see here if it is not:

Install the "requests" library using pip

python -m pip install requests


aptrinsic_loader [--insertMissing] [--verbose] [--dryRun] config.json USER|ACCOUNT input.csv

  • Data type (second argument) should either be USER or ACCOUNT
  • If insertMissing is specfied, will insert missing records. Default behaviour is to update records that are Gainsight PX_loader found
  • If verbose is specified, each operation is logged to stdout
  • If dryRun is specified, no data is changed, inputs are parsed
Mac Example:
./aptrinsic_loader --updateOnly config.json USER users.csv
Windows Example:
aptrinsic_loader --updateOnly config.json USER users.csv

CSV File Example:


CSV details:

* Date values are specified as milliseconds since the Unix epoch

* String values can optionally be surrounded with double quotes to escape commas

Config File Example:

"productKey": "AP-XXXXXXXXXXXX-2",
"fieldMapping": {
"USER": {
"identifyId": "id",
"title": "title",
"phone": "telephone",
"": "city",
"location.stateCode": "state",
"location.coordinates.latitude": "latitude",
"location.coordinates.longitude": "longitude",
"customAttributes.strtmp1": "strtmp1",
"customAttributes.acceptDate": "acceptDate"
"id": "id",
"name": "account_name"

Field Mapping Details:

  • apiKey: From the Gainsight PX Settings/REST API/New API Key screen
  • productKey: From the Gainsight PX Settings/Products screen
  • fieldMapping:
  • Specifies which Gainsight PX fields will be used as targets for the data in the input file.
  • The first field name (the key of the fieldMapping map) is the Gainsight PX name, the second (the value) is the name in the CSV input file.
  • The unique identifier field is required for both users (identifyId) and account (id)
  • To specify nested fields, use periods as separators (see location and customAttributes examples above)

How did we do?