Skip to main content
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

id
string
required

The ID of the document

Example:

"doc_2yYISEvrO9LrLAOJjnw27"

name
string
required

The name of the document

Maximum string length: 255
Example:

"my_document.txt"

owner
string
required

The owner of the document

Example:

"org_2nlswGH0pZ1V1OlHYAUwQG6TVBx"

file_type
string
required

The file type of the document

Example:

"text/plain"

file_bytes
integer<int64>
required

The size of the document in bytes

Example:

1234

created_at
string
required

The date and time when the document was created in RFC 3339 format

Example:

"2024-01-01T00:00:00.000Z"