POST
/
collections
/
add
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 collection = await client.collections.create({ name: 'name' });

  console.log(collection.created_at);
}

main();
{
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "owner": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

The name of the collection.

owner
string | null

The owner of the collection. If the request is made using a user token, this will be set to the user ID.

Response

200
application/json
Successful Response
name
string
required
created_at
string
required
owner
string | null
required