Skip to main content
GET
/
v1
/
knowledge
/
{kb_id}
/
documents
/
{document_id}
Get Knowledge Base Document By Id
curl --request GET \
  --url https://api.xpander.ai/v1/knowledge/{kb_id}/documents/{document_id} \
  --header 'x-api-key: <api-key>'
{
  "id": "doc-uuid-1",
  "knowledge_base_id": "73dc30ca-bdbf-42f7-a39f-93aff4f8522e",
  "name": "product-guide.pdf",
  "status": "ready",
  "source_url": "https://example.com/docs/product-guide.pdf",
  "content_type": "application/pdf",
  "created_at": "2026-02-01T10:00:00Z",
  "updated_at": "2026-02-01T10:05:00Z"
}
Retrieve complete details about a specific document including metadata, processing status, and content information.

Path Parameters

kb_id
string
required
Unique identifier of the knowledge base (UUID format)
document_id
string
required
Unique identifier of the document (UUID format)

Response

kb_id
string
Knowledge base ID this document belongs to
id
string
Unique identifier for the document (UUID)
document_url
string
URL of the document
organization_id
string
UUID of the organization that owns this document
name
string
Document name (typically the document URL)
raw_data
string
The extracted text content of the document

Example Request

curl -X GET -H "x-api-key: <your-api-key>" \
  "https://api.xpander.ai/v1/knowledge/<kb-id>/documents/<document-id>"

Example Response

{
  "kb_id": "<kb-id>",
  "id": "<document-id>",
  "document_url": "https://example.com/product-guide.pdf",
  "organization_id": "<org-id>",
  "name": "https://example.com/product-guide.pdf",
  "raw_data": "The extracted text content of the document..."
}

Notes

  • The raw_data field contains the extracted text content of the document
  • Returns 404 if the document or knowledge base is not found

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

kb_id
string
required
document_id
string
required

Response

Successful Response

Represents a document item within a Knowledge Base.

Attributes: kb_id (Optional[str]): KB identifier. id (str): Document unique identifier. document_url (str): URL of the document. raw_data (Optional[str]): Raw textual data of the document. local_env (Optional[bool]): Indicates if the document is in a local environment. Defaults to False.

kb_id
string | null

KB identifier

id
string | null

Document unique identifier

document_url
string

Document URL

organization_id
string | null

Organization ID

name
string | null

Doc name

raw_data
string | null

Raw data (textual)

local_env
boolean | null
default:false

Is local

sync
boolean | null
default:false

Is sync?