const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.factify.com/v1/documents/{document_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ver_01h2xcejqtf2nbrexx3vqjhp41",
"document_id": "doc_01h2xcejqtf2nbrexx3vqjhp41",
"source_type": "pdf",
"status": "ready",
"title": "Draft v2",
"created_at": "2025-01-15T10:30:00Z",
"created_by": {
"id": "usr_01h2xcejqtf2nbrexx3vqjhp41",
"name": "Alice Chen"
},
"status_error": "unsupported file format",
"description": "<string>",
"payload_url": "https://factify-documents.s3.us-east-1.amazonaws.com/documents/org_.../doc_.../ver_..."
}Upload a new version
Creates a new version of an existing document by uploading a PDF as multipart/form-data. The new version becomes the document’s current version on success and is queued for ingestion. Sharing, capabilities, and policies are preserved from the prior version.
const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.factify.com/v1/documents/{document_id}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "ver_01h2xcejqtf2nbrexx3vqjhp41",
"document_id": "doc_01h2xcejqtf2nbrexx3vqjhp41",
"source_type": "pdf",
"status": "ready",
"title": "Draft v2",
"created_at": "2025-01-15T10:30:00Z",
"created_by": {
"id": "usr_01h2xcejqtf2nbrexx3vqjhp41",
"name": "Alice Chen"
},
"status_error": "unsupported file format",
"description": "<string>",
"payload_url": "https://factify-documents.s3.us-east-1.amazonaws.com/documents/org_.../doc_.../ver_..."
}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
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
"doc_01h2xcejqtf2nbrexx3vqjhp41"
Body
The file to upload
Response
Created
A specific upload of a document. Each createVersion call produces
one of these. The most recent successful version is referenced by
Document.current_version.
Unique version ID. Pattern ver_[0-9a-hjkmnp-tv-z]{26}.
"ver_01h2xcejqtf2nbrexx3vqjhp41"
ID of the parent document.
"doc_01h2xcejqtf2nbrexx3vqjhp41"
Origin file format of the upload (pdf, docx, xlsx, csv, markdown).
"pdf"
Lifecycle state of this version's ingestion: pending,
processing, ready, or failed. Inspect status_error when
failed.
"ready"
Per-version display name. Defaults to empty string when no title was set.
"Draft v2"
Timestamp when this version was uploaded.
"2025-01-15T10:30:00Z"
Subject reference for the version's uploader (type, id, name).
name is resolved at read time from the user profile; empty string
when the user is unknown or the lookup failed.
Show child attributes
Show child attributes
Human-readable error explaining why processing failed. Present only when status == "failed".
"unsupported file format"
Optional per-version description. Tri-state: absent/null = not set; empty string = explicitly empty; any string = description text.
10000Internal pointer to the version's source file in object storage.
Use exportDocument (current version) or a follow-up presigning
endpoint to obtain a downloadable URL — payload_url itself is
not directly fetchable by clients.
"https://factify-documents.s3.us-east-1.amazonaws.com/documents/org_.../doc_.../ver_..."