GET
/
documents
/
{id}
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.get('doc_2yYISEvrO9LrLAOJjnw27');

  console.log(document.id);
}

main();
{
  "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.

Path Parameters

id
string
required

The ID of the document to get metadata for

Response

200 - application/json

Document metadata retrieved successfully

The response is of type object.