> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revreply.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Latest Threads

> Returns the latest threads.

<Badge color="green">GET</Badge> `https://api.revreply.com/v1/threads/latest`

<Note>
  This endpoint requires authentication.
</Note>

## Try it

Use the following request to retrieve the latest threads:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X GET "https://api.revreply.com/v1/threads/latest" \
      -H "Authorization: Bearer <YOUR_JWT>" \
      -H "Accept: application/json" \
      -H "Content-Type: application/json"
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const response = await fetch(
      "https://api.revreply.com/v1/threads/latest",
      {
        method: "GET",
        headers: {
          "Authorization": "Bearer <YOUR_JWT>",
          "Accept": "application/json",
          "Content-Type": "application/json"
        }
      }
    );
    const data = await response.json();
    console.log(data);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.get(
        "https://api.revreply.com/v1/threads/latest",
        headers={
            "Authorization": "Bearer <YOUR_JWT>",
            "Accept": "application/json",
            "Content-Type": "application/json",
        },
    )
    data = response.json()
    print(data)
    ```
  </Tab>

  <Tab title="PHP">
    ```php theme={null}
    <?php
    $ch = curl_init("https://api.revreply.com/v1/threads/latest");

    curl_setopt_array($ch, [
        CURLOPT_HTTPGET => true,
        CURLOPT_HTTPHEADER => [
            "Authorization: Bearer <YOUR_JWT>",
            "Accept: application/json",
            "Content-Type: application/json",
        ],
        CURLOPT_RETURNTRANSFER => true,
    ]);

    $response = curl_exec($ch);
    curl_close($ch);
    echo $response;
    ?>
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={null}
    package main

    import (
        "fmt"
        "net/http"
    )

    func main() {
        req, _ := http.NewRequest(
            "GET",
            "https://api.revreply.com/v1/threads/latest",
            nil,
        )

        req.Header.Set("Authorization", "Bearer <YOUR_JWT>")
        req.Header.Set("Accept", "application/json")
        req.Header.Set("Content-Type", "application/json")

        client := &http.Client{}
        response, _ := client.Do(req)
        fmt.Println(response.Status)
    }
    ```
  </Tab>
</Tabs>

## Authentication

This endpoint uses Bearer authentication with a JWT.

## Request

### Headers

| Header          | Type     | Required | Description                                                    |
| --------------- | -------- | -------- | -------------------------------------------------------------- |
| `Authorization` | `string` | Yes      | Bearer token used to authenticate the request.                 |
| `Accept`        | `string` | Yes      | Specifies that the client expects the response in JSON format. |
| `Content-Type`  | `string` | Yes      | Specifies that the request body is formatted as JSON.          |

```http theme={null}
Authorization: Bearer <YOUR_JWT>
Accept: application/json
Content-Type: application/json
```

### Request structure

This endpoint does not require a request body or query parameters.

### Request examples

The request is a `GET` request to:

```text theme={null}
https://api.revreply.com/v1/threads/latest
```

## Response

### Response structure

A successful request returns an array of the latest threads. Each thread contains an `id` and `name`.

| Field  | Type     | Required | Description                      |
| ------ | -------- | -------- | -------------------------------- |
| `id`   | `string` | Yes      | Unique identifier of the thread. |
| `name` | `string` | Yes      | Display name of the thread.      |

### Response example

```json theme={null}
[
  {
    "id": "abc123xyz",
    "name": "Re: Interested in your product - (prospect@example.com -> user@example.com)"
  },
  {
    "id": "def456uvw",
    "name": "Re: Product information - (another@example.com -> user@example.com)"
  }
]
```

## Errors

### 500 — Failed to retrieve threads

Returned when the latest threads cannot be retrieved because of a server or processing failure.

```json theme={null}
{
  "success": 0,
  "message": "Something went wrong"
}
```
