Skip to main content
GET
/
documents
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const documents = await client.documents.list();

console.log(documents.data);
{
  "data": [
    {
      "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      "record_type": "document",
      "created_at": "2018-02-02T22:25:27.521Z",
      "updated_at": "2018-02-02T22:25:27.521Z",
      "content_type": "application/pdf",
      "size": {
        "unit": "bytes",
        "amount": 123456
      },
      "status": "pending",
      "sha256": "08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
      "filename": "test-document.pdf",
      "customer_reference": "MY REF 001",
      "av_scan_status": "scanned"
    }
  ],
  "meta": {
    "page_number": 2,
    "page_size": 25,
    "total_pages": 3,
    "total_results": 55
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

filter
object

Consolidated filter parameter for documents (deepObject style). Originally: filter[filename][contains], filter[customer_reference][eq], filter[customer_reference][in][], filter[created_at][gt], filter[created_at][lt]

Example:
{
"filename": { "contains": "invoice" },
"customer_reference": { "in": ["REF001", "REF002"] },
"created_at": { "gt": "2021-01-01T00:00:00Z" }
}
sort
enum<string>[]

Consolidated sort parameter for documents (deepObject style). Originally: sort[] Specifies the sort order for results. If you want to sort by a field in ascending order, include it as a sort parameter. If you want to sort in descending order, prepend a - in front of the field name.

Available options:
filename,
created_at,
updated_at,
-filename,
-created_at,
-updated_at
Example:
["filename"]
page
object

Consolidated page parameter (deepObject style). Originally: page[size], page[number]

Response

Successful response

data
object[]
meta
object