Documents
List Documents
Documents
List Documents
This endpoint allows you to paginate through all documents in the index. You can filter the documents by title, date, metadata, etc.
GET
/
documents
/
list
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
async function main() {
// Automatically fetches more pages as needed.
for await (const documentListResponse of client.documents.list({ collection: 'collection' })) {
console.log(documentListResponse.id);
}
}
main();
{
"items": [
{
"id": 123,
"source": "generic",
"resource_id": "<string>",
"status": "pending",
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"ingested_at": "2023-11-07T05:31:56Z",
"metadata": {},
"sections": [
{
"id": 123,
"text": "",
"scores": {
"semantic_search": 123,
"full_text_search": 123,
"weighted": 123
},
"elements": [
{
"id": "<string>",
"type": "text",
"text": "<string>",
"summary": "<string>",
"metadata": {
"title_level": 123,
"links": [
"<string>"
],
"filename": "<string>",
"languages": [
"<string>"
],
"page_number": 123,
"author": "<string>",
"continued_from": "<string>"
}
}
],
"embedding_e5_large": [
123
],
"embedding_ts": "<string>",
"document_id": 123,
"metadata": {}
}
],
"sections_count": 123,
"collection": ""
}
],
"next_cursor": "<string>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Required range:
0 < x < 100
Response
200
application/json
Successful Response
Available options:
generic
, markdown
, chat
, email
, transcript
, legal
, website
, image
, pdf
, audio
Along with service, uniquely identifies the source document
Available options:
pending
, processing
, completed
, failed
Available options:
text
, markdown
, image
, table
, title
, query
The id of the element that this element is continued from if it had to be split during chunking
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
async function main() {
// Automatically fetches more pages as needed.
for await (const documentListResponse of client.documents.list({ collection: 'collection' })) {
console.log(documentListResponse.id);
}
}
main();
{
"items": [
{
"id": 123,
"source": "generic",
"resource_id": "<string>",
"status": "pending",
"title": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"ingested_at": "2023-11-07T05:31:56Z",
"metadata": {},
"sections": [
{
"id": 123,
"text": "",
"scores": {
"semantic_search": 123,
"full_text_search": 123,
"weighted": 123
},
"elements": [
{
"id": "<string>",
"type": "text",
"text": "<string>",
"summary": "<string>",
"metadata": {
"title_level": 123,
"links": [
"<string>"
],
"filename": "<string>",
"languages": [
"<string>"
],
"page_number": 123,
"author": "<string>",
"continued_from": "<string>"
}
}
],
"embedding_e5_large": [
123
],
"embedding_ts": "<string>",
"document_id": 123,
"metadata": {}
}
],
"sections_count": 123,
"collection": ""
}
],
"next_cursor": "<string>"
}