PDF editor

Apply a recipe to a document

Applies the operations in order and stores the new document, returning a download link valid for one hour (the file is kept for 7 days). All or nothing: if any operation fails, nothing is written and nothing is charged. One charge per save, however many operations it carries. Saving rewrites the whole file, so an existing digital signature stops validating — preflight reports that as signatures_invalidated.

Send a commit_token to make retries safe: repeating a save with the same token returns the first result (repeated: true) instead of charging again.

post/pdf/edit

Request

  • Base URL: https://api.podpdf.com
  • URL: https://api.podpdf.com/pdf/edit
  • Auth: API key in header X-API-Key

Request body

source_keystring

Key from /pdf/upload-url. Give this or input.

filenamestring

Name of the document, with source_key.

commit_tokenstring

Makes a save safe to retry — the same token returns the first result instead of charging again. Ignored by preflight.

Example request

{
  "source_key": "pdf-uploads/01HZ…/01J8…pdf",
  "recipe": [
    {
      "op": "pages.rotate",
      "pages": "1",
      "degrees": 90
    },
    {
      "op": "bates.stamp",
      "prefix": "ACME-",
      "start": 1,
      "digits": 6
    },
    {
      "op": "metadata.strip"
    }
  ],
  "commit_token": "01JB7QRSTUV",
  "options": {
    "output_filename": "contract-stamped"
  }
}

Response

The edited document

job_idstring
operation'pdf_edit'
status'completed'
repeatedboolean

This commit_token was already saved; this is the first result again, not a new charge.

input_pagesinteger
output_pagesinteger
output_bytesinteger
download_urlstring uri

Valid for 1 hour. The file is kept for 7 days — fetch a new link with GET /jobs/{job_id}/download.

download_url_expires_atstring date-time
warningsstring[]
sanitizeSanitizeReport

What sanitize found and removed, by category.

Example response

{
  "job_id": "9f0a4b78-2c0c-4d14-9b8b-123456789abc",
  "operations": [
    {
      "op": "bates.stamp"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.