# List Chat Widgets

GET https://services.leadconnectorhq.com/chat-widget/list

Retrieves a list of chat widgets for a specific location

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `chat-widget.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | The location ID |
| `offset` | string | Yes | Row offset. Defaults to 0, capped at 10000. |
| `limit` | string | Yes | Page size. Must be greater than 0, capped at 100. |
| `chatType` | string | No | The type of chat widget. Supports normal ChatType values, plus the virtual umbrella "webChat" (maps to facebookChat/emailChat/instagramChat/waChat). |
| `excludeChatType` | string | No | The type of chat widget |
| `voiceAiAgentId` | string | No | The voice AI agent ID |
| `creationSource` | string | No | The source that created the widget |
| `excludeCreationSource` | string | No | Exclude widgets with this creation source |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/chat-widget/list": {
      "get": {
        "summary": "List Chat Widgets",
        "operationId": "listChatWidgets",
        "description": "Retrieves a list of chat widgets for a specific location",
        "parameters": [
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "The location ID",
            "schema": {
              "example": "ve9EPM428h8vShlRWsss",
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": true,
            "in": "query",
            "description": "Row offset. Defaults to 0, capped at 10000.",
            "schema": {
              "type": "string",
              "example": "0",
              "description": "Row offset. Defaults to 0, capped at 10000."
            }
          },
          {
            "name": "limit",
            "required": true,
            "in": "query",
            "description": "Page size. Must be greater than 0, capped at 100.",
            "schema": {
              "type": "string",
              "example": "10",
              "description": "Page size. Must be greater than 0, capped at 100."
            }
          },
          {
            "name": "chatType",
            "required": false,
            "in": "query",
            "description": "The type of chat widget. Supports normal ChatType values, plus the virtual umbrella \"webChat\" (maps to facebookChat/emailChat/instagramChat/waChat).",
            "schema": {
              "example": "emailChat",
              "enum": [
                "liveChat",
                "waChat",
                "emailChat",
                "allInOneChat",
                "voiceAiChat",
                "facebookChat",
                "instagramChat",
                "webChat"
              ],
              "type": "string"
            }
          },
          {
            "name": "excludeChatType",
            "required": false,
            "in": "query",
            "description": "The type of chat widget",
            "schema": {
              "example": "voiceAiChat",
              "enum": [
                "liveChat",
                "waChat",
                "emailChat",
                "allInOneChat",
                "voiceAiChat",
                "facebookChat",
                "instagramChat"
              ],
              "type": "string"
            }
          },
          {
            "name": "voiceAiAgentId",
            "required": false,
            "in": "query",
            "description": "The voice AI agent ID",
            "schema": {
              "example": "66597c9a41106ba6eb4eac3c",
              "type": "string"
            }
          },
          {
            "name": "creationSource",
            "required": false,
            "in": "query",
            "description": "The source that created the widget",
            "schema": {
              "example": "chat-widget",
              "enum": [
                "chat-widget",
                "a2pCompliance",
                "public-api",
                "snapshot"
              ],
              "type": "string"
            }
          },
          {
            "name": "excludeCreationSource",
            "required": false,
            "in": "query",
            "description": "Exclude widgets with this creation source",
            "schema": {
              "example": "a2pCompliance",
              "enum": [
                "chat-widget",
                "a2pCompliance",
                "public-api",
                "snapshot"
              ],
              "type": "string"
            }
          },
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatWidgetListResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO-2"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO-2"
                }
              }
            }
          },
          "403": {
            "description": "The token does not have access to this location",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidLocationDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO-2"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access": [
              "chat-widget.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ChatWidgetListResponseDTO": {
        "type": "object",
        "properties": {
          "chatWidgets": {
            "description": "Matching chat widgets for this page",
            "example": [
              {
                "_id": "ve9EPM428h8vShlRWsss",
                "name": "Chat Widget 1",
                "chatType": "emailChat",
                "default": false,
                "creationSource": "chat-widget",
                "settings": {
                  "legalMsg": "By submitting you agree to our terms.",
                  "advanceSettings": {}
                },
                "createdAt": "2026-08-14T02:37:09.128Z",
                "updatedAt": "2026-08-18T07:21:26.939Z"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Chat widget ID",
                  "example": "ve9EPM428h8vShlRWsss"
                },
                "name": {
                  "type": "string",
                  "description": "Widget name",
                  "example": "Chat Widget 1"
                },
                "chatType": {
                  "type": "string",
                  "description": "Chat Type. Reads are not restricted to the public-API write allow-list, so any stored chat type can be returned here.",
                  "example": "emailChat",
                  "enum": [
                    "liveChat",
                    "waChat",
                    "emailChat",
                    "allInOneChat",
                    "voiceAiChat",
                    "facebookChat",
                    "instagramChat"
                  ]
                },
                "default": {
                  "type": "boolean",
                  "description": "Whether this is the default widget for the location",
                  "example": false
                },
                "creationSource": {
                  "type": "string",
                  "description": "How the widget was created",
                  "example": "chat-widget",
                  "enum": [
                    "chat-widget",
                    "a2pCompliance",
                    "public-api",
                    "snapshot"
                  ]
                },
                "settings": {
                  "type": "object",
                  "description": "Projected subset of settings returned for list rows",
                  "example": {
                    "legalMsg": "By submitting you agree to our terms.",
                    "advanceSettings": {
                      "voiceAiAgent": null,
                      "fbPage": null,
                      "instagramPage": null
                    }
                  }
                },
                "createdAt": {
                  "type": "string",
                  "description": "Creation timestamp (ISO 8601)",
                  "example": "2026-08-17T09:24:11.123Z"
                },
                "updatedAt": {
                  "type": "string",
                  "description": "Last update timestamp (ISO 8601)",
                  "example": "2026-08-17T09:24:11.123Z"
                }
              },
              "required": [
                "_id",
                "name",
                "chatType",
                "default",
                "createdAt",
                "updatedAt"
              ],
              "title": "ChatWidgetListItemDTO"
            }
          },
          "totalCount": {
            "type": "number",
            "description": "Total widgets matching the filters, ignoring limit and offset",
            "example": 42
          }
        },
        "required": [
          "chatWidgets",
          "totalCount"
        ],
        "title": "ChatWidgetListResponseDTO"
      },
      "BadRequestDTO-2": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO-2"
      },
      "UnauthorizedDTO-2": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO-2"
      },
      "InvalidLocationDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for invalid location access",
            "example": 403
          },
          "message": {
            "type": "string",
            "description": "Error message describing the location access failure",
            "example": "The token does not have access to this location"
          }
        },
        "title": "InvalidLocationDTO"
      },
      "UnprocessableDTO-2": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO-2"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/chat-widget/list"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

params = {
    "locationId": "<LOCATIONID>",
    "offset": "<OFFSET>",
    "limit": "<LIMIT>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/chat-widget/list?locationId=<LOCATIONID>&offset=<OFFSET>&limit=<LIMIT>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
