POST
/
documents
/
upload
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 documentStatus = await client.documents.upload({
    collection: 'collection',
    file: fs.createReadStream('path/to/file'),
  });

  console.log(documentStatus.id);
}

main();
{
  "id": 123,
  "status": "pending",
  "collection": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

multipart/form-data
collection
string
required
file
file
required

Response

200
application/json
Successful Response
id
integer
required
status
enum<string>
required
Available options:
pending,
processing,
completed,
failed
collection
string
required