Skip to main content

User Hub Bulk APIs

Introduction

The User Hub Bulk APIs can be used to import your end users' data into Helpshift, and export current end user data from Helpshift.
See POSTMAN Collection for details on the API endpoints. Use the Create Bulk Action Task API to create bulk action tasks which will be processed asynchronously.
The data to be imported is specified as a payload in the API request. Each payload is a JSON array of maps, each map containing the data for a single end user profile. There is a limit of 10000 payloads in a single request.

There are two ways of providing the payload -

Directly as a request parameter containing a JSON encoded string, using the x-www-form-urlencoded content type. This is suitable for smaller payloads.

curl --location 'https://api.helpshift.com/v2/domain/identity/bulk_actions' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'action=create_core_profiles' \
--data-urlencode 'payload=[{"identities":[{"uid":"uid-1"}],"last_country":"India","last_city":"Pune"},{"identities":[{"uid":"uid-2"}],"last_country":"Pakistan","last_city":"Karachi"},
{"identities":[{"uid":"uid-3"}],"last_country":"Sri Lanka","last_city":"Colombo"}]'

As a file, using the multipart/form-data content type. The file must be in JSONL format, with each line being a complete JSON map containing the data for a single record. This is recommended for larger payloads.

curl --location 'https://api.helpshift.com/v2/wabbit/identity/bulk_actions' \
--form 'action="update_core_profiles"' \
--form 'payload=@"data.jsonl"'

where data.jsonl has the following contents -

{"identities":[{"uid":"uid-1"}],"last_country":"India","last_city":"Pune"}
{"identities":[{"uid":"uid-2"}],"last_country":"Pakistan","last_city":"Karachi"}
{"identities":[{"uid":"uid-3"}],"last_country":"Sri Lanka","last_city":"Colombo"}

Usage

  1. Use the Create Bulk Action Task API to upload data into Helpshift, or request data export from Helpshift. In either case, the expected request format for each task type is listed below. The API response will contain a Task ID.
  2. Using the Task ID, poll the Get Task Status API until the status is completed. The values of errors and results can be used to determine if the task completed successfully, or with errors.
  3. Use the Get Task Results and Get Task Errors APIs to retrieve data, or any errors.

Request Payloads

Create Core Profiles

Each entry in the payload should be a JSON map, containing one or more of the below fields. At least one identity is required. The response will contain the new core profile’s ID.

FieldDetailsExample
identitiesArray of maps, each map contains an identity value which can be used to uniquely identify the end user.
The map can also contain additional metadata as string key-value pairs, these metadata are stored as is, and not processed.

The valid identity types are -
  • uid
  • email
  • phone_number
  • facebook_id
  • discord_id
  • whatsapp_id
  • google_playstore_id
  • apple_gamecenter_id
  • nintendo_id
  • psn_id
  • xbox_live_id
  • steam_id
[{"uid": "uid-1"},
{"email": "user@example.org", "verified": "true""},
{"discord_id": "293846823745"}]
namesJSON map containing the end user’s name. The following components are supported, any combination can be provided -

  • first_name
  • last_name
  • full_name
  • display_name
{"first_name": "Jane",
"last_name": "Doe"}
tagsJSON array of user tags. [“vip”, “open_beta”, "streamer"]
custom_fieldsJSON map of custom user fields. {"region": "APAC",
"instance": "apac-21",
"player_level": 455,
"signup_date": "2023-05-12"}
full_privacy_enabledDid the user enable full privacy? false
last_countryEnd User’s country.

Either ISO-3166 country name, or 2/3 letter ISO-3166 code.
India , IN , or IND
last_cityEnd User’s city. Pune
ageEnd User’s Age. 30
lifetime_valueEnd User Lifetime Value 1023.99
user_personaEnd User Persona Streamer
user_vip_segmentEnd User VIP Segmentation Diamond Class
user_support_statusEnd User Support Status Active
accepted_t_and_cWhether end user has accepted the terms and conditions. true
preferred_languageISO 639-1 language code en
last_active_dateTimestamp based on Unix epoch (with milliseconds). 1714627659283

Update Core Profiles

This payload is identical to the payload for create_core_profiles , with one additional field - core-profile-id , which is the ID of the core profile to be updated.


Any existing values will be overwritten with the values in the latest payload.
FieldDetailsExample
core-profile-idCore Profile Publish ID 1666311221477632

Update App Profiles

Each entry in the payload is a JSON map containing one or more of the following fields. The pid is required, as it identifies the end user app profile. The ID can be fetched using the Helpshift REST APIs, especially the Get Multiple Issues API.

FieldDetailsExample
pidApp Profile ID domain_profile_4d0d12f4eb0cba8d4d4ace68187bccc7437e4df9
custom_fieldsJSON map of custom user fields (at app level). {"region": "APAC",
"instance": "apac-21",
"player_level": 455,
"signup_date": "2023-05-12"}
user_personaEnd User Persona Streamer
user_paying_segmentEnd User Segmentation Premium
user_vip_segmentEnd User VIP Segmentation Diamond Class
user_levelEnd User Level 455
accepted_t_and_cWhether end user has accepted the terms and conditions. true
app_statusEnd User App Status Unlocked
user_support_statusEnd User Support Status Active
countryEnd User’s country

Either ISO-3166 country name, or 2/3 letter ISO-3166 code.
India , IN , or IND
cityEnd User’s city. Pune
languageISO639-1 language code en
app_ratingEnd User provided rating to app 4
lifetime_valueEnd User Lifetime Value 1023.99

Get Core Profiles

Each entry in the payload is a JSON map containing just the core-profile-id of the core profile. The response will contain all the data for each core profile.

FieldDetailsExample
core-profile-idCore Profile Publish ID 1666311221477632

Get App Profiles

Each entry in the payload is a JSON map containing just the pid of the app profile. The response will contain all the data for each app profile.

FieldDetailsExample
pidApp Profile ID domain_profile_4d0d12f4eb0cba8d4d4ace68187bccc7437e4df9