Skip to main content
GET
/
v1beta
/
documents
TypeScript
import { Factify } from "@factify/sdk";

const factify = new Factify({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await factify.documentService.list({
    pageToken: "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0",
  });

  console.log(result);
}

run();
{
  "pagination": {
    "has_more": true,
    "next_page_token": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0",
    "prev_page_token": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJwcmV2In0"
  },
  "items": [
    {
      "access_level": "private",
      "created_at": "2023-11-07T05:31:56Z",
      "created_by": {
        "id": "user_01h2xcejqtf2nbrexx3vqjhp41",
        "name": "<string>",
        "type": "user"
      },
      "id": "doc_01h2xcejqtf2nbrexx3vqjhp41",
      "processing_status": "processing",
      "title": "Q4 2024 Financial Report",
      "url": "https://app.factify.com/d/01h2xcejqtf2nbrexx3vqjhp41",
      "current_version": {
        "id": "ver_01h2abcd1234efgh5678jkmnpt"
      },
      "description": "Quarterly financial report for Q4 2024",
      "general_access": "private",
      "last_viewed_at": "2023-11-07T05:31:56Z",
      "permission_set": {
        "attach_policy": true,
        "comment_private": true,
        "comment_public": true,
        "copy_content": true,
        "create_version": true,
        "export": true,
        "grant_access": true,
        "list_versions": true,
        "manage_access": true,
        "open": true,
        "screenshot": true,
        "trash": true,
        "view": true,
        "view_analytics": true,
        "view_leads": true,
        "view_timeline": true
      },
      "shared_at": "2023-11-07T05:31:56Z",
      "thumbnail_url": "<string>",
      "trashed_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

page_token
string

Opaque pagination token from a previous response. Pass next_page_token or prev_page_token from a previous response to continue pagination. Empty or omitted for the first page.

Example:

"eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0"

page_size
integer<int32>

Maximum number of items to return per page (1-100). Default: 50.

Required range: 1 <= x <= 100
created_by_id
string[]

Filter by creator ID(s) (user or bot). Returns documents matching ANY of the specified IDs. REST: ?created_by_id=user_01h2xcejqtf2nbrexx3vqjhp41 or ?created_by_id=user_xxx&created_by_id=bot_yyy

Pattern: ^(user|bot)_[0-9a-hjkmnp-tv-z]{26}$
access_level
enum<string>[]

Filter by access level(s). Returns documents matching ANY of the specified levels. REST: ?access_level=private or ?access_level=private&access_level=organization

Available options:
private,
organization,
public
processing_status
enum<string>[]

Filter by processing status(es). Returns documents matching ANY of the specified statuses. REST: ?processing_status=ready or ?processing_status=processing&processing_status=ready

Available options:
processing,
ready,
failed
sort
string

Sort field and direction. Prefix with - for descending order. Allowed values: created_at, updated_at, name, last_viewed_at, last_shared_at. Default (omitted): created_at descending. REST: ?sort=last_viewed_at or ?sort=-name

query
string

Full-text search filter. Case-insensitive substring match on document name and description. REST: ?query=budget

ownership
enum<string>[]

Ownership filter. Returns documents matching the specified ownership state. REST: ?ownership=owned or ?ownership=not_owned

Available options:
owned,
not_owned
trash_state
enum<string>[]

Trash state filter. Returns documents matching the specified trash state. REST: ?trash_state=active or ?trash_state=trashed or ?trash_state=active&trash_state=trashed Default (omitted): active documents only.

Available options:
active,
trashed
organization_scope
boolean

Organization scope filter. When true, restrict to documents within the user's organization. REST: ?organization_scope=true

created.after
string<date-time>

Filter by created.after (RFC 3339 format, e.g., 2024-01-15T09:30:00Z)

Response

Success

ListDocumentsResponse contains a page of documents.

pagination
pagination · object
required

Pagination metadata.

items
Document · object[]

List of documents.