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

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

async function run() {
  const result = await factify.policies.list({
    documentId: "<id>",
    pageToken: "eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();
{
  "pagination": {
    "has_more": true,
    "next_page_token": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0In0",
    "prev_page_token": "eyJpZCI6ImRvY18wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJwcmV2In0"
  },
  "items": [
    {
      "attached_at": "2023-11-07T05:31:56Z",
      "attached_by": {
        "id": "user_01h2xcejqtf2nbrexx3vqjhp41",
        "name": "John Doe",
        "type": "user_account"
      },
      "document_id": "doc_01h2xcejqtf2nbrexx3vqjhp41",
      "policy": {
        "created_at": "2023-11-07T05:31:56Z",
        "id": "pol_01h2xcejqtf2nbrexx3vqjhp41",
        "name": "GDPR Compliance Policy"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

document_id
string
required

Document ID. Pattern: doc_[0-9a-hjkmnp-tv-z]{26}

Pattern: ^doc_[0-9a-hjkmnp-tv-z]{26}$

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:

"eyJpZCI6InBvbF8wMWgyeGNlanF0ZjJuYnJleHgzdnFqaHA0MSIsImQiOiJuZXh0IiwiZiI6eyJkb2NfaWQiOiJkb2NfMDFoMnhjZWpxdGYybmJyZXh4M3ZxamhwNDEifX0"

page_size
integer<int32>

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

Required range: 1 <= x <= 100

Response

Success

ListDocumentPoliciesResponse contains a page of policy attachments.

pagination
pagination · object
required

Pagination metadata.

items
DocumentPolicy · object[]

List of policy attachments.