# View export request

The export API allows you to retrieve a specific export request with its ID.

### API Description

## View

> Get information about an export request.

```json
{"openapi":"3.1.0","info":{"title":"Batch - REST API","version":"2.9"},"tags":[{"name":"Exports"}],"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":{"request":{"anyOf":[{"type":"object","required":["id","requested_at","scope","status","files","request"],"properties":{"id":{"type":"string","description":"Id of an export request."},"request_date":{"type":"string","description":"UTC date in a RFC 3339 format."},"completion_date":{"type":"string","description":"UTC date in a RFC 3339 format."},"start_date":{"type":"string","description":"UTC date in a RFC 3339 format."},"scope":{"description":"The scope of the export.","$ref":"#/components/schemas/scope"},"status":{"description":"The status of the export request.","$ref":"#/components/schemas/status"},"files":{"type":"array","description":"All the extraction files available for download if any.","items":{"$ref":"#/components/schemas/file"}},"request":{"type":"object","description":"The export request definition.","oneOf":[{"$ref":"#/components/schemas/ExportAttributeRequest"},{"$ref":"#/components/schemas/ExportEventRequest"}]}}}]},"scope":{"type":"string","enum":["PROFILE_ATTRIBUTES","PROFILE_EVENTS"]},"status":{"type":"string","enum":["CREATED","PENDING","RUNNING","ERROR","SUCCESS"]},"file":{"type":"object","title":"file","properties":{"id":{"type":"string","description":"Id of the extraction file available for download if any."},"part":{"type":"integer","description":"The part number of the file","minimum":1},"size":{"type":"integer","description":"Size of the file in bytes."},"url":{"type":"string","description":"URL to download the file."}}},"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- `$city`\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","installation_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."}}},"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"}}}},"404":{"description":"Not found","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":{"/exports/view":{"get":{"operationId":"export_view","summary":"View","description":"Get information about an export request.","tags":["Exports"],"parameters":[{"$ref":"#/components/parameters/HeaderProjectKey"},{"name":"id","in":"query","description":"Export request id received when creating an export request.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"If the GET to the API endpoint is successful you will receive an HTTP 200 confirmation and information about your export request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/request"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"},"503":{"$ref":"#/components/responses/503"}}}}}}
```

#### Route

The Project Export API exposes a GET endpoint that allows to get information about an export request:

`/exports/view`

#### Headers and authentication

See [Overview → Using Project APIs](/developer/api/cep.md#request-headers-and-authentication).

### Responses

#### Success

If the GET to the API endpoint is successful you will receive an **HTTP 200** confirmation and information about your export request.

```json
{
    "id": "export_nvctr8tgdjf7bppacxxt2aeemnjehfmw",
    "request_date": "2024-02-28T16:28:42Z",
    "scope": "PROFILE_ATTRIBUTES",
    "status": "SUCCESS",
    "request": {
        "export_type": "ATTRIBUTES",
        "attributes": [
            "$region",
            "$phone_number",
            "$timezone",
            "$email_marketing",
            "$sms_marketing",
            "$language",
            "$email_address"
        ],
        "identifiers": [
            "installation_ids",
            "custom_id"
        ]
    },
    "completion_date": "2024-02-28T16:28:48Z",
    "start_date": "2024-02-28T16:28:48Z",
    "files": [
        {
            "id": "file_etxhwckcfc05egew7y97bdjtc75p7g8b",
            "part": 1,
            "size": 592752,
            "url": "https://api.batch.com/2.4/exports/download?id=file_etxhwckcfc05egew7y97bdjtc75p7g8b"
        }
    ]
}
```

The response includes all the extraction files available for download if any (in the `files` field). The files can be downloaded via the provided URL in the `url` field (see [Download export API](/developer/api/cep/exports/download.md)). Depending on the amount of data extracted, a request may have multiple output `JSON` files with a maximum size of `100MB`.

Some information are only available when the `status` field is `SUCCESS`. 5 values are possible for request status:

* `CREATED`: for export request created and not yet PENDING
* `PENDING`: for export request ready-to-execute
* `RUNNING`: for export request being executed
* `SUCCESS`: for export request completed with success
* `ERROR`: for export request terminated with an error

#### 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/exports/view.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.
