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

# Get the messages in a conversation

GET https://api.prolific.com/api/v1/conversations/{conversation_id}/messages/

Returns the messages in one conversation, oldest first, in the same shape as `GET /api/v1/messages`. The caller must be a member of the conversation. A conversation the caller is not a member of is reported as not found.

Results are paginated. Follow `next` for the following page, or stop when it is null.


Reference: https://docs.prolific.com/api-reference/messages/get-conversation-messages

## Authentication

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

## Request

### Path parameters

- `conversation_id` (string, required) — The conversation id, as returned by `GET /api/v1/conversations` or as `channel_id` on a message.

### Query parameters

- `workspace_id` (string, optional) — Read the conversation as this workspace. The caller must belong to the workspace.
- `limit` (integer, optional) — Page size. Defaults to 25, capped at 100.
- `cursor` (string, optional) — Opaque token from a previous response's `next` link.

## Response

### 200

A page of messages

- `next` (string, required, nullable) — URL of the next page, or null on the last page.
- `results` (list of object, required)
  - `id` (string, required) — Unique ID of the message
  - `sender_id` (string, required) — Id of the user who sent the message
  - `body` (string, required) — Body of the message.
  - `sent_at` (datetime, required) — Date time when message was sent
  - `channel_id` (string, required) — The channel ID, for linking back to a thread in the Prolific app.
  - `type` (string, optional) — Will only me message for now
  - `data` (object, optional) — Metadata for a message
    - `study_id` (string, optional) — What study the message relates to. In case this is not automatically filled for the participant, they can choose which study their message relates to.
    - `category` (enum, optional) — Participants can self-categorise their message before sending it.
      - Allowed values: `payment-timing`, `payment-issues`, `technical-issues`, `feedback`, `rejections`, `other`

## Errors

### 404 Not Found Error

No conversation with this id, or the caller is not a member of it. The API does not distinguish the two.

- `status` (integer, required) — Status code as in the http standards
- `error_code` (integer, required) — Internal error code
- `title` (string, required) — Error title
- `detail` (string or list of string or object, required) — Error detail
  - object
    - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

### 503 Service Unavailable Error

Message service temporarily unavailable

- `status` (integer, required) — Status code as in the http standards
- `error_code` (integer, required) — Internal error code
- `title` (string, required) — Error title
- `detail` (string or list of string or object, required) — Error detail
  - object
    - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

### 504 Gateway Timeout Error

Message query timed out

- `status` (integer, required) — Status code as in the http standards
- `error_code` (integer, required) — Internal error code
- `title` (string, required) — Error title
- `detail` (string or list of string or object, required) — Error detail
  - object
    - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

### 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` (string or list of string or object, required) — Error detail
  - object
    - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

## Examples

**Response**

```json
{
  "next": "string",
  "results": [
    {
      "id": "5f8d0c3e4b2a1c0012345678",
      "sender_id": "string",
      "body": "string",
      "sent_at": "2024-01-15T09:30:00Z",
      "channel_id": "d45c8a5e812ff990fc6546beaf888c9820f4c184f7200a45d900cf0f321f7f38",
      "type": "string",
      "data": {
        "study_id": "620ca2735fcbba4fa2b3211a",
        "category": "feedback"
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

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

	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/conversations/conversation_id/messages/")

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

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

```csharp
using RestSharp;

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