> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.prolific.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.prolific.com/_mcp/server.

# Request a Batch Export

POST https://api.prolific.com/api/v1/data-collection/batches/{batch_id}/export

Initiates an asynchronous export of all participant responses and uploaded files for a batch as a ZIP archive.

The export is generated out-of-band to handle large batches without hitting API timeout limits. The endpoint always returns **202 Accepted** with an `export_id` — use it to poll `GET /batches/{batch_id}/export/{export_id}` for status.

Each request starts a fresh export job so you can retrieve newly submitted responses matching the same filter, unless one with the exact same filter is already generating, in which case its existing `export_id` is returned rather than starting a duplicate. A completed or failed export is never reused — sending `POST` again always starts a new job, giving you a snapshot of responses as of that request. Use `GET /batches/{batch_id}/export` to see every job you've already requested before starting another. Each batch can have at most 10 export jobs at a time (across all filters combined) — delete one to free up a slot if you hit that limit.

By default the export includes every response. Pass `study_id` and/or `from`/`to` to scope it to a subset — see the query parameters below. Terms combine as AND (e.g. `study_id` + `from`/`to` exports only that study's responses within the date range). Two exports requested with different filters are tracked as separate jobs.

Only researchers with workspace access to the batch can request an export.

Reference: https://docs.prolific.com/api-reference/task-builder/request-batch-export

## Authentication

- `Authorization` header (required) (prefixed with ` Token  `) — The Prolific API uses API token to authenticate requests. You can create an API token directly from your settings. Your API token does not have an expiry date and carries full permission, so be sure to keep them secure. If your token is leaked, delete it and create a new one directly in the app. In your requests add `Authorization` header with the value `Token <your token>`.

## Request

### Path parameters

- `batch_id` (string, required)

### Query parameters

- `study_id` (string, optional) — Only export responses submitted under this Prolific Study ID.
- `from` (datetime, optional) — Only export responses with `created_at` on or after this ISO 8601 datetime (inclusive). Accepts an offset (e.g. `+01:00`) or `Z`.
- `to` (datetime, optional) — Only export responses with `created_at` before this ISO 8601 datetime (exclusive). Must not be earlier than `from`.

## Response

### 202

Export generation started

- `status` (enum, required)
  - Allowed values: `generating`
- `export_id` (string, required) — The export job ID. Use this with `GET /batches/{batch_id}/export/{export_id}` to poll for status.

## Errors

### 400 Bad Request Error

Invalid filter — e.g. `to` is earlier than `from`, a date is not a valid ISO 8601 datetime, or `study_id` has no responses in this batch

- `error` (ErrorDetail, required)

### 403 Forbidden Error

Forbidden — user does not have workspace access to this batch

- `error` (ErrorDetail, required)

### 409 Conflict Error

Conflict — this batch already has the maximum of 10 export jobs; delete an existing export before requesting a new one

- `error` (ErrorDetail, required)

## Types

### ErrorDetail

- `status` (integer, required) — Status code as in the http standards
- `error_code` (integer, required) — Internal error code
- `title` (string, required) — Error title
- `detail` (ErrorDetailDetail, required) — Error detail
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

### ErrorDetailDetail

Error detail

- string
- list of string
- ErrorDetailDetail2

### ErrorDetailDetail2

All fields with validation errors

- `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions

## Examples

**Response**

```json
{
  "status": "generating",
  "export_id": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.prolific.com/api/v1/data-collection/batches/batch_id/export"

headers = {"Authorization": "Token <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/data-collection/batches/batch_id/export';
const options = {method: 'POST', headers: {Authorization: 'Token <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/data-collection/batches/batch_id/export"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Token <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/data-collection/batches/batch_id/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/data-collection/batches/batch_id/export")
  .header("Authorization", "Token <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/data-collection/batches/batch_id/export', [
  'headers' => [
    'Authorization' => 'Token <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/data-collection/batches/batch_id/export");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Token <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/data-collection/batches/batch_id/export")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```