fynepdf logo
Docs menu

Edit a PDF by instruction

"Remove the blank pages, number the rest and make it PDF/A": the model plans steps from the action catalog; code checks the plan exactly like a job. run: true starts it as a job (its steps are priced as usual). Planning is priced like ask; a plan that can't run costs nothing.

POST /v1/ai/edit

Request

curl -X POST https://api.fynepdf.com/v1/ai/edit \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"file_01jc8x4m2k9q7r3t5vwy6z","instruction":"Remove the blank pages and add page numbers at the bottom","run":true}'

Body

ParameterTypeRequiredWhat it does
file_idstringyes
instructionstringyes
runboolean
waitinteger
webhook_urlstring
metadataobjectYour own keys and values, returned on the job and in webhooks.

Response

The plan, and the job if it ran.

FieldTypeRequiredWhat it does
object"edit_plan"yes
explanationstringyes
stepsarray of objectyes
creditsintegeryes
jobobjectyes
testboolean

Errors

Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.