Retrieve a document
GET/v2/corpora/:corpus_key/documents/:document_id
Retrieve a document
Request
Path Parameters
Possible values: <= 50 characters
, Value must match regular expression [a-zA-Z0-9_\=\-]+$
The unique key identifying the corpus containing the document to retrieve.
The Document ID of the document to retrieve.
The document_id
must be percent encoded.
Responses
- 200
- 403
- 404
Successfully retrieved the document.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
The Document ID.
metadata object
The document metadata.
The document metadata.
parts object[]
Parts of the document that make up the document. However, parts are not available when retrieving a list of documents or when creating a document. This property is only available when retrieving a document by id.
The text of the document part.
metadata object
The metadata for a document part. Attributes matching corpus document part filter attributes are used as document part filter attributes.
The metadata for a document part. Attributes matching corpus document part filter attributes are used as document part filter attributes.
The context text for the document part.
custom_dimensions object
The custom dimensions as additional weights.
storage_usage object
How much storage the document used. This information is currently not returned when retrieving the document, and only returned when indexing document.
Number of bytes used by document counting towards maximum corpus size, and towards any billing plans.
Number of metadata bytes used by document metadata.
{
"id": "my-doc-id",
"metadata": {},
"parts": [
{
"text": "I'm a nice document part.",
"metadata": {
"nice_rank": 9000
},
"context": "string",
"custom_dimensions": {}
}
],
"storage_usage": {
"bytes_used": 0,
"metadata_bytes_used": 0
}
}
Permissions do not allow retrieving a document from the corpus.
- application/json
- Schema
- Example (from schema)
Schema
The messages describing why the error occurred.
The ID of the request that can be used to help Vectara support debug what went wrong .
{
"messages": [
"Internal server error."
],
"request_id": "string"
}
Corpus or document not found.
- application/json
- Schema
- Example (from schema)
Schema
The ID cannot found.
ID of the request that can be used to help Vectara support debug what went wrong.
{
"id": "string",
"messages": [
"string"
],
"request_id": "string"
}