# Export profile data

Profiles centralize data and events from multiple sources (Apps, Websites, APIs) in a single place based on the Custom ID.

The Profiles 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

## Export

> Create a request to export profile data.

```json
{"openapi":"3.1.0","info":{"title":"Batch - REST API","version":"2.9"},"tags":[{"name":"Profiles"}],"servers":[{"url":"https://api.batch.com/{version}","description":"production","variables":{"version":{"default":"2.11","description":"Version of the API"}}}],"security":[{"rest_key":[]}],"components":{"securitySchemes":{"rest_key":{"type":"http","scheme":"bearer","description":"## API Key Authentication\n\nAuthentication is required in order to interact with Batch's APIs.\n\nBatch implements authentication using API Keys, that we call the \"REST API Key\".\nYou can find it on your dashboard.\n\nPlease make sure that you keep this key secret. You should never use it in client apps to call APIs from there as it would\neasily be extractable.\n\n### How to authenticate\n\nIn order to authenticate your requests, add your REST API Key in the `Authorization` header and prefix it by `Bearer`. Example: `Authorization: Bearer bcd38d9rfb38ra28`.\n"}},"parameters":{"HeaderProjectKey":{"in":"header","name":"X-Batch-Project","description":"The unique project key, identifying a project on the Batch platform","schema":{"type":"string"},"required":true}},"schemas":{"ExportAttributeRequest":{"type":"object","title":"Profile Attributes export","required":["export_type"],"properties":{"export_type":{"type":"string","description":"Type of the export events request.","enum":["ATTRIBUTES"]},"attributes":{"type":"array","minItems":1,"items":{"type":"string"},"description":"List of custom or native attributes to be included in the export file(s). Any value that does not start with a `$` will be interpreted as a custom attribute. A list of native attributes available is provided below:\n\n- `$creation_date`\n- `$email_address`\n- `$email_marketing`\n- `$language`\n- `$last_activity`\n- `$last_email_marketing_click`\n- `$last_email_marketing_open`\n- `$last_email_transactional_click`\n- `$last_email_transactional_open`\n- `$last_visit_date`\n- `$phone_number`\n- `$region`\n- `$sms_marketing`\n- `$timezone`\n- `$push_subscriptions`\n- `$install_date`\n- `$email_open_tracking_consent`\n- `$topic_preferences`\n"},"identifiers":{"type":"array","minItems":1,"items":{"type":"string","enum":["custom_id","installation_ids"]},"description":"List of profile identifiers to be included in the export file(s)."},"filter":{"type":"object","description":"Optional filter to refine the export. A rate limit applies when using this parameter.","properties":{"segment":{"type":"string","description":"Code of the segment you want to filter this export with."}}}}},"ExportEventRequest":{"type":"object","title":"Profile Events export","required":["export_type","from","to","events"],"properties":{"export_type":{"type":"string","description":"Type of the export events request.","enum":["EVENTS"]},"from":{"type":"string","description":"UTC date in a RFC 3339. Must be before `to` parameter and not older than the lookback period."},"to":{"type":"string","description":"UTC date in a RFC 3339 format or `now`."},"identifiers":{"type":"array","items":{"type":"string","enum":["custom_id"]},"description":"List of profile identifiers to be included in the export file(s)."},"events":{"type":"array","minItems":1,"items":{"type":"string","enum":["email_bounced","email_click","email_delivered","email_open","email_sent","email_spam_complaint","email_unsubscribed","sms_sent","sms_bounced","sms_delivered","sms_unsubscribed","push_sent","push_bounced","push_open"]},"description":"List of events to be included in the export file(s)."},"orchestration_ids":{"type":"array","minItems":1,"items":{"type":"string"},"description":"List of orchestrations IDs to be exported. If not provided, all orchestrations will be exported."}}},"ExportReachabilityRequest":{"type":"object","title":"Profile Reachability export","required":["export_type","from","to","channels"],"properties":{"export_type":{"type":"string","description":"Type of the export reachability request.","enum":["REACHABILITY"]},"from":{"type":"string","description":"UTC date in a RFC 3339. Must be before `to` parameter and not older than the lookback period."},"to":{"type":"string","description":"UTC date in a RFC 3339 format or `now`."},"identifiers":{"type":"array","minItems":1,"items":{"type":"string","enum":["custom_id","installation_id"]},"description":"List of profile identifiers to be included in the export file(s)."},"channels":{"type":"array","minItems":1,"items":{"type":"string","enum":["email","push","sms"]}}}},"Error":{"type":"object","required":["error_message","error_code"],"properties":{"error_message":{"description":"A human readable error message","type":"string"},"error_code":{"description":"Error code","type":"string"}}}},"responses":{"400":{"description":"The request is malformed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The Rest API Key is not valid for this project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Batch's services are under maintenance. Please try again later","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/profiles/export":{"post":{"operationId":"profile_export","tags":["Profiles"],"summary":"Export","description":"Create a request to export profile data.","parameters":[{"$ref":"#/components/parameters/HeaderProjectKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"discriminator":{"propertyName":"export_type","mapping":{"ATTRIBUTES":"#/components/schemas/ExportAttributeRequest","EVENTS":"#/components/schemas/ExportEventRequest"}},"anyOf":[{"$ref":"#/components/schemas/ExportAttributeRequest"},{"$ref":"#/components/schemas/ExportEventRequest"},{"$ref":"#/components/schemas/ExportReachabilityRequest"}]}}}},"responses":{"202":{"description":"If the POST to the API endpoint is successful you will receive an HTTP 202 confirmation and a request id. <br/>Once you get your request id, you can use it to check the export request status with the <a href=\"/operations/export_view\">export view API endpoint</a>.\n","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The export id associated with your request to be used to get status."}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}}}}
```

#### 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:

`/profiles/export`

#### Headers and authentication

See [Overview → Using Project APIs](https://doc.batch.com/developer/api/cep/..#request-headers-and-authentication).

## 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:

```json
{
    "export_type": "ATTRIBUTES",
    "attributes": [
        "$creation_date",
        "$email_address",
        "$email_marketing",
        "$email_open_tracking_consent",
        "$language",
        "$last_activity",
        "$last_email_marketing_click",
        "$last_email_marketing_open",
        "$last_email_transactional_click",
        "$last_email_transactional_open",
        "$last_visit_date",
        "$phone_number",
        "$push_subscriptions",
        "$region",
        "$sms_marketing",
        "$timezone"
    ],
    "identifiers": [
        "custom_id",
        "installation_ids"
    ],
    "filter": {
        "segment": "MY-SEGMENT-CODE"
    }
}
```

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

The `filter` parameter is optional. Currently, you can only filter by `segment`. Specify the segment by providing the segment code\* you want to use for this export.

\*The segment code is available in two places within the Dashboard on the Segments page:

* Either via the "Copy segment code" option in the dropdown menu.
* Or by clicking the copy icon on the right-hand side of the modal for the specific segment.

<figure><img src="https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FSxJlrSz7NBtGKJl7k657%2Fimage.png?alt=media&#x26;token=10b1bd8d-a260-48a5-a9b9-6e05e68effa8" alt=""><figcaption></figcaption></figure>

### Rate limiting with filter parameter

Please note: when the filter parameter is being passed, we apply a rate limiting of 5 requests per hour (1 new request authorised every 12 minutes), with a maximum authorised burst of 10 requests.

### Export file structure

The export will contain a list of attributes. Each attribute is composed of an attribute object and an identifiers object.

<table data-full-width="true"><thead><tr><th width="160">Field</th><th>Description</th><th width="129.5">Type</th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>attribute</td><td>Representation of an attribute object</td><td>object</td><td>true</td></tr><tr><td>identifiers</td><td>Representation of an identifiers object</td><td>object</td><td>true</td></tr></tbody></table>

#### **Attribute Object**

Representation of an attribute object.&#x20;

<table data-full-width="true"><thead><tr><th width="267.1572265625">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="oACGseyR82um" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>creation_date</td><td>Profile's creation date<br><br><em>E.g.</em><code>{"creation_date":"2025-06-30T11:55:17Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>email_address</td><td>Profile's email address<br><br><em>E.g.</em><code>{"email_address":"jane.doe@demobatch.com"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>email_marketing</td><td>Profile's marketing emails subscription<br><br><em>E.g.</em><code>{"email_marketing":"subscribed"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>email_open_tracking_consent</td><td><p>Profile’s consent for tracking email opens</p><p></p><p><em>E.g.</em><code>{"email_open_tracking_consent":"granted"}</code></p></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>language</td><td>Profile's language<br><br><em>E.g.</em><code>{"language":"en"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>last_activity</td><td>Profile's last activity<br><br><em>E.g.</em><code>{"last_activity":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>last_email_marketing_click</td><td>Profile's last marketing email click<br><br><em>E.g.</em><code>{"last_email_marketing_click":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>last_email_marketing_open</td><td>Profile's last marketing email open (machine opens are excluded)<br><br><em>E.g.</em><code>{"last_email_marketing_open":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>last_email_transactional_click</td><td>Profile's last transactional email click<br><br><em>E.g.</em><code>{"last_email_transactional_click":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>last_email_transactional_open</td><td>Profile's last transactional email open<br><br><em>E.g.</em><code>{"last_email_transactional_open":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>last_visit_date</td><td>Profile's last visite date<br><br><em>E.g.</em><code>{"last_visit_date":"2025-06-30T14:25:56Z"}</code></td><td><span data-option="gqOXhDkpJ7oc">date</span></td><td>false</td></tr><tr><td>phone_number</td><td>Profile's phone number<br><br><em>E.g.</em><code>{"phone_number":"+33182837140"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>push_subscriptions</td><td><p>Profile's push subscriptions.<br><br><em>E.g.</em></p><pre><code>  
{
  "push_subscriptions":  [
    {
      "installation_id": "0105958C-3A45-4945-B6EE-0A55F682BA55",
      "is_subscribed": true,
      "platform": "IOS"
    }
  ]
}
</code></pre><p></p></td><td><span data-option="oACGseyR82um">array</span></td><td>false</td></tr><tr><td>region</td><td>Profile's region<br><br><em>E.g.</em><code>{"region":"FR"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>sms_marketing</td><td>Profile's marketing SMS subscription<br><br><em>E.g.</em><code>{"sms_marketing":"subscribed"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>timezone</td><td>Profile's timezone<br><br><em>E.g.</em><code>{"timezone":"Europe/Paris"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

#### **Identifiers object**

Represents the identifiers of the profile concerned by the event.

<table data-full-width="true"><thead><tr><th width="160">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="ymA4mB98Cgd3" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>profile_id</td><td>Unique identifier of the profile<br><br><em>E.g.</em><code>{"profile_id":"profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>custom_id</td><td>Custom identifier of the profile<br><br><em>E.g.</em><code>{"custom_id":"User1"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>installation_ids</td><td>Installation identifier of the profile. Only available on PUSH channels<br><br><em>E.g.</em><code>{"installation_ids": ["828A7D76-3D5E-49DC-A863-2465070184C9"]}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

### Export file sample

This is a sample of the content of the export file you will receive.

**Example**

```json
[
  {
    "attributes": {
      "$email_address": "jane.doe@demobatch.com",
      "$email_marketing": "subscribed",
      "email_open_tracking_consent": "denied",
      "$language": "fr",
      "$phone_number": null,
      "$region": "FR",
      "$sms_marketing": "unsubscribed",
      "$timezone": "Europe/Paris"
    },
    "identifiers": {
      "custom_id": "User1",
      "installation_ids": ["828A7D76-3D5E-49DC-A863-2465070184C9"],
      "profile_id": "profile_1m9yqztq4w5gxs2pbkqkn8rt1agv0p9n"
    }
  },
  {
    "attributes": {
      "$email_address": "john.doe@demobatch.com",
      "$email_marketing": "subscribed",
      "$language": "fr",
      "$phone_number": null,
      "$region": "FR",
      "$sms_marketing": "unsubscribed",
      "$timezone": "Europe/Paris"
    },
    "identifiers": {
      "custom_id": "User2",
      "profile_id": "profile_3r1vczm73kzq8ebfyt72cp4nm9qd2jk6"
    }
  },
  {
    "attributes": {
      "$email_address": null,
      "$email_marketing": "unsubscribed",
      "$language": "fr",
      "$phone_number": "+33182837140",
      "$region": "FR",
      "$sms_marketing": "subscribed",
      "$timezone": "Europe/Paris"
    },
    "identifiers": {
      "profile_id": "profile_0vnyhjdkt9bs0fx1znp5a4ew8mcz21td"
    }
  }
]
```

## 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:

```json
{
    "export_type": "EVENTS",
    "from": "2024-01-01T00:00:00Z",
    "to": "now",
    "events": [
        "email_sent",
        "email_delivered",
        "email_open",
        "email_click",
        "email_unsubscribed",
        "email_bounced",
        "email_spam_complaint",
        "sms_sent",
        "sms_delivered",
        "sms_click"
        "sms_unsubscribed",
        "sms_bounced",
        "push_sent",
        "push_open",
        "push_bounced",
        "in_app_delivered",
        "in_app_click",
        "in_app_dismissed",
        "mobile_landing_delivered",
        "mobile_landing_click",
        "mobile_landing_dismissed",
        "universal_delivered",
        "universal_bounced"
    ],
    "identifiers": [
        "custom_id"
    ]
}
```

### Export file structure

This export will contain a list of events with it fields and an identifiers object.&#x20;

#### **Event fields**

<table data-full-width="true"><thead><tr><th width="176">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="oACGseyR82um" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>ab_testing_status</td><td>Orchestration's A/B testing status<br><br><em>E.g.</em><code>{"ab_testing_status":"ONGOING"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>ab_testing_variant</td><td>Event's A/B testing variant<br><br><em>E.g.</em><code>{"ab_testing_variant":"A"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>action</td><td><p>Indicates the action triggered when the user interacted with the message (mobile landing or in-app). This can be a standard Batch action or a custom one defined<br><br></p><p>Possible values include:</p><ul><li><code>batch.dismiss</code>: The message was dismissed by the user.</li><li><code>batch.redirect_settings</code>: The user was redirected to app settings.</li><li><code>batch.smart_reoptin</code>: A re-opt-in prompt was displayed (e.g., for push permissions).</li><li><code>batch.rating</code>: A rating prompt was triggered.</li><li><code>batch.redirect</code>: The user was redirected to a URL.</li></ul><p><br><em>E.g.</em><code>{"action":"batch.dismiss"}</code></p></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>api_key</td><td>Application's API Key<br><br><em>E.g.</em><code>{"api_key":"6B29A8F1E7CD4B93AC1D0F52C4A19BE7"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>bounce_code</td><td>Event's bounce code<br><br><em>E.g.</em><code>{"bounce_code":"invalid_recipient"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>bounce_type</td><td>Event's bounce type<br><br><em>E.g.</em><code>{"bounce_type":"hard"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>click_url</td><td>Event's click url<br><br><em>E.g.</em><code>{"click_url":"https://www.batch.com"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>click_url_name</td><td>Event's click url name<br><br><em>E.g.</em><code>{"click_url_name":"Batch"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>email_address</td><td>Profile's email address<br><br><em>E.g.</em><code>{"email_address":"jane.doe@demobatch.com"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>event_date</td><td>Event's date<br><br><em>E.g.</em><code>{"event_date":"2025-09-08T16:21:44Z"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>event_type</td><td>Event's type<br><br><em>E.g.</em><code>{"event_type":"push_sent"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>machine_open</td><td>Indicates whether the email open was likely triggered by an automated system rather than a real user<br><br><em>E.g.</em><code>{"machin_open":true}</code></td><td><span data-option="vZBQf3kOWeK7">boolean</span></td><td>false</td></tr><tr><td>mailbox_provider</td><td>Profile's mailbox provider<br><br><em>E.g.</em><code>{"mailbox_provider":"Gsuite"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>is_push_opt_in</td><td>Indicates whether the profile has opted in to push notifications<br><br><em>E.g.</em><code>{"is_push_opt_in":true}</code></td><td><span data-option="vZBQf3kOWeK7">boolean</span></td><td>false</td></tr><tr><td>message_language</td><td>Message's language<br><br><em>E.g.</em><code>{"message language":"fr"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>open_type</td><td><p>Indicates whether the push <code>open</code> was direct (triggered from the notification) or <code>influenced</code> (the app was opened within 3 hours without interacting with the notification)</p><p><br><em>E.g.</em><code>{"open_type":"direct"}</code></p></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>orchestration_id</td><td>Orchestration's identifier<br><br><em>E.g.</em><code>{"orchestration_id":"orchestration_0fuy7ah8kqtmvd3jcp2x96ge5n1rwxbq"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>orchestration_name</td><td>Orchestration's name<br><br><em>E.g.</em><code>{"orchestration_name":"Welcome Batch"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>phone_country</td><td>Profile's phone country<br><br><em>E.g.</em><code>{"phone_country":"fr"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>phone_number</td><td>Profile's phone number<br><br><em>E.g.</em><code>{"phone_number":"+33182837140"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>platform</td><td>Installation platform<br><br><em>E.g.</em><code>{"platform":"IOS"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>sent_id</td><td>Event's sent identifier<br><br><em>E.g.</em><code>{"sent_id":"9f3c1024-b238-11f0-89ea-5e9dcf083d3f"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>sms_parts</td><td>Number of message parts in the sent SMS<br><br><em>E.g.</em><code>{"sms_parts":1}</code></td><td><span data-option="AdsrzUX4dqzE">integer</span></td><td>false</td></tr><tr><td>step_id</td><td>Step's identifier<br><br><em>E.g.</em><code>{"step_id":"MESSAGE__t9HwKzL"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>step_name</td><td>Step's name<br><br><em>E.g.</em><code>{"step_name":"Welcome step"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

#### **Identifiers object**

Represents the identifiers of the profile concerned by the event.

<table data-full-width="true"><thead><tr><th width="160">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="ymA4mB98Cgd3" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>profile_id</td><td>Unique identifier of the profile.<br><br><em>E.g.</em><code>{"profile_id":"profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>custom_id</td><td>Custom identifier of the profile<br><br><em>E.g.</em><code>{"custom_id":"User1"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>installation_id</td><td>Installation identifier of the profile. Available on push &#x26; in-app channels<br><br><em>E.g.</em><code>{"installation_id":"828A7D76-3D5E-49DC-A863-2465070184C9"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

#### **Event type**

Exhaustive list of type for the event.

* `email_sent`: Triggered when the email is sent.
* `email_delivered`: Triggered when the email is successfully accepted by the recipient's email server.
* `email_open`: Triggered when the recipient opens the email.
* `email_click`: Triggered when the recipient clicks a link in the email.
* `email_unsubscribed`: Triggered when the recipient unsubscribes from emails.
* `email_bounced`: Triggered when an email fails to deliver.
* `email_spam_complaint`: Triggered when the recipient marks the email as spam.
* `sms_sent`: Triggered when an SMS is sent.
* `sms_delivered`: Triggered when the SMS is successfully delivered.
* `sms_click`: Triggered when the recipient clicks a link in the SMS.
* `sms_unsubscribed`: Triggered when the recipient unsubscribes from SMS.
* `sms_bounced`: Triggered when an SMS fails to deliver.
* `push_sent`: Triggered when a push notification is sent.
* `push_open`: Triggered when the user opens the app via the push notification.
* `push_bounced`: Triggered when the push fails (e.g., invalid token).
* `in_app_delivered` : Triggered when the In-App was successfully displayed to the recipient.
* `in_app_click` : Triggered when the recipient clicks on a button, excluding buttons configured with a "Dismiss" action.
* `in_app_dismissed` : Triggered when the recipient dismisses the in-app (e.g: by clicking on a "Dismiss" button,  the top-right 'X' button or swiping).
* `mobile_landing_delivered` : Triggered when the Mobile Landing is successfully delivered.
* `mobile_landing_click` : Triggered when the recipient clicks a link in the Mobile Landing.
* `mobile_landing_dismissed` : Triggered when the recipient taps the dismiss button on the Mobile Landing.
* `universal_delivered`: Triggered when a Universal Channel message is successfully delivered (e.g: the target API responds with an HTTP 200 status code).
* `universal_bounced`: Triggered when a Universal Channel message fails to deliver (e.g: the target API responds with a non-200 HTTP status code).

### Export file sample

This is a sample of the content of the export file you will receive.

**Example**

```json
[
  {
      "ab_testing_status": null,
      "ab_testing_variant": null,
      "api_key": "6B29A8F1E7CD4B93AC1D0F52C4A19BE7",
      "event_date": "2025-08-29T13:05:55Z",
      "event_type": "push_sent",
      "identifiers": {
        "custom_id": "User1",
        "profile_id": "profile_1m9yqztq4w5gxs2pbkqkn8rt1agv0p9n",
        "installation_id": "5420388A-D2EF-4397-AC9A-999231DA50D5"
      },
      "is_push_opt_in": true,
      "message_language": "default",
      "orchestration_id": "orchestration_0fuy7ah8kqtmvd3jcp2x96ge5n1rwxbq",
      "orchestration_name": "Batch welcome orchestration",
      "platform": "IOS",
      "sent_id": "9f3c1024-b238-11f0-89ea-5e9dcf083d3f",
      "step_id": "MESSAGE__t9HwKzL",
      "step_name": "Welcome push"
    },
    {
    "ab_testing_status": null,
    "ab_testing_variant": null,
    "event_date": "2025-09-02T15:10:24Z",
    "event_type": "sms_sent",
    "identifiers": {
      "custom_id": "User2",
      "profile_id": "profile_3r1vczm73kzq8ebfyt72cp4nm9qd2jk6"
    },
    "message_language": "default",
    "orchestration_id": "orchestration_0fuy7ah8kqtmvd3jcp2x96ge5n1rwxbq",
    "orchestration_name": "Batch welcome orchestration",
    "phone_country": "fr",
    "phone_number": "+33182837140",
    "sent_id": "sms_1b5uvrk84g3xmk2ze7w9tdapf6q1js0y",
    "sms_parts": 1,
    "step_id": "MESSAGE__pX7dQKz",
    "step_name": "Welcome sms"
  },
  {
    "ab_testing_status": null,
    "ab_testing_variant": null,
    "email_address": "jane.doe@demobatch.com",
    "event_date": "2025-09-03T13:34:51Z",
    "event_type": "email_sent",
    "identifiers": {
      "custom_id": "",
      "profile_id": "profile_0vnyhjdkt9bs0fx1znp5a4ew8mcz21td"
    },
    "mailbox_provider": "Gsuite",
    "message_language": "default",
    "orchestration_id": "orchestration_1q3cymdz0npk8g4xv67whjkb25r9emtc",
    "orchestration_name": "Email Marketing Campaign",
    "sent_id": "email_1vyqn54j0exu38wdg2tsmk7rz9ba4kyh",
    "step_id": "MESSAGE__Aq9KdLm",
    "step_name": null
  },
  {
      "ab_testing_status": null,
      "ab_testing_variant": null,
      "api_key": "6B29A8F1E7CD4B93AC1D0F52C4A19BE7",
      "event_date": "2025-08-29T18:05:55Z",
      "event_type": "in_app_deliverd",
      "identifiers": {
        "custom_id": "User1",
        "profile_id": "profile_1m9yqztq4w5gxs2pbkqkn8rt1agv0p9n",
        "installation_id": "5420388A-D2EF-4397-AC9A-999231DA50D5"
      },
      "message_language": "default",
      "orchestration_id": "orchestration_0fuy7ah8kqtmvd3jcp2x96ge5n1rwxbq",
      "orchestration_name": "Batch welcome orchestration",
      "platform": "IOS",
      "sent_id": "c7a4b9e2-3d51-4f8a-9c7e-2b5d8fa13c6b",
      "step_id": "MESSAGE__7yLjSgc",
      "step_name": "Welcome In-App"
    },
    {
      "ab_testing_status": null,
      "ab_testing_variant": null,
      "body": "{\"code\":\"SUCCESS\"}",
      "api_key": "6B29A8F1E7CD4B93AC1D0F52C4A19BE7",
      "event_date": "2025-09-10T15:32:41Z",
      "event_type": "universal_delivered",
      "identifiers": {
        "custom_id": "",
        "profile_id": "profile_0vnyhjdkt9bs0fx1znp5a4ew8mcz21td",
      },
      "message_language": "default",
      "orchestration_id": "orchestration_0fuy7ah8kqtmvd3jcp2x96ge5n1rwxbq",
      "orchestration_name": "Batch welcome orchestration",
      "sent_id": "f2726c46-d10c-4020-930a-c1a847b9b52f",
      "status_code": 202,
      "status_label": "Accepted",
      "step_id": "MESSAGE__EoSTVLN",
      "step_name": "Reminder WhatsApp - Universal Channel",
      "url": "https://api.sender.com/send"
    }
]
```

## 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:

```json
{
  "export_type": "REACHABILITY",
  "from": "2024-01-01T00:00:00Z",
  "to": "now",
  "channels": [
    "push",
    "email",
    "sms"
  ],
  "identifiers": [
    "custom_id",
    "installation_id"
  ]
}
```

### Export file structure

The export will contain a list of reachability events. Each event is composed of an event object and an identifiers object.

<table data-full-width="true"><thead><tr><th width="160">Field</th><th>Description</th><th width="129.5">Type</th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>event</td><td>Representation of a reachability event object</td><td>object</td><td>false</td></tr><tr><td>identifiers</td><td>Representation of an identifiers object</td><td>object</td><td>false</td></tr></tbody></table>

#### **Event Object**

Representation of an reachability event object. It also describes a part of the profile state at the time of the event.

<table data-full-width="true"><thead><tr><th width="176">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="oACGseyR82um" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>channel</td><td>Channel where the event happened<br><br><em>E.g.</em><code>{"channel":"SMS"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>id</td><td>Unique identifier of the event<br><br><em>E.g.</em><code>{"id":"6156b060574cb223e8c4ed47c5df1855"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>timestamp</td><td>UTC date in a RFC 3339 format<br><br><em>E.g.</em><code>{"timestamp":"2024-01-01T00:00:00Z"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>reasons</td><td>Reasons why an event has been triggered. See "<a href="#event-reasons">Event Reasons</a>"<br><br><em>E.g.</em><code>{"reasons":["SUBSCRIBED_TO_SMS_MARKETING","PHONE_NUMBER_ADDED"]}</code></td><td><span data-option="oACGseyR82um">array</span></td><td>true</td></tr><tr><td>has_phone_number</td><td>Only for SMS channel, means the profile has a phone number<br><br><em>E.g.</em><code>{"has_phone_number":true}</code></td><td><span data-option="vZBQf3kOWeK7">boolean</span></td><td>false</td></tr><tr><td>has_email_address</td><td>Profile's marketing email subscription<br><br><em>E.g.</em><code>{"has_email_address":true}</code></td><td><span data-option="vZBQf3kOWeK7">boolean</span></td><td>false</td></tr><tr><td>sms_marketing</td><td>Profile's marketing SMS subscription<br><br><em>E.g.</em><code>{"sms_marketing":"subscribed"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>email_marketing</td><td>Profile's marketing emails subscription<br><br><em>E.g.</em><code>{"email_marketing":"subscribed"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>is_optin</td><td>Installation's notification system opt-in state<br><br><em>E.g.</em><code>{"is_optin":false}</code></td><td><span data-option="vZBQf3kOWeK7">boolean</span></td><td>false</td></tr><tr><td>platform</td><td>Platform of the installation (iOS/Android/Webpush). Only available on PUSH channels<br><br><em>E.g.</em><code>{"platform":"iOS"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

#### **Identifiers object**

Represents the identifiers of the profile concerned by the event.

<table data-full-width="true"><thead><tr><th width="160">Field</th><th>Description</th><th width="129.5">Type<select><option value="rn7XQMsPxf4H" label="string" color="blue"></option><option value="vZBQf3kOWeK7" label="boolean" color="blue"></option><option value="jomW5tEkEcvk" label="number" color="blue"></option><option value="AdsrzUX4dqzE" label="integer" color="blue"></option><option value="APJnqnYmjVJH" label="float" color="blue"></option><option value="gqOXhDkpJ7oc" label="date" color="blue"></option><option value="ClA6owk28jCv" label="object" color="blue"></option><option value="ymA4mB98Cgd3" label="array" color="blue"></option></select></th><th width="95.5" data-type="checkbox">Required</th></tr></thead><tbody><tr><td>profile_id</td><td>Unique identifier of the profile.<br><br><em>E.g.</em><code>{"profile_id":"profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>true</td></tr><tr><td>custom_id</td><td>Custom identifier of the profile<br><br><em>E.g.</em><code>{"custom_id":"User1"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr><tr><td>installation_id</td><td>Installation identifier of the profile. Only available on PUSH channels<br><br><em>E.g.</em><code>{"installation_id":"828A7D76-3D5E-49DC-A863-2465070184C9"}</code></td><td><span data-option="rn7XQMsPxf4H">string</span></td><td>false</td></tr></tbody></table>

#### **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**

```json
[
  {
    "event": {
      "channel": "SMS",
      "id": "6156b060574cb223e8c4ed47c5df1855",
      "timestamp": "2024-01-01T00:00:00Z",
      "reasons": [
        "PHONE_NUMBER_ADDED",
        "SUBSCRIBED_TO_SMS_MARKETING"
      ],
      "has_phone_number": true,
      "sms_marketing": "subscribed"
    },
    "identifiers": {
      "profile_id": "profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v",
      "custom_id": "User1",
      "installation_id": "5420388A-D2EF-4397-AC9A-999231DA50D5"
    }
  },
  {
    "event": {
      "channel": "EMAIL",
      "id": "6156b060574cb223e8c4ed47c5df1855",
      "timestamp": "2024-01-01T00:00:00Z",
      "reasons": [
        "SUBSCRIBED_TO_EMAIL_MARKETING"
      ],
      "has_email_address": true,
      "email_marketing": "subscribed"
    },
    "identifiers": {
      "profile_id": "profile_f8e9w2vnfdpg1pcqwp0cjkpjd3a3pfgt",
      "custom_id": "User2",
      "installation_id": "643B366B-A643-415B-9E60-3E525A11EF88"
    }
  },
  {
    "event": {
      "channel": "PUSH",
      "id": "6156b060574cb223e8c4ed47c5df1856",
      "timestamp": "2024-01-01T00:00:00Z",
      "reasons": [
        "SUBSCRIBED_TO_PUSH"
      ],
      "is_optin": true,
      "platform": "iOS"
    },
    "identifiers": {
      "profile_id": "profile_063kxgw384nn7k3wxgsa0xfbd0pgmd9v",
      "installation_id": "828A7D76-3D5E-49DC-A863-2465070184C9"
    }
  }
]
```

## 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](https://doc.batch.com/developer/api/cep/exports/view) endpoints.

```json
{
    "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 API Description.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/developer/api/cep/profiles/export.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
