For the complete documentation index, see llms.txt. This page is also available as Markdown.

Ai Knowledge Sources

Lists all knowledge sources for a chatbot

get

Required Permission: chatbots.knowledge-source.list

Resource: chatbots/:chatbotId

Authorizations
x-chatcaptain-keystringRequired
Path parameters
chatbotIdstringRequired

The ID of the chatbot.

Query parameters
pageTokenstringOptional

The date after which to filter sources. Only sources created after this date will be fetched.

Example: 2025-09-29T07:08:00Z
limitnumberOptional

The limit for how many sources should be fetched.

excludeChildrenbooleanOptional

TODO

parentIdstringRequired
groupIdstringRequired
Responses
200

List of all knowledge sources.

application/json
errorstringOptional

Optional error message

pageTokenstringRequired

The date of the latest fetched source.

Example: 2025-09-29T07:08:00Z
get/v1/chatbots/{chatbotId}/ai/knowledge/sources
GET /v1/chatbots/{chatbotId}/ai/knowledge/sources?parentId=text&groupId=text HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Accept: */*
{
  "sources": [
    {
      "id": "bWDWW8q3ks31wQsc6xiD",
      "source": "https://www.example-company.com/faq",
      "groupIds": [
        "meEcrKgnNHuBqDFXc3Pv"
      ],
      "enabled": true,
      "isIndexing": false,
      "created": "2025-09-29T10:00:00Z",
      "type": 0,
      "status": 2,
      "name": "FAQ page",
      "errorReason": "Source not found.",
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      },
      "role": 2,
      "parentId": "bWDWW8q3ks31wQsc6xiD",
      "updated": "2025-09-29T12:00:00Z",
      "firecrawlJobData": {
        "jobId": "text",
        "jobStarted": "text",
        "pagesCrawled": 1,
        "creditsUsed": 1,
        "lastCrawlJobId": "text",
        "lastCrawlStatus": 0
      },
      "firecrawlCrawlOptions": {
        "maxDepth": 3,
        "limit": 50,
        "includePaths": [
          "/blog/*",
          "/docs/*"
        ],
        "excludePaths": [
          "/admin/*",
          "/private/*"
        ]
      },
      "pageChecksum": "abc123def456",
      "autoRecrawl": true
    }
  ],
  "error": "text",
  "pageToken": "2025-09-29T07:08:00Z"
}

Deletes a batch of knowledge sources.

delete

Required Permission: chatbots.knowledge-source.delete

Resource: chatbots/:chatbotId

Authorizations
x-chatcaptain-keystringRequired
Path parameters
chatbotIdstringRequired

The ID of the chatbot.

Body
sourceIdsstring[]Required

A list of deleted source Id's.

Example: 10ß443d31264etg
Responses
200

Deletion result.

application/json
errorstringOptional

Optional error message.

deletedbooleanRequired

Indicates whether the deletion succeeded.

Example: true
delete/v1/chatbots/{chatbotId}/ai/knowledge/sources
DELETE /v1/chatbots/{chatbotId}/ai/knowledge/sources HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "sourceIds": "10ß443d31264etg"
}
{
  "error": "text",
  "deleted": true
}

Retrieves a specific knowledge source

get

Required Permission: chatbots.knowledge-source.get

Resource: chatbots/:chatbotId

Authorizations
x-chatcaptain-keystringRequired
Path parameters
chatbotIdstringRequired

The ID of the chatbot.

sourceIdstringRequired

The ID of the knowledge source to retrieve.

Responses
200

Knowledge source details.

application/json
errorstringOptional

Optional error message

chunksContentstring[]Required

Content of the source split into chunks.

Example: ["Some Paragraph.","Another Paragraph"]
get/v1/chatbots/{chatbotId}/ai/knowledge/sources/{sourceId}
GET /v1/chatbots/{chatbotId}/ai/knowledge/sources/{sourceId} HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Accept: */*
{
  "source": {
    "id": "bWDWW8q3ks31wQsc6xiD",
    "source": "https://www.example-company.com/faq",
    "groupIds": [
      "meEcrKgnNHuBqDFXc3Pv"
    ],
    "enabled": true,
    "isIndexing": false,
    "created": "2025-09-29T10:00:00Z",
    "type": 0,
    "status": 2,
    "name": "FAQ page",
    "errorReason": "Source not found.",
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "role": 2,
    "parentId": "bWDWW8q3ks31wQsc6xiD",
    "updated": "2025-09-29T12:00:00Z",
    "firecrawlJobData": {
      "jobId": "text",
      "jobStarted": "text",
      "pagesCrawled": 1,
      "creditsUsed": 1,
      "lastCrawlJobId": "text",
      "lastCrawlStatus": 0
    },
    "firecrawlCrawlOptions": {
      "maxDepth": 3,
      "limit": 50,
      "includePaths": [
        "/blog/*",
        "/docs/*"
      ],
      "excludePaths": [
        "/admin/*",
        "/private/*"
      ]
    },
    "pageChecksum": "abc123def456",
    "autoRecrawl": true
  },
  "error": "text",
  "chunksContent": [
    "Some Paragraph.",
    "Another Paragraph"
  ]
}

Crawl a website URL to create knowledge sources.

post

Required Permission: chatbots.knowledge-source.create

Resource: chatbots/:chatbotId

Authorizations
x-chatcaptain-keystringRequired
Path parameters
chatbotIdstringRequired

The ID of the chatbot.

Example: botKq8BxZaJd2wZR9cxd1P
Body
urlstring · uriRequired

The URL to crawl.

Example: https://example.com
Responses
201

The crawl job was started successfully.

No content

post/v1/chatbots/{chatbotId}/ai/knowledge/sources/crawl
POST /v1/chatbots/{chatbotId}/ai/knowledge/sources/crawl HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 143

{
  "url": "https://example.com",
  "options": {
    "maxDepth": 3,
    "limit": 50,
    "includePaths": [
      "/blog/*",
      "/docs/*"
    ],
    "excludePaths": [
      "/admin/*",
      "/private/*"
    ]
  }
}
201

The crawl job was started successfully.

No content

Uploads knowledge source files.

post

Required Permission: chatbots.knowledge-source.create

Resource: chatbots/:chatbotId

Authorizations
x-chatcaptain-keystringRequired
Path parameters
chatbotIdstringRequired

The ID of the chatbot.

Body
filesstring · binary[]Required

Files to be uploaded as knowledge sources.

Responses
200

Upload result.

application/json
successbooleanOptional

Indicates whether the upload was successful.

Example: true
post/v1/chatbots/{chatbotId}/ai/knowledge/sources/upload
POST /v1/chatbots/{chatbotId}/ai/knowledge/sources/upload HTTP/1.1
Host: api.chatcaptain.com
x-chatcaptain-key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 20

{
  "files": [
    "binary"
  ]
}
{
  "success": true
}

Last updated