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

# Update Status

> Set your agent availability status.

Updates the current user's agent availability status. This lets customers and teammates know whether you are available to handle conversations.

**Method**: `PATCH`  **URL**: `/api/v1/team/status`

<Note>
  Status changes are broadcast in real time to all agents in your business via Socket.IO on the `agent_status_changed` event. Other agents' dashboards update immediately without requiring a page refresh.
</Note>

### Headers

| Header        | Value            |
| ------------- | ---------------- |
| Authorization | Bearer {token}   |
| Content-Type  | application/json |

### Body

<ParamField body="status" type="string" required>
  Your new availability status. Must be one of:

  * `live` — you are online and available for conversations
  * `away` — you are online but temporarily unavailable
  * `offline` — you are not available
</ParamField>

### Response

<ResponseField name="status" type="string" required>
  The status value that was saved.
</ResponseField>

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl --request PATCH \
    --url https://api.pingback.live/api/v1/team/status \
    --header 'Authorization: Bearer {token}' \
    --header 'Content-Type: application/json' \
    --data '{ "status": "live" }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.pingback.live/api/v1/team/status', {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer {token}',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ status: 'live' })
  });

  const result = await response.json();
  ```
</CodeGroup>

### Response example

```json theme={null}
{ "status": "live" }
```

***

## Get pending handoffs

**Method**: `GET`  **URL**: `/api/v1/team/pending-handoffs`

Returns all conversations that have been flagged for human handoff by the Theo AI agent. Use this endpoint to build a handoff queue in your dashboard or trigger alerts for your team.

### Headers

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

### Response

The endpoint returns an array of conversation objects awaiting human attention.

<ResponseField name="id" type="string" required>
  UUID of the conversation.
</ResponseField>

<ResponseField name="customer_id" type="string">
  UUID of the customer who initiated the conversation.
</ResponseField>

<ResponseField name="handoff_reason" type="string">
  The reason the AI flagged this conversation for human handoff (e.g., `"complex_issue"`, `"user_requested"`).
</ResponseField>

<ResponseField name="status" type="string" required>
  Current status of the conversation. One of: `open`, `pending`, `closed`.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  ISO 8601 timestamp of when the conversation was created.
</ResponseField>

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl --request GET \
    --url https://api.pingback.live/api/v1/team/pending-handoffs \
    --header 'Authorization: Bearer {token}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.pingback.live/api/v1/team/pending-handoffs',
    {
      method: 'GET',
      headers: { 'Authorization': 'Bearer {token}' }
    }
  );

  const handoffs = await response.json();
  ```
</CodeGroup>

### Response example

```json theme={null}
[
  {
    "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "customer_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "handoff_reason": "User requested to speak with a human",
    "status": "open",
    "created_at": "2024-01-20T14:05:00Z"
  }
]
```

### Errors

| Status | Meaning                                                    |
| ------ | ---------------------------------------------------------- |
| 400    | Invalid status value or user does not belong to a business |
| 401    | Unauthorized — missing or invalid token                    |
| 404    | Not a valid team member                                    |
