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

# List Chats

> Lists all chat sessions for a specific resource (workflow, agent, etc.).

Lists all chat sessions for a specific resource (workflow, agent, etc.).

## Usage

<CodeGroup>
  ```bash cURL theme={null}
  curl https://app.splox.io/api/v1/chats/api/019c3221-29d7-70e1-aa1e-dee02589289b \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={null}
  from splox import SploxClient

  client = SploxClient(api_key="YOUR_API_KEY")
  result = client.chats.list_for_resource("api", "RESOURCE_ID")
  for chat in result.chats:
      print(chat.id, chat.name)
  ```

  ```typescript Node.js theme={null}
  import Splox from "splox";

  const client = new Splox("YOUR_API_KEY");
  const { chats } = await client.chats.listForResource("api", "RESOURCE_ID");
  for (const chat of chats) {
    console.log(chat.id, chat.name);
  }
  ```

  ```go Go theme={null}
  client := splox.NewClient("YOUR_API_KEY")
  result, err := client.Chats.ListForResource(ctx, "api", "RESOURCE_ID")
  for _, chat := range result.Chats {
      fmt.Println(chat.ID, chat.Name)
  }
  ```
</CodeGroup>

## Path Parameters

| Parameter      | Type          | Description                                      |
| -------------- | ------------- | ------------------------------------------------ |
| `resourceType` | string        | Resource type: `api`, `workflow`, `agent`, `gui` |
| `resourceId`   | string (uuid) | The resource ID (e.g., workflow ID)              |

## Response

```json theme={null}
{
  "chats": [
    {
      "id": "0199f200-a11b-7c8d-4444-888890abcdef",
      "name": "My Chat Session",
      "user_id": "0199d001-c45d-9e0f-3456-789012cdef01",
      "resource_type": "api",
      "resource_id": "019c3221-29d7-70e1-aa1e-dee02589289b",
      "is_public": false,
      "created_at": "2025-10-22T10:00:00Z",
      "updated_at": "2025-10-22T10:00:00Z"
    }
  ]
}
```

## Notes

<Info>
  **Authentication required.** For `agent` resource type, only the authenticated user's chats are returned. For other types, all chats for the resource are returned.
</Info>


## OpenAPI

````yaml GET /chats/{resourceType}/{resourceId}
openapi: 3.1.0
info:
  title: Splox API
  description: >-
    Run workflows, manage chats, receive events, and monitor execution via the
    Splox API
  version: 1.0.0
  contact:
    name: Splox Support
    email: support@splox.io
    url: https://community.splox.io
servers:
  - url: https://app.splox.io/api/v1
    description: Production API
security: []
tags:
  - name: MCP
    description: Discover MCP servers, manage connections, and execute MCP tools
  - name: Workflows
    description: List, get, and inspect workflows, versions, and nodes
  - name: Workflow Requests
    description: Run workflows, monitor execution, and retrieve results
  - name: Events
    description: Receive external events via Event Hub webhooks
  - name: Chats
    description: Manage chat sessions for workflow interactions
paths:
  /chats/{resourceType}/{resourceId}:
    get:
      tags:
        - Chats
      summary: List Chats for Resource
      description: Lists all chat sessions for a specific resource (workflow, agent, etc.).
      operationId: listChats
      parameters:
        - name: resourceType
          in: path
          required: true
          description: Resource type
          schema:
            type: string
            enum:
              - api
              - workflow
              - agent
              - gui
        - name: resourceId
          in: path
          required: true
          description: Resource ID (e.g., workflow ID)
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Chats retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  chats:
                    type: array
                    items:
                      $ref: '#/components/schemas/Chat'
      security:
        - bearerAuth: []
components:
  schemas:
    Chat:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        user_id:
          type: string
          format: uuid
        resource_type:
          type: string
          enum:
            - api
            - workflow
            - agent
            - gui
        resource_id:
          type: string
        is_public:
          type: boolean
        public_share_token:
          type: string
          nullable: true
        metadata:
          type: object
          additionalProperties: true
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token generated from your Splox account settings. Create tokens at
        https://app.splox.io/account?tab=settings

````