GET
/
documents
/
get
/
{document_id}
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() {
  const document = await client.documents.get(0);

  console.log(document.id);
}

main();
{
  "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
      }
    }
  ],
  "collection": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

document_id
integer
required

Response

200
application/json
Successful Response
collection
string
required
id
integer | null
source
default:
generic
Available options:
generic,
markdown,
chat,
email,
transcript,
legal,
website,
image,
pdf,
audio
resource_id
string

Along with service, uniquely identifies the source document

status
enum<string>
Available options:
pending,
processing,
completed,
failed
title
string | null
created_at
string | null
ingested_at
string | null
metadata
object
sections
object[]