Export profile data
Profiles centralize data and events from multiple sources (Apps, Websites, APIs) in a single place based on the Custom ID.
The Profile API allows you to export profiles data. Use this endpoint to:
Export profile native attributes
Export profile custom attributes
Export profile identifiers
Export profile events
API Description
Create a request to export profile data.
The unique project key, identifying a project on the Batch platform
project_0664hxvwffvbpn278gxdyhsadddqgna6
Lookback
Some kind of exports are logs of detailed events that happened. Those raw events are not kept forever and will stop being available to export after a while: this is documented in the "Lookback" duration for each event kind. Providing a from
parameter older than the lookback period will result in an error.
Exports that represent a snapshot of data (such as Profile Attributes) do not have this limitation.
Route
The Profile API exposes a POST endpoint that allows to create an export request:
https://api.batch.com/2.4/profiles/export
Headers and authentication
See Overview → Using Project APIs.
Profile Attributes
Use this to export custom and native attributes as well as the identifiers of your profiles.
Request structure
The body of the request must contain a valid JSON payload describing the export request to be executed.
Here is a how a complete JSON payload looks like:
You must specify at least one of attributes
, identifiers
or both in your export request.
Profile Events
Use this to export events associated with your profiles.
Lookback
90 days
Request structure
The body of the request must contain a valid JSON payload describing the export request to be executed.
Here is a how a complete JSON payload looks like:
Profile Reachability Events
Use this to export the reachability events of your profiles.
Lookback
Reachability events are available since October 10, 2024. No events are available prior to this date. Lookback period will be 90 days.
Request structure
The body of the request must contain a valid JSON payload describing the export request to be executed.
Here is a how a complete JSON payload looks like:
Export file structure
The export will contain a list of reachability events. Each event is composed of an event object and an identifiers object.
event
Representation of a reachability event object
object
identifiers
Representation of an identifiers object
object
Event Object
Representation of an reachability event object. It also describes a part of the profile state at the time of the event.
export_type
Channel where the event happened
E.g.{"channel":["SMS","EMAIL","PUSH"]}
id
Unique identifier of the event
E.g.{"id":"6156b060574cb223e8c4ed47c5df1855"}
timestamp
UTC date in a RFC 3339 format
E.g.{"timestamp":"2024-01-01T00:00:00Z"}
reasons
Reasons why an event has been triggered. See "Event Reasons"
E.g.{"reasons":["SUBSCRIBED_TO_SMS_MARKETING","PHONE_NUMBER_ADDED"]}
has_phone_number
Only for SMS channel, means the profile has a phone number
E.g.{"has_phone_number":true}
has_email_address
Profile's marketing email subscription
E.g.{"has_email_address":true}
sms_marketing
Profile's marketing SMS subscription
E.g.{"sms_marketing":"subscribed"}
email_marketing
Profile's marketing emails subscription
E.g.{"email_marketing":"subscribed"}
is_optin
Installation's notification system opt-in state
E.g.{"is_optin":false}
platform
Platform of the installation (iOS/Android/Webpush). Only available on PUSH channels
E.g.{"platform":"iOS"}
Identifiers object
Represents the identifiers of the profile concerned by the event.
profile_id
Unique identifier of the profile.
E.g.{"profile_id":"profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v"}
custom_id
Custom identifier of the profile
E.g.{"custom_id":"User1"}
installation_id
Installation identifier of the profile. Only available on PUSH channels
E.g.{"installation_id":"828A7D76-3D5E-49DC-A863-2465070184C9"}
Event reasons
Exhaustive list of reasons for the event.
SUBSCRIBED_TO_SMS_MARKETING
: The profile subscribed to SMS marketing.UNSUBSCRIBED_FROM_SMS_MARKETING
: The profile unsubscribed from SMS marketing.PHONE_NUMBER_ADDED
: The profile added a phone number.PHONE_NUMBER_REMOVED
: The profile removed a phone number.PHONE_NUMBER_UPDATED
: The profile updated a phone number.SUBSCRIBED_TO_EMAIL_MARKETING
: The profile subscribed to email marketing.UNSUBSCRIBED_FROM_EMAIL_MARKETING
: The profile unsubscribed from email marketing.EMAIL_ADDRESS_ADDED
: The profile added an email address.EMAIL_ADDRESS_REMOVED
: The profile removed an email address.EMAIL_ADDRESS_UPDATED
: The profile updated an email address.SUBSCRIBED_TO_PUSH
: The profile got an optin install.UNSUBSCRIBED_FROM_PUSH
: The profile unsubscribed from push notifications.PUSH_TOKEN_ADDED
: The profile added a push token.
Export file sample
This is a sample of the content of the export file you will receive.
Example
Responses
Success
If the POST to the API endpoint is successful you will receive an HTTP 202 confirmation and an export ID. This ID can be used to get status information about your export request using the Project Export API endpoints.
Failure
If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at [email protected] if you need further support.
See the list of potential failures in the API Description.
Last updated
Was this helpful?