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

# Pause a Thread

> Changes the thread state to takeover and removes any scheduled follow-up date.

<Badge color="blue">POST</Badge> `https://api.revreply.com/v1/thread/pause`

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

## Try it

Use the following request to pause a thread:

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.revreply.com/v1/thread/pause" \
      -H "Authorization: Bearer <YOUR_JWT>" \
      -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"thread_id":"abc123xyz","reason":"Human salesperson will handle this conversation."}'
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const response = await fetch(
      "https://api.revreply.com/v1/thread/pause",
      {
        method: "POST",
        headers: {
          "Authorization": "Bearer <YOUR_JWT>",
          "Accept": "application/json",
          "Content-Type": "application/json"
        },
        body: JSON.stringify({
          thread_id: "abc123xyz",
          reason: "Human salesperson will handle this conversation."
        })
      }
    );
    const data = await response.json();
    console.log(data);
    ```
  </Tab>

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

    response = requests.post(
        "https://api.revreply.com/v1/thread/pause",
        headers={
            "Authorization": "Bearer <YOUR_JWT>",
            "Accept": "application/json",
            "Content-Type": "application/json",
        },
        json={
            "thread_id": "abc123xyz",
            "reason": "Human salesperson will handle this conversation.",
        },
    )
    data = response.json()
    print(data)
    ```
  </Tab>

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

    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_HTTPHEADER => [
            "Authorization: Bearer <YOUR_JWT>",
            "Accept: application/json",
            "Content-Type: application/json",
        ],
        CURLOPT_POSTFIELDS => json_encode([
            "thread_id" => "abc123xyz",
            "reason" => "Human salesperson will handle this conversation.",
        ]),
        CURLOPT_RETURNTRANSFER => true,
    ]);

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

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

    import (
        "bytes"
        "fmt"
        "net/http"
    )

    func main() {
        body := []byte(`{"thread_id":"abc123xyz","reason":"Human salesperson will handle this conversation."}`)

        req, _ := http.NewRequest(
            "POST",
            "https://api.revreply.com/v1/thread/pause",
            bytes.NewBuffer(body),
        )

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

### Body

The request body uses the `PauseThreadRequest` schema.

| Field       | Type             | Required | Description                                                    | Example                                            |
| ----------- | ---------------- | -------- | -------------------------------------------------------------- | -------------------------------------------------- |
| `thread_id` | `string`         | Yes      | Identifier of the thread to pause.                             | `abc123xyz`                                        |
| `reason`    | `string \| null` | No       | Reason for pausing the thread. Maximum length: 500 characters. | `Human salesperson will handle this conversation.` |

### Request structure

```json theme={null}
{
  "thread_id": "abc123xyz",
  "reason": "Human salesperson will handle this conversation."
}
```

### Request examples

The request is a `POST` request to:

```text theme={null}
https://api.revreply.com/v1/thread/pause
```

## Response

### Response structure

A successful request returns confirmation that the thread was paused, together with the thread ID, its new status, and the optional reason.

| Field            | Type             | Required | Description                                           |
| ---------------- | ---------------- | -------- | ----------------------------------------------------- |
| `success`        | `integer`        | Yes      | Indicates whether the thread was paused successfully. |
| `message`        | `string`         | Yes      | Message describing the result.                        |
| `data`           | `object`         | Yes      | Paused thread information.                            |
| `data.thread_id` | `string`         | Yes      | Identifier of the paused thread.                      |
| `data.status`    | `integer`        | Yes      | New thread status.                                    |
| `data.reason`    | `string \| null` | No       | Reason supplied when pausing the thread.              |

### Response example

```json theme={null}
{
  "success": 1,
  "message": "Thread paused successfully",
  "data": {
    "thread_id": "abc123xyz",
    "status": 4,
    "reason": "Human salesperson will handle this conversation."
  }
}
```

## Errors

### 404 — Thread not found

Returned when the specified thread cannot be found.

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

### 422 — Validation error

Returned when one or more required request fields fail validation.

```json theme={null}
{
  "success": 0,
  "message": "Validation failed",
  "errors": {}
}
```

### 500 — Failed to pause thread

Returned when the thread cannot be paused because of a server or processing failure.

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