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

# Unipile: List Chats

> List chats/conversations for a connected account. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

List chats/conversations for a connected account.

> [!NOTE]
>
> Tool ID: `unipile_list_chats`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'unipile_list_chats',
  {
    "account_id": "123456789"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute unipile_list_chats --input '{
  "account_id": "123456789"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "items": [
      {
        "object": "Chat",
        "id": "id_123",
        "account_id": "123456789"
      }
    ],
    "cursor": "cursor_123",
    "object": "ChatList"
  }
}
```

Use `deepline describe unipile_list_chats --json` for the latest machine-readable contract.

## Input reference

Retrieve chats for a connected account

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.account_id` | `string` | Yes | — | Account ID |
| `payload.account_type` | `"WHATSAPP" \| "LINKEDIN" \| "SLACK" \| "TWITTER" \| "MESSENGER" \| "INSTAGRAM" \| "TELEGRAM"` | No | — | Only chats from this channel. Allowed: `WHATSAPP`, `LINKEDIN`, `SLACK`, `TWITTER`, `MESSENGER`, `INSTAGRAM`, `TELEGRAM`. |
| `payload.unread` | `boolean` | No | — | Only unread (true) or read (false) chats. |
| `payload.before` | `string` | No | — | Only items created before this ISO 8601 UTC datetime. Format: `date-time`. |
| `payload.after` | `string` | No | — | Only items created after this ISO 8601 UTC datetime. Format: `date-time`. |
| `payload.limit` | `integer` | No | — | Page size, 1-250. Minimum: 1. Maximum: 250. |
| `payload.cursor` | `string` | No | — | Cursor from the previous page. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Retrieve chats for a connected account",
    "properties": {
      "account_id": {
        "type": "string",
        "description": "Account ID"
      },
      "account_type": {
        "type": "string",
        "description": "Only chats from this channel.",
        "enum": [
          "WHATSAPP",
          "LINKEDIN",
          "SLACK",
          "TWITTER",
          "MESSENGER",
          "INSTAGRAM",
          "TELEGRAM"
        ]
      },
      "unread": {
        "type": "boolean",
        "description": "Only unread (true) or read (false) chats."
      },
      "before": {
        "type": "string",
        "description": "Only items created before this ISO 8601 UTC datetime.",
        "format": "date-time"
      },
      "after": {
        "type": "string",
        "description": "Only items created after this ISO 8601 UTC datetime.",
        "format": "date-time"
      },
      "limit": {
        "type": "integer",
        "description": "Page size, 1-250.",
        "minimum": 1,
        "maximum": 250
      },
      "cursor": {
        "type": "string",
        "description": "Cursor from the previous page."
      }
    },
    "required": [
      "account_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.items` | `array` | No | — | — |
| `result.data.items[].object` | `"Chat"` | No | — | Allowed: `Chat`. |
| `result.data.items[].id` | `string` | No | — | Unipile chat ID |
| `result.data.items[].account_id` | `string` | No | — | Account this chat belongs to |
| `result.data.items[].account_type` | `string` | No | — | Channel of the account, e.g. LINKEDIN or WHATSAPP |
| `result.data.items[].provider_id` | `string` | No | — | — |
| `result.data.items[].attendee_provider_id` | `string` | No | — | Provider ID of the other person in a 1:1 chat |
| `result.data.items[].name` | `string \| null` | No | — | — |
| `result.data.items[].type` | `unknown` | No | — | Chat kind (1:1, group, or channel) as Unipile reports it |
| `result.data.items[].timestamp` | `string \| null` | No | — | Format: `date-time`. |
| `result.data.items[].unread_count` | `integer` | No | — | — |
| `result.data.items[].subject` | `string \| null` | No | — | — |
| `result.data.cursor` | `string \| null` | No | — | Next page cursor, null if no more results |
| `result.data.object` | `"ChatList"` | No | — | Allowed: `ChatList`. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "enum": [
                    "Chat"
                  ]
                },
                "id": {
                  "type": "string",
                  "description": "Unipile chat ID"
                },
                "account_id": {
                  "type": "string",
                  "description": "Account this chat belongs to"
                },
                "account_type": {
                  "type": "string",
                  "description": "Channel of the account, e.g. LINKEDIN or WHATSAPP"
                },
                "provider_id": {
                  "type": "string"
                },
                "attendee_provider_id": {
                  "type": "string",
                  "description": "Provider ID of the other person in a 1:1 chat"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "type": {
                  "description": "Chat kind (1:1, group, or channel) as Unipile reports it"
                },
                "timestamp": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "unread_count": {
                  "type": "integer"
                },
                "subject": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Next page cursor, null if no more results"
          },
          "object": {
            "type": "string",
            "enum": [
              "ChatList"
            ]
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Unipile provider guide](/docs/providers/unipile/guide.md)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart.md)
* [SDK reference](/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.