> ## 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 Sites & Widget

> Manage chat widget sites and configuration.

## List sites

`GET /api/sites`

Manage embeddable chat widget sites.

### Headers

**Cookie** `string` *required*

Session cookie (login via POST /api/auth/login)

```bash cURL theme={null}
curl https://zeplo.ai/api/sites \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw"
```

```json Response theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Main Website",
      "url": "https://example.com",
      "widgetColor": "#16A34A",
      "welcomeMessage": "Hi! How can we help?",
      "position": "bottom-right",
      "isActive": true,
      "createdAt": "2026-01-01T08:00:00Z"
    }
  ]
}
```

***

## Create site

`POST /api/sites`

### Body parameters

**name** `string` *required*

Site name.

**url** `string` *required*

Site URL.

**widgetColor** `string`

Widget accent color (hex).

**welcomeMessage** `string`

Initial chat greeting.

**position** `string`

Widget position on the page.

**isActive** `boolean`

Whether the widget is active.

```json theme={null}
{
  "name": "Main Website",
  "url": "https://example.com",
  "widgetColor": "#16A34A",
  "welcomeMessage": "Hi! How can we help?",
  "position": "bottom-right",
  "isActive": true
}
```

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/sites \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Main Website",
    "url": "https://example.com",
    "widgetColor": "#16A34A",
    "welcomeMessage": "Hi! How can we help?",
    "position": "bottom-right",
    "isActive": true
  }'
```

***

## Update site

`PATCH /api/sites/:id`

**id** `integer` *required*

Site ID.

```bash cURL theme={null}
curl -X PATCH https://zeplo.ai/api/sites/1 \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "widgetColor": "#FF5500",
    "welcomeMessage": "Hello! How can we assist?"
  }'
```

***

## Create or update site

`POST /api/sites/create_or_update`

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/sites/create_or_update \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Main Website",
    "url": "https://example.com"
  }'
```

***

## Upload widget logo

`POST /api/widget/upload-logo`

Accepts `multipart/form-data`.

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/widget/upload-logo \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -F "file=@logo.png"
```

***

## Widget public endpoints

| Endpoint | Method | Description |
| - | - | - |
| `/api/widget/config/:siteId` | GET | Get widget configuration |
| `/api/widget/kb/:siteId` | GET | Get knowledge base |
| `/api/widget/qa/:siteId` | GET | Get Q\&A pairs |
| `/api/widget/article/:articleId` | GET | Get single article |
| `/api/widget/contacts` | POST | Save widget contact |
| `/api/widget/chat` | POST | Send chat message |
| `/api/widget/conversation/:conversationId` | GET | Get conversation |
| `/api/widget/request-agent` | POST | Request human agent |

### Widget embed code

```html theme={null}
<script src="https://zeplo.ai/widget.js" data-site-id="1" defer></script>
```


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