edit

Edit a PDF

Apply one or more edits (replace, delete, redact, insert, form fill) to a document and get the edited PDF back with every change verified. Send the document as a multipart upload (file) with edits as a JSON string, or as JSON with source.url or a source.file_id from an earlier upload. Small documents answer 200 with the result at once; larger ones (over the plan's sync page limit) and any request with options.async true answer 202 with a job_id to poll at GET /v1/jobs/{job_id} (or set options.webhook_url to be called when it finishes). Add Accept: application/pdf to receive the edited file itself instead of JSON. Each entry in changes says which font was written (font_source, font_used), whether the pixel check passed (verified, collateral_pixels) and links a before/after preview; unmatched and failed list what did not happen and why.

post/v1/edit

Request

  • Base URL: https://api.niubai.vip (the document declares no server; this is the origin it was published from)
  • URL: https://api.niubai.vip/v1/edit
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Makes a retry safe. The same key with the same body returns the first request's result (a replay, never a second charge); a duplicate that arrives while the first is still running waits for it, then answers 409 conflict if it has not finished; the same key with a different body is refused 400. Without the header the gateway derives a key from the request's content, so a blind retry of a timed-out POST is still safe. Keys are scoped to the account and the key's mode.

Request body

EditRequest required(unresolved $ref)

Response

The edit ran

statusstring required
job_idstring required
warningsstring[]
errorobject nullable

Changes

No recorded changes to this operation across all 2 revisions of this API.