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>'
{
  "kb_id": "<string>",
  "id": "<string>",
  "document_url": "<string>",
  "organization_id": "<string>",
  "raw_data": "<string>",
  "local_env": true,
  "sync": true
}
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)
name
string
Document name (nullable)
document_url
string
URL to access the document file
status
string
Processing status: pending, processing, completed, failed
created_at
string
ISO 8601 timestamp of when the document was added
updated_at
string
ISO 8601 timestamp of last update
metadata
object
Additional document metadata (file type, size, etc.)
chunks_count
integer
Number of text chunks extracted from the document

Example Request

curl -X GET -H "x-api-key: YOUR_API_KEY" \
  "https://api.xpander.ai/v1/knowledge/e21563bd-7c02-4f8f-9520-8c854f5c2ee6/documents/c7e44aac-e347-481d-bef8-8f230adf1a74"

Example Response

{
  "kb_id": "4be18afd-ccbd-4092-8686-75e9df2a1bec",
  "id": "043210de-52df-4bfd-94bb-c809fcd8d77a",
  "document_url": "https://raw.githubusercontent.com/xpander-ai/xpander-sdk/main/README.md",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "raw_data": "# xpander.ai SDK\n\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)]...",
  "local_env": false,
  "sync": false
}
Note: The raw_data field contains the complete document content. This can be very large for documents like PDFs or long markdown files.

Notes

  • Use this endpoint to check if a document has been fully processed
  • The chunks_count field indicates how many searchable chunks were extracted
  • Documents with status: "failed" may need to be re-uploaded

See Also

  • [List Documents](/API reference/v1/knowledge/list-documents) - List all documents in a knowledge base
  • [Add Documents](/API reference/v1/knowledge/add-documents) - Add new documents
  • [Delete Document](/API reference/v1/knowledge/delete-document) - Remove a document

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.

document_url
string
required

Document URL

kb_id
string | null

KB identifier

id
string | null

Document unique identifier

organization_id
string | null

Organization ID

raw_data
string | null

Raw data (textual)

local_env
boolean | null
default:false

Is local

sync
boolean | null
default:false

Is sync?