POST - 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

API Description

This API schema is available in the OpenAPI 3.1 format: View it online.

Request structure

Route

The Profile API exposes a POST endpoint that allows to create an export request:

https://api.batch.com/2.2/profiles/export

Headers and authentication

See Overview → Using Project APIs.

Create export request

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_type": "ATTRIBUTES",
    "attributes": [
        "$email_address",
        "$email_marketing",
        "$phone_number",
        "$sms_marketing",
        "$region",
        "$timezone",
        "$language",
        "first_name",
        "is_premium"
    ],
    "identifiers": [
        "custom_id",
        "installation_ids"
    ]
}

Let's see the parameters in detail.

IdDescription
export_typestring - Required
Type of the export.
E.g.{"export_type":"ATTRIBUTES"}
attributesstring - Optional
Profile attributes to be exported.
You have to specify the attribute you want to be exported.

Any value that does not start with a `$` will be interpreted as a custom attribute. You can find a list of available native attributes on the OpenAPI documentation.

E.g.{"attributes":["$region","$timezone","$language","first_name","is_premium"]}
identifiersstring - Optional
Profile identifiers to be exported.
You have to specify the identifier you want to be exported.

E.g.{"identifiers":["custom_id"]}

You must specify at least one of attributes, identifiers or both in your export request.

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.

{
    "id": "export_nvctr8tgdjf7bppacxxt2aeemnjehfmw"
}

Failure

If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

See the list of potential failures in the specification.