> ## 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 Training Sources

> Manage AI training data sources.

## Get training sources

`GET /api/training/:siteId/sources`

Manage training data sources for the AI chatbot.

### Headers

**Cookie** `string` *required*

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

**siteId** `integer` *required*

Site ID.

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

```json Response theme={null}
{
  "success": true,
  "data": [
    {
      "id": 1,
      "siteId": 1,
      "type": "url",
      "source": "https://example.com/faq",
      "status": "processed",
      "chunksCount": 15,
      "createdAt": "2026-01-01T08:00:00Z"
    }
  ]
}
```

***

## Add URL source

`POST /api/training/:siteId/url`

**siteId** `integer` *required*

Site ID.

### Body parameters

**url** `string` *required*

URL to crawl.

**crawlPages** `boolean`

Whether to crawl linked pages.

**maxPages** `integer`

Maximum number of pages to crawl.

```json theme={null}
{
  "url": "https://example.com/faq",
  "crawlPages": true,
  "maxPages": 10
}
```

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/training/1/url \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/faq",
    "crawlPages": true,
    "maxPages": 10
  }'
```

***

## Upload document

`POST /api/training/:siteId/document`

**siteId** `integer` *required*

Site ID.

Accepts `multipart/form-data`. Supported formats: PDF, TXT, DOCX.

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

***

## Add text source

`POST /api/training/:siteId/text`

**siteId** `integer` *required*

Site ID.

### Body parameters

**title** `string` *required*

Title of the text content.

**content** `string` *required*

Text content.

```json theme={null}
{
  "title": "Return Policy",
  "content": "Our return policy allows returns within 30 days..."
}
```

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/training/1/text \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Return Policy",
    "content": "Our return policy allows returns within 30 days..."
  }'
```

***

## Sync knowledge base

`POST /api/training/:siteId/kb-sync`

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

***

## Delete training source

`DELETE /api/training/source/:sourceId`

**sourceId** `integer` *required*

Source ID.

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

***

## Reprocess source

`POST /api/training/source/:sourceId/reprocess`

**sourceId** `integer` *required*

Source ID.

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

***

## Get training stats

`GET /api/training/:siteId/stats`

**siteId** `integer` *required*

Site ID.

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

```json Response theme={null}
{
  "success": true,
  "data": {
    "totalSources": 5,
    "totalChunks": 120,
    "totalQaPairs": 30,
    "processingStatus": "completed"
  }
}
```

***

## Preview training data

`GET /api/training/:siteId/preview`

**siteId** `integer` *required*

Site ID.

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

***

## Test chat

`POST /api/training/:siteId/test-chat`

**siteId** `integer` *required*

Site ID.

### Body parameters

**message** `string` *required*

Chat message to test.

```json theme={null}
{
  "message": "What is your return policy?"
}
```

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/training/1/test-chat \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What is your return policy?"
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "answer": "Our return policy allows returns within 30 days of purchase...",
    "confidence": 0.92,
    "sources": [
      { "type": "text", "title": "Return Policy" }
    ]
  }
}
```


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