Skip to main content
GET
/
api
/
knowledge-bases
/
get-knowledge-base
/
{knowledgeBaseId}
curl -X GET "https://api.zudu.ai/api/knowledge-bases/get-knowledge-base/kb_abc123def456" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
{
  "message": "Knowledge base retrieved successfully",
  "status": "success",
  "error": null,
  "data": {
    "knowledge_base_id": "kb_abc123def456",
    "organization_id": "org_1234567890",
    "knowledge_base_name": "Product Documentation",
    "status": "ACTIVE",
    "enable_auto_refresh": true,
    "last_refreshed_timestamp": 1705320000000,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T11:45:00Z",
    "knowledge_base_sources": [
      {
        "source_id": "src_123...",
        "source_type": "TEXT",
        "title": "Overview",
        "content_preview": "Product overview and features...",
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "source_id": "src_456...",
        "source_type": "URL",
        "title": "API Documentation",
        "url": "https://example.com/docs",
        "created_at": "2024-01-15T10:31:00Z"
      },
      {
        "source_id": "src_789...",
        "source_type": "FILE",
        "title": "document.pdf",
        "file_name": "document.pdf",
        "file_size": 1024000,
        "created_at": "2024-01-15T10:32:00Z"
      }
    ]
  }
Get detailed information about a specific knowledge base including its sources and status.
curl -X GET "https://api.zudu.ai/api/knowledge-bases/get-knowledge-base/kb_abc123def456" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
{
  "message": "Knowledge base retrieved successfully",
  "status": "success",
  "error": null,
  "data": {
    "knowledge_base_id": "kb_abc123def456",
    "organization_id": "org_1234567890",
    "knowledge_base_name": "Product Documentation",
    "status": "ACTIVE",
    "enable_auto_refresh": true,
    "last_refreshed_timestamp": 1705320000000,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T11:45:00Z",
    "knowledge_base_sources": [
      {
        "source_id": "src_123...",
        "source_type": "TEXT",
        "title": "Overview",
        "content_preview": "Product overview and features...",
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "source_id": "src_456...",
        "source_type": "URL",
        "title": "API Documentation",
        "url": "https://example.com/docs",
        "created_at": "2024-01-15T10:31:00Z"
      },
      {
        "source_id": "src_789...",
        "source_type": "FILE",
        "title": "document.pdf",
        "file_name": "document.pdf",
        "file_size": 1024000,
        "created_at": "2024-01-15T10:32:00Z"
      }
    ]
  }

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Path Parameters

knowledgeBaseId
string
required
The knowledge base ID (format: kb_...)Example: kb_abc123def456

Response Fields

knowledge_base_id
string
Unique identifier for the knowledge base
organization_id
string
Organization ID the knowledge base belongs to
knowledge_base_name
string
Name of the knowledge base
status
string
Current status of the knowledge baseOptions:
  • DRAFT - Knowledge base is being created
  • ACTIVE - Knowledge base is active and ready to use
  • PROCESSING - Knowledge base is being processed
enable_auto_refresh
boolean
Whether auto-refresh is enabled for URL sources
last_refreshed_timestamp
number
Unix timestamp (milliseconds) of last refresh for URL sources
created_at
string
ISO 8601 timestamp when knowledge base was created
updated_at
string
ISO 8601 timestamp of last update
knowledge_base_sources
array
Array of sources within the knowledge baseEach source includes:
  • source_id: Unique source identifier
  • source_type: Type of source (TEXT, URL, FILE)
  • title: Title or name of the source
  • created_at: When the source was added
  • Additional fields depending on source type:
    • TEXT: content_preview
    • URL: url
    • FILE: file_name, file_size

Error Responses

error
string
Not Found - Knowledge base does not exist
{
  "message": "Knowledge base not found",
  "status": "error",
  "error": "Knowledge base 'kb_abc123' does not exist in organization 'org_1234567890'"
}
error
string
Unauthorized - Missing or invalid API key/secret
error
string
Internal Server Error - Failed to retrieve knowledge base
{
  "message": "Failed to retrieve knowledge base",
  "status": "error",
  "error": "Database connection failed"
}

Notes

  • The knowledge base must belong to your organization (automatically enforced)
  • All sources are included in the response
  • Source details vary by source type (TEXT, URL, FILE)
  • File sources include metadata like file name and size
  • URL sources include the original URL
  • Text sources include a content preview