---
title: "Get Knowledge Base Document By Id"
method: GET
path: "/v1/knowledge/{kb_id}/documents/{document_id}"
tags: ["API v1", "Knowledge", "Knowledge CRUD", "Knowledge Documents"]
---

# Get Knowledge Base Document By Id

`GET /v1/knowledge/{kb_id}/documents/{document_id}`

## Request

- Base URL: `https://api.xpander.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xpander.ai/v1/knowledge/{kb_id}/documents/{document_id}`
- Auth: API key in header `x-api-key`

Get knowledge base document by id

## Path parameters

- `kb_id` string, required
- `document_id` string, required

## Response `200`

Successful Response

- XpanderDevUtilsModelsKnowledgeBasesKnowledgeBaseDocumentItem: 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, nullable: KB identifier
  - `id` string, nullable: Document unique identifier
  - `document_url` string, required: Document URL
  - `organization_id` string, nullable: Organization ID
  - `name` string, nullable: Doc name
  - `raw_data` string, nullable: Raw data (textual)
  - `local_env` boolean, nullable: Is local
  - `sync` boolean, nullable: Is sync?

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xpander/apis/xpander-ai-api-service.md) - [All operations](https://skmtc.dev/xpander/apis/xpander-ai-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/xpander/apis/xpander-ai-api-service/revisions/725c0066d5df?raw)
