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`), an external file URL (`source_url`), or a non-file source via `type` + `external_url` (`link` for any external page, `notion` for a public Notion page).

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

Record a new version of a document. For file documents, upload a replacement file (`upload_id`/`source_url`) — conversion / pre-processing jobs are triggered to match the dashboard's version-upload flow. For `link`/`notion` documents, pass `external_url` to repoint them at a new URL. Either way the new version becomes primary and the previous primary is demoted in the same transaction.

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`.