Skip to main content
POST
/
knowledge-base
/
sources
Create KB Source
curl --request POST \
  --url https://api.attention.tech/v2/knowledge-base/sources \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Q4 Product Launch Playbook",
  "content": "# Product Launch Playbook\n\n## Overview\nThis document covers the key steps for launching our Q4 product line.\n\n## Timeline\n- Week 1: Internal enablement\n- Week 2: Beta launch\n- Week 3: GA release",
  "format": "text/markdown"
}
'
{
  "data": {
    "type": "kb_sources",
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "attributes": {
      "title": "Q4 Product Launch Playbook",
      "source_type": "manual",
      "content": "# Product Launch Playbook\n\n## Overview\nThis document covers the key steps...",
      "format": "text/markdown",
      "status": "indexed",
      "file_size": 4096,
      "chunk_count": 12,
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:35:00Z"
    }
  }
}

Authorizations

Authorization
string
header
required

Body

title
string
required

Title of the KB source

Maximum string length: 500
content
string

Content of the source (required for manual entries)

Maximum string length: 524288
format
enum<string>
default:text/markdown

Content format (defaults to text/markdown). For PDF files, use the upload endpoint instead.

Available options:
text/markdown,
text/html,
text/plain

Response

KB source created successfully

data
object
Example:
{
"type": "kb_sources",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"title": "Q4 Product Launch Playbook",
"source_type": "manual",
"format": "text/markdown",
"status": "indexed",
"file_size": 4096,
"chunk_count": 12,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:35:00Z"
}
}