ListDocuments
POST/v1/list-documents
Lists information about each document ingested into the corpus including the Document ID and metadata. This is useful for managing the lifecycle of documents and a quick way to check which documents are already in the index.
Some tips for this API:
- This operation works with the Personal API Key and OAuth 2.0 (in a JWT "Bearer Token") authentication. You can find details of how to set up and use OAuth 2.0 here.
Request
Header Parameters
Enter the Customer ID to use for the request.
Default value: 30S
(Optional) Enter the timeout value of the request in seconds, such as 10S or 30S.
- application/json
Body
required
Request to list documents in a corpus.
The Corpus ID.
Maximum number of results to be returned by the server. Max is 1000. If the value is larger than 1000, it will be capped to 1000.
Key of the specific page of the list results to return. Null/empty value means the very first page of the results is requested.
Filter on document metadata. If empty, no filtering is done. Otherwise, only documents that match all of the specified metadata will be returned. The syntax is the same as for QueryRequest.metadata.
Responses
- 200
- default
A successful response.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- Array [
- ]
- ]
document object[]
The list of documents.
The document ID that was used when indexing the document.
metadata object[]
Document metadata.
Name of the document metadata attribute.
Value of the document metadata attribute.
Represents the pagination key to retrieve the next page of results. If the value is "", it means no further results for the request. To retrieve the next page of results, client shall pass the value of next_page_key in the subsequent ListDocumentsRequest method call (in the request message's page_key field).
{
"document": [
{
"id": "string",
"metadata": [
{
"name": "string",
"value": "string"
}
]
}
],
"nextPageKey": "string"
}
An unexpected error response.
- application/json
- Schema
- Example (from schema)
Schema
- Array [
-
If no scheme is provided,
https
is assumed. -
An HTTP GET on the URL must yield a [google.protobuf.Type][]
value in binary format, or produce an error.
-
Applications are allowed to cache lookup results based on the
URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.)
- ]
details object[]
A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme http
, https
, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com.
Schemes other than http
, https
(or the empty scheme) might be
used with implementation specific semantics.
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}