Get Document

Get Document
Get a document from an index.

This method allows you to get a document in an index using its ID.

The document contains metadata, which tells you from which data source the document was retrieved (if any), what is the status of the document (if it has already been indexed, if indexing is pending, or if indexing may have failed), and what the system inferred to be the type of the document.

Request
URI
GET
https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/documents/{document_id}
COPY
Path Parameters
string
knowledge_base_id
Required

knowledge_base_id

string
index_id
Required

index_id

string
document_id
Required

document_id


Authentication
This operation uses the following authentication methods.
Responses
200

Successful Response

Returns Document of type(s) application/json
{
    "origin_name": "string",
    "origin_ref": "string",
    "custom_origin_name": "string",
    "custom_origin_ref": "string",
    "id": "string",
    "object": "string",
    "state": "string",
    "media_type": "string",
    "knowledge_base_id": "string",
    "index_id": "string",
    "data_source_id": "string",
    "created_at": 0,
    "last_embedded_at": 0,
    "last_indexed_by_id": "string",
    "size_bytes": 0,
    "hash_sha256": "string",
    "reindexing_needed": false
}
string
origin_name
Optional

Name of the original document, if one was provided during indexing.

string
origin_ref
Optional
Constraints: maxLength: 2048

Link to the original document, if one was available during indexing.

string
custom_origin_name
Optional

Display name for the document. If a custom override was configured, this contains the override value; otherwise, it falls back to origin_name.

string
custom_origin_ref
Optional
Constraints: maxLength: 2048

Reference URL for the document. If a custom override was configured, this contains the override value; otherwise, it falls back to origin_ref.

string As uuid As uuid
id
Required

ID of the document.

string
object
Optional
Constraints: default: document

Object type, which is always document.

state
Optional

Indexing state of the document.

media_type
Optional

Media type detected for the document.

string As uuid As uuid
knowledge_base_id
Required

ID of the Knowledge Dase of the document.

string As uuid As uuid
index_id
Required

ID of the index.

string As uuid As uuid
data_source_id
Optional

ID of the data source from which the document originates (if backed by a data source).

integer
created_at
Required

Unix timestamp (in seconds) when the document was added to the index.

integer
last_embedded_at
Required

Unix timestamp (in seconds) when the document was last embedded in the index.

string As uuid As uuid
last_indexed_by_id
Optional

Most recent indexing job affecting this document. Updated once the state of this indexing becomes INDEXED.

integer
size_bytes
Optional
Constraints: minimum: 0 default: 0

Size in bytes of the document.

string
hash_sha256
Optional

SHA256 hash of the document.

boolean
reindexing_needed
Required

If set, the document embeddings require an indexing to guarantee they are in sync with any updates from the data source.


404

Invalid knowledge base or document ID.

Operation doesn't return any data structure

422

Validation Error

Returns HTTPValidationError of type(s) application/json
{
    "detail": [
        {
            "loc": [
                {}
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}
array of object
detail
Optional

detail


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/documents/{document_id}