POST
/
documents
/
add
import Hyperspell from 'hyperspell';

const client = new Hyperspell({
  apiKey: process.env['HYPERSPELL_TOKEN'], // This is the default and can be omitted
});

async function main() {
  const documentStatus = await client.documents.add({ text: 'text' });

  console.log(documentStatus.id);
}

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

Authorizations

Authorization
string
header
required

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

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.