PapermarkDocs

Documents

Upload and manage documents.

List documents

Returns a paginated list of documents for the authenticated team.

Create a document

Create a document from a previously-uploaded file (via POST /v1/documents/upload-url using `upload_id`) or an external URL.

Get a document

Returns metadata for a single document — name, type, content type, page count, folder, and timestamps.

Update a document

Edit document metadata: rename it, or move it to a different team-library folder. Replacing the file content is a separate operation — use POST /v1/documents/{id}/versions.

Delete a document

Permanently deletes a document by id.

List versions of a document

Returns every version recorded for a document, newest first. Exactly one version has `is_primary: true`.

Add a new version of a document

Upload a replacement file and record it as a new version. The new version becomes primary; the previous primary is demoted in the same transaction. Conversion / pre-processing jobs are triggered to match the dashboard's version-upload flow.

Get a document version

Returns a single version of a document.

Promote a version to primary

Set `is_primary: true` to promote this version. The previously-primary version is demoted in the same transaction. The only valid body is `{ "is_primary": true }`; demoting without promoting another version is not supported.

Search documents

Case-insensitive substring match against document name. Returns up to `limit` most-recent matches.

Generate a presigned upload URL

Step 1 of the document upload flow. Returns a presigned S3 PUT URL and an opaque one-time `upload_id`. Upload the file bytes directly to `upload_url`, then call POST /v1/documents with that `upload_id`.