Skip to main content
POST
/
v1
/
documents
/
{document_id}
/
sharing
Grant access to a document
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    recipients: [
      {
        role: 'viewer',
        user_id: 'usr_01h2xcejqtf2nbrexx3vqjhp41',
        email: 'alice@example.com',
        bot_id: 'bot_01h2xcejqtf2nbrexx3vqjhp41'
      }
    ],
    should_send_notification: true,
    custom_message: '<string>'
  })
};

fetch('https://api.factify.com/v1/documents/{document_id}/sharing', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "total": 2,
  "successful": 1,
  "failed": 1,
  "results": [
    {
      "recipient": {
        "role": "viewer",
        "user_id": "usr_01h2xcejqtf2nbrexx3vqjhp41",
        "email": "alice@example.com",
        "bot_id": "bot_01h2xcejqtf2nbrexx3vqjhp41"
      },
      "success": true,
      "error": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://developers.factify.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication using a factapi-issued API key (ffy_<env>_<base32_uuid><base62_random>). Cookie-based sessions are accepted automatically by user-facing endpoints but are not surfaced as an OpenAPI auth scheme.

Path Parameters

document_id
string
required

Document ID

Example:

"doc_01h2xcejqtf2nbrexx3vqjhp41"

Body

application/json
recipients
object[]
required

Recipients to grant access to.

Required array length: 1 - 100 elements
should_send_notification
boolean
default:true

Whether to email each recipient about the grant. Defaults to true. Set false to grant silently (test setup, bulk imports).

custom_message
string

Optional message included in the share notification email. Ignored when should_send_notification=false.

Maximum string length: 1000

Response

OK — inspect results[].success per recipient.

total
integer
required

Number of recipients in the request.

Required range: x >= 1
successful
integer
required

Count of recipients granted access.

Required range: x >= 0
failed
integer
required

Count of recipients that did not receive access.

Required range: x >= 0
results
object[]
required

Per-recipient outcome, in the same order as the request.