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

# Longitudinal or multi-part studies

This cookbook covers how to run longitudinal or multi-part studies using Prolific's API. Longitudinal studies involve
collecting data from the same participants over multiple time points, while multi-part studies involve multiple related
data collection sessions.

## Overview

To run a longitudinal study on Prolific, you set up **one Prolific study per time-point** and invite the same
participants back to each one. For each individual study, you should set the completion time and reward per participant
to reflect what participants will be required to do **within that stage of the experiment only**.

For example, if you're running a 2-part longitudinal study with an overall reward of \$3.00 and each part takes 10
minutes to complete, you would set this up as:

* **Study 1**: Estimated completion time 10 minutes, reward per participant \$1.50
* **Study 2**: Estimated completion time 10 minutes, reward per participant \$1.50

When participants have completed both parts of the study, you can approve both of their submissions so that they are
paid the full \$3.00 reward.

**Important:** The reward rate for each individual study across a longitudinal study on Prolific must meet our minimum
reward rate of £6 / \$8 per hour.

## Use cases

* Long-term research studies
* Follow-up data collection
* Multi-session experiments
* Tracking changes over time

## Step-by-step guide

### Create the first study

Create your initial study for the first time-point. This study should have:

* A clear description explaining the full structure of your study, especially if payment is contingent upon
  participation in follow-up stages
* Reward and estimated completion time that reflect **only this stage** of the study

### Request

POST [https://api.prolific.com/api/v1/studies/](https://api.prolific.com/api/v1/studies/)

```curl study_with_participant_recording
curl -X POST https://api.prolific.com/api/v1/studies/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "name": "Study about API'\''s with participant recording",
  "description": "This study aims to determine how to make a good public API with participant recording",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 10,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "Study about API'\''s with participant recording",
  "completion_codes": [
    {
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        }
      ]
    }
  ],
  "device_compatibility": [
    "mobile",
    "desktop",
    "tablet"
  ],
  "peripheral_requirements": [],
  "submissions_config": {
    "max_submissions_per_participant": 1
  },
  "completion_code": "ABC123"
}'
```

```python study_with_participant_recording
import requests

url = "https://api.prolific.com/api/v1/studies/"

payload = {
    "name": "Study about API's with participant recording",
    "description": "This study aims to determine how to make a good public API with participant recording",
    "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
    "prolific_id_option": "url_parameters",
    "total_available_places": 10,
    "estimated_completion_time": 5,
    "reward": 13,
    "internal_name": "Study about API's with participant recording",
    "completion_codes": [
        {
            "code": "ABC123",
            "code_type": "COMPLETED",
            "actions": [{ "action": "AUTOMATICALLY_APPROVE" }]
        }
    ],
    "device_compatibility": ["mobile", "desktop", "tablet"],
    "peripheral_requirements": [],
    "submissions_config": { "max_submissions_per_participant": 1 },
    "completion_code": "ABC123"
}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript study_with_participant_recording
const url = 'https://api.prolific.com/api/v1/studies/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Study about API\'s with participant recording","description":"This study aims to determine how to make a good public API with participant recording","external_study_url":"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}","prolific_id_option":"url_parameters","total_available_places":10,"estimated_completion_time":5,"reward":13,"internal_name":"Study about API\'s with participant recording","completion_codes":[{"code":"ABC123","code_type":"COMPLETED","actions":[{"action":"AUTOMATICALLY_APPROVE"}]}],"device_compatibility":["mobile","desktop","tablet"],"peripheral_requirements":[],"submissions_config":{"max_submissions_per_participant":1},"completion_code":"ABC123"}'
};

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

```go study_with_participant_recording
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/studies/"

	payload := strings.NewReader("{\n  \"name\": \"Study about API's with participant recording\",\n  \"description\": \"This study aims to determine how to make a good public API with participant recording\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"Study about API's with participant recording\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.prolific.com/api/v1/studies/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Study about API's with participant recording\",\n  \"description\": \"This study aims to determine how to make a good public API with participant recording\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"Study about API's with participant recording\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Study about API's with participant recording\",\n  \"description\": \"This study aims to determine how to make a good public API with participant recording\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"Study about API's with participant recording\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/', [
  'body' => '{
  "name": "Study about API\'s with participant recording",
  "description": "This study aims to determine how to make a good public API with participant recording",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 10,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "Study about API\'s with participant recording",
  "completion_codes": [
    {
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        }
      ]
    }
  ],
  "device_compatibility": [
    "mobile",
    "desktop",
    "tablet"
  ],
  "peripheral_requirements": [],
  "submissions_config": {
    "max_submissions_per_participant": 1
  },
  "completion_code": "ABC123"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp study_with_participant_recording
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Study about API's with participant recording\",\n  \"description\": \"This study aims to determine how to make a good public API with participant recording\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"Study about API's with participant recording\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift study_with_participant_recording
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Study about API's with participant recording",
  "description": "This study aims to determine how to make a good public API with participant recording",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 10,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "Study about API's with participant recording",
  "completion_codes": [
    [
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [["action": "AUTOMATICALLY_APPROVE"]]
    ]
  ],
  "device_compatibility": ["mobile", "desktop", "tablet"],
  "peripheral_requirements": [],
  "submissions_config": ["max_submissions_per_participant": 1],
  "completion_code": "ABC123"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

Make a note of the study `id` from the response as you will need this in the following steps.

### Publish the first study

Publish the study to start recruiting participants.

### Request

POST [https://api.prolific.com/api/v1/studies/\{id}/transition/](https://api.prolific.com/api/v1/studies/\{id}/transition/)

```curl Publish a draft study
curl -X POST https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "action": "PUBLISH"
}'
```

```python Publish a draft study
import requests

url = "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

payload = { "action": "PUBLISH" }
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Publish a draft study
const url = 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"action":"PUBLISH"}'
};

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

```go Publish a draft study
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

	payload := strings.NewReader("{\n  \"action\": \"PUBLISH\"\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Publish a draft study
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"PUBLISH\"\n}"

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

```java Publish a draft study
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"PUBLISH\"\n}")
  .asString();
```

```php Publish a draft study
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/', [
  'body' => '{
  "action": "PUBLISH"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Publish a draft study
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"PUBLISH\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Publish a draft study
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = ["action": "PUBLISH"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

Once the study has successfully published, the study's `status` will be `ACTIVE`. Wait for participants to complete
the study before proceeding to the next step.

### Get participant IDs from the first study

Once participants have completed the first study, you need to retrieve their participant IDs to create a custom
allowlist for your follow-up studies.

If your survey software supports recording participant IDs from a URL parameter, you can collect participant
IDs directly during the first study. Make sure to include the `PROLIFIC_PID` URL parameter in your study url to
capture this information. You can find more information on using URL parameters in the [URL parameters
guide](/api-reference/studies/the-study-object#external_study_url-required).

You can also get your participant IDs by getting the submissions for your study.

### Request

GET [https://api.prolific.com/api/v1/studies/\{id}/submissions/](https://api.prolific.com/api/v1/studies/\{id}/submissions/)

```curl
curl https://api.prolific.com/api/v1/studies/id/submissions/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json"
```

```python
import requests

url = "https://api.prolific.com/api/v1/studies/id/submissions/"

payload = {}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/studies/id/submissions/';
const options = {
  method: 'GET',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/studies/id/submissions/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

	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/studies/id/submissions/")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/studies/id/submissions/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/submissions/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/id/submissions/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/submissions/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

From the response, extract the `participant_id` from each submission you would like for your follow up studies.

You can also export the demographic data which includes participant IDs:

### Request

POST [https://api.prolific.com/api/v1/studies/\{id}/demographic-export/](https://api.prolific.com/api/v1/studies/\{id}/demographic-export/)

```curl Export basic demographic data
curl -X POST https://api.prolific.com/api/v1/studies/id/demographic-export/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "filters": []
}'
```

```python Export basic demographic data
import requests

url = "https://api.prolific.com/api/v1/studies/id/demographic-export/"

payload = { "filters": [] }
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Export basic demographic data
const url = 'https://api.prolific.com/api/v1/studies/id/demographic-export/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"filters":[]}'
};

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

```go Export basic demographic data
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/studies/id/demographic-export/"

	payload := strings.NewReader("{\n  \"filters\": []\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Export basic demographic data
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/studies/id/demographic-export/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"filters\": []\n}"

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

```java Export basic demographic data
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/id/demographic-export/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"filters\": []\n}")
  .asString();
```

```php Export basic demographic data
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/id/demographic-export/', [
  'body' => '{
  "filters": []
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Export basic demographic data
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/id/demographic-export/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"filters\": []\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Export basic demographic data
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = ["filters": []] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/demographic-export/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

Next make a note of all the participant IDs as you will need them to create a custom allowlist for your follow-up
studies. A custom allowlist ensures only participants who completed the first study are eligible for subsequent
parts.

### Create follow-up studies with custom allowlist

For each subsequent time-point, create a new study. Each follow-up study should:

* Have reward and estimated completion time that reflect **only that stage** of the study
* Use a custom allowlist filter to ensure only participants from the first study are eligible
* Include a clear description explaining it's part of a longitudinal study

To use a custom allowlist, include a filter with `filter_id` set to `custom_allowlist` and `selected_values`
containing the array of participant IDs you collected from the first study.

### Request

POST [https://api.prolific.com/api/v1/studies/](https://api.prolific.com/api/v1/studies/)

```curl study_with_allow_list
curl -X POST https://api.prolific.com/api/v1/studies/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "name": "Study about API'\''s for selected participants",
  "description": "This study aims to determine how to make a good public API",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 30,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "WIT-2022 Study about API'\''s version 2",
  "completion_codes": [
    {
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        }
      ]
    },
    {
      "code": "DEF234",
      "code_type": "FOLLOW_UP_STUDY",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        },
        {
          "action": "ADD_TO_PARTICIPANT_GROUP",
          "participant_group": "619e049f7648a4e1f8f3645b"
        }
      ]
    }
  ],
  "device_compatibility": [
    "mobile",
    "desktop",
    "tablet"
  ],
  "peripheral_requirements": [],
  "filters": [
    {
      "filter_id": "custom_allowlist",
      "selected_values": [
        "619e049f7648a4e1f8f3645b"
      ]
    }
  ],
  "submissions_config": {
    "max_submissions_per_participant": 1
  },
  "completion_code": "ABC123"
}'
```

```python study_with_allow_list
import requests

url = "https://api.prolific.com/api/v1/studies/"

payload = {
    "name": "Study about API's for selected participants",
    "description": "This study aims to determine how to make a good public API",
    "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
    "prolific_id_option": "url_parameters",
    "total_available_places": 30,
    "estimated_completion_time": 5,
    "reward": 13,
    "internal_name": "WIT-2022 Study about API's version 2",
    "completion_codes": [
        {
            "code": "ABC123",
            "code_type": "COMPLETED",
            "actions": [{ "action": "AUTOMATICALLY_APPROVE" }]
        },
        {
            "code": "DEF234",
            "code_type": "FOLLOW_UP_STUDY",
            "actions": [
                { "action": "AUTOMATICALLY_APPROVE" },
                {
                    "action": "ADD_TO_PARTICIPANT_GROUP",
                    "participant_group": "619e049f7648a4e1f8f3645b"
                }
            ]
        }
    ],
    "device_compatibility": ["mobile", "desktop", "tablet"],
    "peripheral_requirements": [],
    "filters": [
        {
            "filter_id": "custom_allowlist",
            "selected_values": ["619e049f7648a4e1f8f3645b"]
        }
    ],
    "submissions_config": { "max_submissions_per_participant": 1 },
    "completion_code": "ABC123"
}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript study_with_allow_list
const url = 'https://api.prolific.com/api/v1/studies/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"name":"Study about API\'s for selected participants","description":"This study aims to determine how to make a good public API","external_study_url":"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}","prolific_id_option":"url_parameters","total_available_places":30,"estimated_completion_time":5,"reward":13,"internal_name":"WIT-2022 Study about API\'s version 2","completion_codes":[{"code":"ABC123","code_type":"COMPLETED","actions":[{"action":"AUTOMATICALLY_APPROVE"}]},{"code":"DEF234","code_type":"FOLLOW_UP_STUDY","actions":[{"action":"AUTOMATICALLY_APPROVE"},{"action":"ADD_TO_PARTICIPANT_GROUP","participant_group":"619e049f7648a4e1f8f3645b"}]}],"device_compatibility":["mobile","desktop","tablet"],"peripheral_requirements":[],"filters":[{"filter_id":"custom_allowlist","selected_values":["619e049f7648a4e1f8f3645b"]}],"submissions_config":{"max_submissions_per_participant":1},"completion_code":"ABC123"}'
};

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

```go study_with_allow_list
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/studies/"

	payload := strings.NewReader("{\n  \"name\": \"Study about API's for selected participants\",\n  \"description\": \"This study aims to determine how to make a good public API\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 30,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"WIT-2022 Study about API's version 2\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    },\n    {\n      \"code\": \"DEF234\",\n      \"code_type\": \"FOLLOW_UP_STUDY\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        },\n        {\n          \"action\": \"ADD_TO_PARTICIPANT_GROUP\",\n          \"participant_group\": \"619e049f7648a4e1f8f3645b\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"custom_allowlist\",\n      \"selected_values\": [\n        \"619e049f7648a4e1f8f3645b\"\n      ]\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.prolific.com/api/v1/studies/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Study about API's for selected participants\",\n  \"description\": \"This study aims to determine how to make a good public API\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 30,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"WIT-2022 Study about API's version 2\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    },\n    {\n      \"code\": \"DEF234\",\n      \"code_type\": \"FOLLOW_UP_STUDY\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        },\n        {\n          \"action\": \"ADD_TO_PARTICIPANT_GROUP\",\n          \"participant_group\": \"619e049f7648a4e1f8f3645b\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"custom_allowlist\",\n      \"selected_values\": [\n        \"619e049f7648a4e1f8f3645b\"\n      ]\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Study about API's for selected participants\",\n  \"description\": \"This study aims to determine how to make a good public API\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 30,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"WIT-2022 Study about API's version 2\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    },\n    {\n      \"code\": \"DEF234\",\n      \"code_type\": \"FOLLOW_UP_STUDY\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        },\n        {\n          \"action\": \"ADD_TO_PARTICIPANT_GROUP\",\n          \"participant_group\": \"619e049f7648a4e1f8f3645b\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"custom_allowlist\",\n      \"selected_values\": [\n        \"619e049f7648a4e1f8f3645b\"\n      ]\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/', [
  'body' => '{
  "name": "Study about API\'s for selected participants",
  "description": "This study aims to determine how to make a good public API",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 30,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "WIT-2022 Study about API\'s version 2",
  "completion_codes": [
    {
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        }
      ]
    },
    {
      "code": "DEF234",
      "code_type": "FOLLOW_UP_STUDY",
      "actions": [
        {
          "action": "AUTOMATICALLY_APPROVE"
        },
        {
          "action": "ADD_TO_PARTICIPANT_GROUP",
          "participant_group": "619e049f7648a4e1f8f3645b"
        }
      ]
    }
  ],
  "device_compatibility": [
    "mobile",
    "desktop",
    "tablet"
  ],
  "peripheral_requirements": [],
  "filters": [
    {
      "filter_id": "custom_allowlist",
      "selected_values": [
        "619e049f7648a4e1f8f3645b"
      ]
    }
  ],
  "submissions_config": {
    "max_submissions_per_participant": 1
  },
  "completion_code": "ABC123"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp study_with_allow_list
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Study about API's for selected participants\",\n  \"description\": \"This study aims to determine how to make a good public API\",\n  \"external_study_url\": \"https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}\",\n  \"prolific_id_option\": \"url_parameters\",\n  \"total_available_places\": 30,\n  \"estimated_completion_time\": 5,\n  \"reward\": 13,\n  \"internal_name\": \"WIT-2022 Study about API's version 2\",\n  \"completion_codes\": [\n    {\n      \"code\": \"ABC123\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        }\n      ]\n    },\n    {\n      \"code\": \"DEF234\",\n      \"code_type\": \"FOLLOW_UP_STUDY\",\n      \"actions\": [\n        {\n          \"action\": \"AUTOMATICALLY_APPROVE\"\n        },\n        {\n          \"action\": \"ADD_TO_PARTICIPANT_GROUP\",\n          \"participant_group\": \"619e049f7648a4e1f8f3645b\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"custom_allowlist\",\n      \"selected_values\": [\n        \"619e049f7648a4e1f8f3645b\"\n      ]\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"ABC123\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift study_with_allow_list
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Study about API's for selected participants",
  "description": "This study aims to determine how to make a good public API",
  "external_study_url": "https://eggs-experriment.com?participant={{%PROLIFIC_PID%}}",
  "prolific_id_option": "url_parameters",
  "total_available_places": 30,
  "estimated_completion_time": 5,
  "reward": 13,
  "internal_name": "WIT-2022 Study about API's version 2",
  "completion_codes": [
    [
      "code": "ABC123",
      "code_type": "COMPLETED",
      "actions": [["action": "AUTOMATICALLY_APPROVE"]]
    ],
    [
      "code": "DEF234",
      "code_type": "FOLLOW_UP_STUDY",
      "actions": [
        ["action": "AUTOMATICALLY_APPROVE"],
        [
          "action": "ADD_TO_PARTICIPANT_GROUP",
          "participant_group": "619e049f7648a4e1f8f3645b"
        ]
      ]
    ]
  ],
  "device_compatibility": ["mobile", "desktop", "tablet"],
  "peripheral_requirements": [],
  "filters": [
    [
      "filter_id": "custom_allowlist",
      "selected_values": ["619e049f7648a4e1f8f3645b"]
    ]
  ],
  "submissions_config": ["max_submissions_per_participant": 1],
  "completion_code": "ABC123"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

**Multiple conditions:** If you have multiple conditions and want to keep these conditions consistent between
studies, you will need to set up a **separate follow-up study for each condition** and add only those participants
you want to be eligible to each study's custom allowlist. However, you will only need to run one study for the first
part if your survey software supports allocation to conditions from one URL.

Make a note of each follow-up study `id` as you will need them to monitor and approve submissions.

### Publish follow-up studies

Publish each follow-up study when you're ready to collect data for that time-point.

### Request

POST [https://api.prolific.com/api/v1/studies/\{id}/transition/](https://api.prolific.com/api/v1/studies/\{id}/transition/)

```curl Publish a draft study
curl -X POST https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "action": "PUBLISH"
}'
```

```python Publish a draft study
import requests

url = "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

payload = { "action": "PUBLISH" }
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Publish a draft study
const url = 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"action":"PUBLISH"}'
};

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

```go Publish a draft study
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

	payload := strings.NewReader("{\n  \"action\": \"PUBLISH\"\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Publish a draft study
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"PUBLISH\"\n}"

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

```java Publish a draft study
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"PUBLISH\"\n}")
  .asString();
```

```php Publish a draft study
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/', [
  'body' => '{
  "action": "PUBLISH"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Publish a draft study
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"PUBLISH\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Publish a draft study
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = ["action": "PUBLISH"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

You can publish all follow-up studies at once, or publish them at different times depending on your study design. If
you want your participants to complete the follow-up studies at particular times, make sure to specify this clearly
in your study description, including the time zone(s).

### Monitor study progress

Check the status of your studies to see how many participants have completed each part.

### Request

GET [https://api.prolific.com/api/v1/studies/\{id}/](https://api.prolific.com/api/v1/studies/\{id}/)

```curl
curl https://api.prolific.com/api/v1/studies/id/ \
     -H "Authorization: Token <token>"
```

```python
import requests

url = "https://api.prolific.com/api/v1/studies/id/"

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

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/studies/id/';
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/studies/id/"

	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/studies/id/")

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/studies/id/")
  .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/studies/id/', [
  'headers' => [
    'Authorization' => 'Token <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/id/");
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/studies/id/")! 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()
```

You can also check submission counts for each study:

### Request

GET [https://api.prolific.com/api/v1/studies/\{id}/submissions/counts/](https://api.prolific.com/api/v1/studies/\{id}/submissions/counts/)

```curl
curl https://api.prolific.com/api/v1/studies/id/submissions/counts/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json"
```

```python
import requests

url = "https://api.prolific.com/api/v1/studies/id/submissions/counts/"

payload = {}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/studies/id/submissions/counts/';
const options = {
  method: 'GET',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/studies/id/submissions/counts/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

	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/studies/id/submissions/counts/")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/studies/id/submissions/counts/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/submissions/counts/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/id/submissions/counts/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/submissions/counts/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Review and approve submissions

Once participants have completed all parts of your longitudinal study, you can review and approve their submissions.
You can get submissions for each study:

### Request

GET [https://api.prolific.com/api/v1/studies/\{id}/submissions/](https://api.prolific.com/api/v1/studies/\{id}/submissions/)

```curl
curl https://api.prolific.com/api/v1/studies/id/submissions/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json"
```

```python
import requests

url = "https://api.prolific.com/api/v1/studies/id/submissions/"

payload = {}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/studies/id/submissions/';
const options = {
  method: 'GET',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/studies/id/submissions/"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

	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/studies/id/submissions/")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/studies/id/submissions/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/submissions/', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/studies/id/submissions/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/submissions/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

**Payment timing:** If your study consists of multiple waves within 21 days, you can wait until the final wave is
complete before paying each wave. To do this, leave the submissions from the earlier studies as 'awaiting review'
until you are ready to approve them. Submissions will be automatically approved after 21 days if they are still
awaiting review at this point.

If the waves are over a longer period, all participants from each stage will need to be approved within 21 days.

To approve a submission, use the submission `id` and transition it to `APPROVED`:

### Request

POST [https://api.prolific.com/api/v1/submissions/\{id}/transition/](https://api.prolific.com/api/v1/submissions/\{id}/transition/)

```curl Approving a submission
curl -X POST https://api.prolific.com/api/v1/submissions/id/transition/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "action": "APPROVE"
}'
```

```python Approving a submission
import requests

url = "https://api.prolific.com/api/v1/submissions/id/transition/"

payload = { "action": "APPROVE" }
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Approving a submission
const url = 'https://api.prolific.com/api/v1/submissions/id/transition/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"action":"APPROVE"}'
};

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

```go Approving a submission
package main

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

func main() {

	url := "https://api.prolific.com/api/v1/submissions/id/transition/"

	payload := strings.NewReader("{\n  \"action\": \"APPROVE\"\n}")

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

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Approving a submission
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/submissions/id/transition/")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"APPROVE\"\n}"

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

```java Approving a submission
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"APPROVE\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [
  'body' => '{
  "action": "APPROVE"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Approving a submission
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"APPROVE\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Approving a submission
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = ["action": "APPROVE"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

You can find more information on reviewing submissions in the [submissions
guide](/api-reference/submissions/submissions-guide).

## More information

You can find more information on running longitudinal studies in this
[guide on Prolific's researcher help center](https://researcher-help.prolific.com/en/articles/445174-how-do-i-set-up-a-longitudinal-multi-part-study).

The guide goes into detail on best practices for:

* Additional considerations when designing longitudinal studies
* FAQs about longitudinal studies

## Help & support

For questions and requests specific to using Prolific's API, you can reach our support team through [this form](https://researcher-help.prolific.com/en/articles/476151-api-support).