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

# Resolve & Close

> Mark a conversation as resolved or closed.

## Overview

PingBack provides three status-transition endpoints for conversations:

* **Resolve** — marks a conversation as resolved and records the `resolved_at` timestamp.
* **Close** — marks a conversation as closed and records the `closed_at` timestamp.
* **Assign** — reassigns a conversation to a different agent.

These are separate `PUT` operations so you can model your support workflow precisely.

***

## Resolve a conversation

Sets the conversation's `status` to `"resolved"` and records `resolved_at`.

**Method**: `PUT`
**URL**: `/api/v1/conversations/{conversation_id}/resolve`

### Headers

| Header        | Value          |
| ------------- | -------------- |
| Authorization | Bearer {token} |

### Path parameters

<ParamField path="conversation_id" type="string (UUID)" required>
  The UUID of the conversation to resolve.
</ParamField>

No request body is required.

### Response

<ResponseField name="resolved_at" type="string (ISO 8601)">
  Timestamp when the conversation was resolved.
</ResponseField>

<Note>
  If the conversation is already resolved, the endpoint returns `{"detail": "Already resolved"}` with a `200` status.
</Note>

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X PUT https://api.pingback.live/api/v1/conversations/c3d4e5f6-a7b8-9012-cdef-123456789012/resolve \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const conversationId = 'c3d4e5f6-a7b8-9012-cdef-123456789012';
  const response = await fetch(
    `https://api.pingback.live/api/v1/conversations/${conversationId}/resolve`,
    {
      method: 'PUT',
      headers: {
        'Authorization': `Bearer ${token}`,
      },
    }
  );
  const data = await response.json();
  ```
</CodeGroup>

### Response example

```json theme={null}
{
  "resolved_at": "2024-03-01T10:30:00Z"
}
```

***

## Close a conversation

Sets the conversation's `status` to `"closed"` and records `closed_at`.

**Method**: `PUT`
**URL**: `/api/v1/conversations/{conversation_id}/close`

### Headers

| Header        | Value          |
| ------------- | -------------- |
| Authorization | Bearer {token} |

### Path parameters

<ParamField path="conversation_id" type="string (UUID)" required>
  The UUID of the conversation to close.
</ParamField>

No request body is required.

### Response

<ResponseField name="closed_at" type="string (ISO 8601)">
  Timestamp when the conversation was closed.
</ResponseField>

<Note>
  If the conversation is already closed, the endpoint returns `{"detail": "Already closed"}` with a `200` status.
</Note>

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X PUT https://api.pingback.live/api/v1/conversations/c3d4e5f6-a7b8-9012-cdef-123456789012/close \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const conversationId = 'c3d4e5f6-a7b8-9012-cdef-123456789012';
  const response = await fetch(
    `https://api.pingback.live/api/v1/conversations/${conversationId}/close`,
    {
      method: 'PUT',
      headers: {
        'Authorization': `Bearer ${token}`,
      },
    }
  );
  const data = await response.json();
  ```
</CodeGroup>

### Response example

```json theme={null}
{
  "closed_at": "2024-03-01T11:00:00Z"
}
```

***

## Assign a conversation

Reassigns a conversation to a different agent.

**Method**: `PUT`
**URL**: `/api/v1/conversations/{conversation_id}/assign/{agent_id}`

### Headers

| Header        | Value          |
| ------------- | -------------- |
| Authorization | Bearer {token} |

### Path parameters

<ParamField path="conversation_id" type="string (UUID)" required>
  The UUID of the conversation to reassign.
</ParamField>

<ParamField path="agent_id" type="integer" required>
  The ID of the agent to assign the conversation to.
</ParamField>

No request body is required.

### Response

<ResponseField name="assignee_id" type="integer">
  The ID of the newly assigned agent.
</ResponseField>

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X PUT https://api.pingback.live/api/v1/conversations/c3d4e5f6-a7b8-9012-cdef-123456789012/assign/5 \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const conversationId = 'c3d4e5f6-a7b8-9012-cdef-123456789012';
  const agentId = 5;
  const response = await fetch(
    `https://api.pingback.live/api/v1/conversations/${conversationId}/assign/${agentId}`,
    {
      method: 'PUT',
      headers: {
        'Authorization': `Bearer ${token}`,
      },
    }
  );
  const data = await response.json();
  ```
</CodeGroup>

### Response example

```json theme={null}
{
  "assignee_id": 5
}
```

***

## Errors

| Status | Meaning                                        |
| ------ | ---------------------------------------------- |
| 401    | Unauthorized — missing or invalid Bearer token |
| 404    | Conversation not found                         |
