POST
/
query
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 response = await client.query.search({ query: 'query' });

  console.log(response.documents);
}

main();
{
  "errors": [
    {}
  ],
  "documents": [
    {
      "source": "collections",
      "resource_id": "<string>",
      "metadata": {
        "indexed_at": "2023-11-07T05:31:56Z",
        "last_modified": "2023-11-07T05:31:56Z",
        "status": "pending",
        "events": [
          {
            "message": "<string>",
            "time": "2023-11-07T05:31:56Z",
            "type": "error"
          }
        ]
      },
      "score": 123
    }
  ],
  "answer": "<string>"
}

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.