GET
/
documents
JavaScript
import Tractorbeam from 'tractorbeam';

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

async function main() {
  const document = await client.documents.list();

  console.log(document.documents);
}

main();
{
  "documents": [
    {
      "id": "doc_2yYISEvrO9LrLAOJjnw27",
      "name": "my_document.txt",
      "owner": "org_2nlswGH0pZ1V1OlHYAUwQG6TVBx",
      "file_type": "text/plain",
      "file_bytes": 1234,
      "created_at": "2024-01-01T00:00:00.000Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Response

200 - application/json

Successfully listed documents

The response is of type object.