PapermarkDocs

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.

POST
/v1/documents/{id}/versions

Authorization

bearerAuth documents.write
AuthorizationBearer <token>

Dashboard-issued token (pm_live_...) or OAuth-issued access token.

In: header

Scope: documents.write

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.papermark.com/v1/documents/string/versions" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "clxy9ver1234567890",
  "version_number": 2,
  "is_primary": true,
  "type": "pdf",
  "content_type": "application/pdf",
  "num_pages": 12,
  "file_size": 2048576,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing bearer token.",
    "doc_url": "https://www.papermark.com/docs/api/errors#unauthorized",
    "details": null
  }
}