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
| Parameter | Type | Required | What it does |
|---|---|---|---|
file_id | string | yes | |
instruction | string | yes | |
run | boolean | ||
wait | integer | ||
webhook_url | string | ||
metadata | object | Your own keys and values, returned on the job and in webhooks. |
Response
The plan, and the job if it ran.
| Field | Type | Required | What it does |
|---|---|---|---|
object | "edit_plan" | yes | |
explanation | string | yes | |
steps | array of object | yes | |
credits | integer | yes | |
job | object | yes | |
test | boolean |
Errors
Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.