Get a document version
Returns a single version of a document.
Authorization
bearerAuth documents.readDashboard-issued token (pm_live_...) or OAuth-issued access token.
In: header
Scope: documents.read
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.papermark.com/v1/documents/string/versions/string"{
"id": "clxy9ver1234567890",
"object": "document_version",
"version_number": 2,
"is_primary": true,
"type": "pdf",
"content_type": "application/pdf",
"num_pages": 12,
"file_size": 2048576,
"created": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}{
"error": {
"code": "bad_request",
"message": "The request body is not valid JSON.",
"doc_url": "https://www.papermark.com/docs/api/errors#bad_request",
"details": null
}
}{
"error": {
"code": "unauthorized",
"message": "Missing bearer token. Include an `Authorization: Bearer <token>` header.",
"doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
"details": null
}
}{
"error": {
"code": "forbidden",
"message": "Token is missing required scope: links.write.",
"doc_url": "https://www.papermark.com/docs/api/errors#forbidden",
"details": null
}
}{
"error": {
"code": "not_found",
"message": "Link link_abcd1234 not found.",
"doc_url": "https://www.papermark.com/docs/api/errors#not_found",
"details": null
}
}{
"error": {
"code": "unprocessable_entity",
"message": "Invalid request body.",
"doc_url": "https://www.papermark.com/docs/api/errors#unprocessable_entity",
"details": {
"formErrors": [],
"fieldErrors": {
"expires_at": [
"Invalid datetime"
]
}
}
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 30s.",
"doc_url": "https://www.papermark.com/docs/api/errors#rate_limit_exceeded",
"details": null
}
}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.
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.