PapermarkDocs

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

POST
/v1/documents/upload-url

Authorization

bearerAuth documents.write
AuthorizationBearer <token>

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

In: header

Scope: documents.write

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/upload-url" \  -H "Content-Type: application/json" \  -d '{    "fileName": "pitch-deck.pdf",    "contentType": "application/pdf"  }'
{
  "upload_url": "https://s3.eu-central-1.amazonaws.com/...",
  "upload_id": "upload_3xA5v7r8K9mN2pQ4sT6uVwXy",
  "required_headers": {
    "Content-Type": "application/pdf",
    "Content-Disposition": "attachment; filename=\"pitch.pdf\"; filename*=UTF-8''pitch.pdf"
  },
  "expires_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
  }
}