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

# Monitoring study progress

Prolific provides webhook events for updates to your workspace, such as `study.status.change`, `study.progress.change` and `submission.status.change`.

#### List event types

### Request

GET [https://api.prolific.com/api/v1/hooks/event-types/](https://api.prolific.com/api/v1/hooks/event-types/)

```curl
curl https://api.prolific.com/api/v1/hooks/event-types/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json"
```

```python
import requests

url = "https://api.prolific.com/api/v1/hooks/event-types/"

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/hooks/event-types/';
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/hooks/event-types/"

	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/hooks/event-types/")

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/hooks/event-types/")
  .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/hooks/event-types/', [
  '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/hooks/event-types/");
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/hooks/event-types/")! 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()
```

Make a note of the event type you'd like to subscribe to. You'll need this later when setting up a subscription.

#### Create a secret

Secrets are used to verify the authenticity of our webhook requests to your system. It allows you to prove we have
sent them and the payload hasn't been fiddled with.

### Request

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

```curl
curl -X POST https://api.prolific.com/api/v1/hooks/secrets/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "workspace_id": "63519c1d5b139662f8cde482"
}'
```

```python
import requests

url = "https://api.prolific.com/api/v1/hooks/secrets/"

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

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/hooks/secrets/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"workspace_id":"63519c1d5b139662f8cde482"}'
};

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/hooks/secrets/"

	payload := strings.NewReader("{\n  \"workspace_id\": \"63519c1d5b139662f8cde482\"\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
require 'uri'
require 'net/http'

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

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  \"workspace_id\": \"63519c1d5b139662f8cde482\"\n}"

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/hooks/secrets/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"workspace_id\": \"63519c1d5b139662f8cde482\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/hooks/secrets/', [
  'body' => '{
  "workspace_id": "63519c1d5b139662f8cde482"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/hooks/secrets/")! 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()
```

This will create a new secret for your workspace and be returned in the response body. Keep this safe, and note that
you can only have one active secret per workspace at a time.

#### Subscribe to an event

### Request

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

```curl
curl -X POST https://api.prolific.com/api/v1/hooks/subscriptions/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "event_type": "study.status.change",
  "target_url": "https://hooks.myresearchapp.com/api/v1/notifications/study-status",
  "workspace_id": "63722982f9cc073ecc730f6b"
}'
```

```python
import requests

url = "https://api.prolific.com/api/v1/hooks/subscriptions/"

payload = {
    "event_type": "study.status.change",
    "target_url": "https://hooks.myresearchapp.com/api/v1/notifications/study-status",
    "workspace_id": "63722982f9cc073ecc730f6b"
}
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/hooks/subscriptions/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"event_type":"study.status.change","target_url":"https://hooks.myresearchapp.com/api/v1/notifications/study-status","workspace_id":"63722982f9cc073ecc730f6b"}'
};

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/hooks/subscriptions/"

	payload := strings.NewReader("{\n  \"event_type\": \"study.status.change\",\n  \"target_url\": \"https://hooks.myresearchapp.com/api/v1/notifications/study-status\",\n  \"workspace_id\": \"63722982f9cc073ecc730f6b\"\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
require 'uri'
require 'net/http'

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

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  \"event_type\": \"study.status.change\",\n  \"target_url\": \"https://hooks.myresearchapp.com/api/v1/notifications/study-status\",\n  \"workspace_id\": \"63722982f9cc073ecc730f6b\"\n}"

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/hooks/subscriptions/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"event_type\": \"study.status.change\",\n  \"target_url\": \"https://hooks.myresearchapp.com/api/v1/notifications/study-status\",\n  \"workspace_id\": \"63722982f9cc073ecc730f6b\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/hooks/subscriptions/', [
  'body' => '{
  "event_type": "study.status.change",
  "target_url": "https://hooks.myresearchapp.com/api/v1/notifications/study-status",
  "workspace_id": "63722982f9cc073ecc730f6b"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/hooks/subscriptions/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"event_type\": \"study.status.change\",\n  \"target_url\": \"https://hooks.myresearchapp.com/api/v1/notifications/study-status\",\n  \"workspace_id\": \"63722982f9cc073ecc730f6b\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "event_type": "study.status.change",
  "target_url": "https://hooks.myresearchapp.com/api/v1/notifications/study-status",
  "workspace_id": "63722982f9cc073ecc730f6b"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/hooks/subscriptions/")! 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()
```

If successful, the endpoint will return a response that includes:

* An `id` field in the body - This is the unique identifier for your subscription.
* An `X-Hook-Secret` header - Used to confirm your intention to subscribe to the desired event type.

Make a note of both the id and the X-Hook-Secret. We'll use these to confirm our intention to subscribe to the
desired event type.

#### Note

`target_url` must use `https://` and be publicly accessible.

#### Confirm the subscription

### Request

POST [https://api.prolific.com/api/v1/hooks/subscriptions/\{subscription\_id}/](https://api.prolific.com/api/v1/hooks/subscriptions/\{subscription_id}/)

```curl
curl -X POST https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/ \
     -H "Authorization: Token <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "secret": "a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef"
}'
```

```python
import requests

url = "https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/"

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

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

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"secret":"a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef"}'
};

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/hooks/subscriptions/subscription_id/"

	payload := strings.NewReader("{\n  \"secret\": \"a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef\"\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
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/")

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  \"secret\": \"a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef\"\n}"

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/hooks/subscriptions/subscription_id/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"secret\": \"a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/', [
  'body' => '{
  "secret": "a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwx1234567890abcdef"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/hooks/subscriptions/subscription_id/")! 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()
```

Replace `     <subscription_id>` with the value of the X-Hook-Secret header in the previous subscription request.

If subscription confirmation is successful, you should receive a `200` status code.

From here, whenever the specified event occurs, the target URL will be called. The data sent in the call will
depend on the event. See the complete [API reference](/api-reference/webhooks) here. This link includes tips on
idempotency and error handling.