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

# Get Dataset Upload URL

GET https://api.prolific.com/api/v1/data-collection/datasets/{dataset_id}/upload-url/{filename}

Generates a presigned S3 URL for uploading a file to the dataset. Use the returned URL to PUT the file directly to S3.

**V3 datasets** (CSV/ZIP): returns `upload_url` and `http_method`. After the upload completes, poll `GET /datasets/{dataset_id}/status` for processing status.

**V4 datasets** (JSONL/CSV): additionally returns `import_id`. After the upload completes, poll `GET /datasets/{dataset_id}/imports/{import_id}` for per-upload status. Multiple upload URLs can be requested before any upload completes — each creates a distinct import job and S3 key.

Supported file types:

* V3: `.csv`, `.zip`
* V4: `.csv`, `.jsonl`

Reference: https://docs.prolific.com/api-reference/task-builder/get-dataset-upload-url

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

- `dataset_id` (string, required) — The ID of the dataset to upload files to
- `filename` (string, required) — The name of the file to upload (e.g. `data.jsonl`)

## Response

### 201

Presigned URL generated successfully

- `dataset_id` (string, required) — The ID of the dataset the upload URL was requested for.
- `upload_url` (string, required) — Presigned S3 URL. Make a PUT request to this URL with your file as the body.
- `http_method` (enum, required) — HTTP method to use with the presigned URL.
  - Allowed values: `PUT`
- `content_type` (string, required) — The `Content-Type` header value to use when making the S3 PUT request. Use this value exactly — e.g. `application/x-ndjson` for JSONL files.
- `expires_at` (datetime, required) — When the presigned URL expires (ISO 8601, UTC). The URL cannot be used after this time.
- `file_key` (string, optional) — The S3 object key for the uploaded file. Provided for reference only.
- `import_id` (string, optional) — Import job ID. **V4 datasets only.** Use with `GET /datasets/{dataset_id}/imports/{import_id}` to poll for upload and processing status.

## Errors

### 400 Bad Request Error

Bad request (e.g., unsupported file type for this dataset version)

- `error` (ErrorDetail, required)

### 403 Forbidden Error

Forbidden (e.g., user does not have access to the workspace)

- `any`

### 404 Not Found Error

Dataset not found

- `any`

## 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
{
  "dataset_id": "string",
  "upload_url": "string",
  "http_method": "PUT",
  "content_type": "string",
  "expires_at": "2024-01-15T09:30:00Z",
  "file_key": "string",
  "import_id": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.prolific.com/api/v1/data-collection/datasets/dataset_id/upload-url/filename"

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

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/data-collection/datasets/dataset_id/upload-url/filename';
const options = {method: 'GET', 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/datasets/dataset_id/upload-url/filename"

	req, _ := http.NewRequest("GET", 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/datasets/dataset_id/upload-url/filename")

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

request = Net::HTTP::Get.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.get("https://api.prolific.com/api/v1/data-collection/datasets/dataset_id/upload-url/filename")
  .header("Authorization", "Token <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/data-collection/datasets/dataset_id/upload-url/filename', [
  'headers' => [
    'Authorization' => 'Token <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/data-collection/datasets/dataset_id/upload-url/filename");
var request = new RestRequest(Method.GET);
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/datasets/dataset_id/upload-url/filename")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```