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

# Send a message to multiple participants

POST https://api.prolific.com/api/v1/messages/bulk/
Content-Type: application/json

Send a message to multiple participants.

Reference: https://docs.prolific.com/api-reference/messages/bulk-message-participants

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

### Body (application/json)

This endpoint expects a SendBulkMessage.

- `ids` (list of string, required) — A list of participant ID's
- `body` (string, required) — Message Body. Text is sanitised for safe storage and display.
- `study_id` (string, required) — A study ID

## Response

### 204

The message has been sent

## Errors

### 400 Client Request Error

Error

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

## Types

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

**Request**

```json
{
  "ids": [
    "619e049f7648a4e1f8f3645b",
    "619e049f7648a4e1f8f3645c",
    "619e049f7648a4e1f8f3645d"
  ],
  "body": "Thanks for participating in my study",
  "study_id": "6569ece7ca177d19117b1b95"
}
```

**SDK Code**

```python
import requests

url = "https://api.prolific.com/api/v1/messages/bulk/"

payload = {
    "ids": ["619e049f7648a4e1f8f3645b", "619e049f7648a4e1f8f3645c", "619e049f7648a4e1f8f3645d"],
    "body": "Thanks for participating in my study",
    "study_id": "6569ece7ca177d19117b1b95"
}
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/messages/bulk/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"ids":["619e049f7648a4e1f8f3645b","619e049f7648a4e1f8f3645c","619e049f7648a4e1f8f3645d"],"body":"Thanks for participating in my study","study_id":"6569ece7ca177d19117b1b95"}'
};

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/messages/bulk/"

	payload := strings.NewReader("{\n  \"ids\": [\n    \"619e049f7648a4e1f8f3645b\",\n    \"619e049f7648a4e1f8f3645c\",\n    \"619e049f7648a4e1f8f3645d\"\n  ],\n  \"body\": \"Thanks for participating in my study\",\n  \"study_id\": \"6569ece7ca177d19117b1b95\"\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/messages/bulk/")

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  \"ids\": [\n    \"619e049f7648a4e1f8f3645b\",\n    \"619e049f7648a4e1f8f3645c\",\n    \"619e049f7648a4e1f8f3645d\"\n  ],\n  \"body\": \"Thanks for participating in my study\",\n  \"study_id\": \"6569ece7ca177d19117b1b95\"\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/messages/bulk/")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"ids\": [\n    \"619e049f7648a4e1f8f3645b\",\n    \"619e049f7648a4e1f8f3645c\",\n    \"619e049f7648a4e1f8f3645d\"\n  ],\n  \"body\": \"Thanks for participating in my study\",\n  \"study_id\": \"6569ece7ca177d19117b1b95\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/messages/bulk/', [
  'body' => '{
  "ids": [
    "619e049f7648a4e1f8f3645b",
    "619e049f7648a4e1f8f3645c",
    "619e049f7648a4e1f8f3645d"
  ],
  "body": "Thanks for participating in my study",
  "study_id": "6569ece7ca177d19117b1b95"
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/messages/bulk/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"ids\": [\n    \"619e049f7648a4e1f8f3645b\",\n    \"619e049f7648a4e1f8f3645c\",\n    \"619e049f7648a4e1f8f3645d\"\n  ],\n  \"body\": \"Thanks for participating in my study\",\n  \"study_id\": \"6569ece7ca177d19117b1b95\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "ids": ["619e049f7648a4e1f8f3645b", "619e049f7648a4e1f8f3645c", "619e049f7648a4e1f8f3645d"],
  "body": "Thanks for participating in my study",
  "study_id": "6569ece7ca177d19117b1b95"
] as [String : Any]

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

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