Skip to main content
POST
/
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.attach({
    documentId: "<id>",
    body: {
      policyId: "<id>",
    },
  });

  console.log(result);
}

run();
{
  "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}

Body

application/json

AttachPolicyRequest specifies a policy to attach to a document.

policy_id
string
required

Policy ID to attach. Pattern: pol_[0-9a-hjkmnp-tv-z]{26}

Response

Success

DocumentPolicy represents a policy attached to a document.

attached_at
string<date-time>
required

Timestamp when policy was attached.

attached_by
attached_by · object
required

User who attached the policy.

document_id
string
required

Document ID this policy is attached to. Pattern: doc_[0-9a-hjkmnp-tv-z]{26}

Example:

"doc_01h2xcejqtf2nbrexx3vqjhp41"

policy
policy · object
required

The policy details.