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

# GET Widget Chat

> Chat widget public API endpoints.

## Send chat message

`POST /api/widget/chat`

Public API endpoints for the embeddable chat widget.

> [!NOTE]
>
> These endpoints do not require authentication. They are designed for use by the JavaScript widget on your website.

### Body parameters

**siteId** `integer` *required*

Site ID.

**conversationId** `string`

Existing conversation ID, or `null` to start a new conversation.

**message** `string` *required*

Chat message from the visitor.

**contactInfo** `object`

Visitor contact information (name, email, phone).

```json theme={null}
{
  "siteId": 1,
  "conversationId": null,
  "message": "Hello, I need help",
  "contactInfo": {
    "name": "Website Visitor",
    "email": "visitor@example.com",
    "phone": "919876543210"
  }
}
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "conversationId": "conv_widget_123",
    "response": "Hi! How can we help you today?",
    "isAiResponse": true,
    "agentRequested": false
  }
}
```

***

## Request human agent

`POST /api/widget/request-agent`

### Body parameters

**conversationId** `string` *required*

Conversation ID to escalate.

**reason** `string`

Reason for requesting a human agent.

```json theme={null}
{
  "conversationId": "conv_widget_123",
  "reason": "Need to speak with a real person"
}
```

***

## Get conversation history

`GET /api/widget/conversation/:conversationId`

**conversationId** `string` *required*

Conversation ID.

***

## Save contact from widget

`POST /api/widget/contacts`

### Body parameters

**siteId** `integer` *required*

Site ID.

**name** `string`

Visitor name.

**email** `string`

Visitor email.

**phone** `string`

Visitor phone number.

```json theme={null}
{
  "siteId": 1,
  "name": "John Visitor",
  "email": "john@example.com",
  "phone": "919876543210"
}
```

***

## Get widget config

`GET /api/widget/config/:siteId`

**siteId** `integer` *required*

Site ID.

Returns widget appearance and behavior settings.

***

## Get knowledge base

`GET /api/widget/kb/:siteId`

**siteId** `integer` *required*

Site ID.

Returns knowledge base articles for the widget.

***

## Get Q\&A pairs

`GET /api/widget/qa/:siteId`

**siteId** `integer` *required*

Site ID.

Returns Q\&A pairs for the widget.

***

## Get article

`GET /api/widget/article/:articleId`

**articleId** `integer` *required*

Article ID.

Returns a single knowledge base article.


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