/v1/tools/edit_draftfreeChange part of a draft
Changes part of a draft, free, without sending it all back: one pause, one caption line, one image. patch is JSON Patch (RFC 6902) on the draft's params by name: ops add, remove, replace and test, each {op, path, value}, applied in order, and a path goes into a param holding JSON, such as a script: /timeline/pauses/longest, /timeline/captions/lines/-, /timeline/scenes/2/line. Nothing runs. Give draft, its name; or tool and from, for the draft of the job it was started from, as open_draft opened it: a finished job not yet a draft is kept as one with the change. Give the version you opened to change only that one: if it was saved since, nothing changes and the newer one's time is given. If an op cannot be applied, a test does not hold, or a script no longer holds together, nothing changes and you are told why. placed gives each timeline as it plays, in seconds: its length; its safe area in each aspect ratio (its top left corner, width and height as shares of the frame, null for none), where text boxes, logos and captions belong; each scene with its start, end and words as [word, start, end]; each text box with when it shows and where it is drawn in each aspect ratio (its middle, width and height as shares of the frame); each pause with the word it follows, where it begins, how long it was voiced and how long it plays; and each caption with its first and last word, when it shows, the words said, what it shows instead when set (shows), and whether it was set by hand.
Fields
| Field | Type | Default | What it is |
|---|---|---|---|
draft | string | None | Its name, draft_… |
tool | string | None | The tool or action, with from |
from | string | None | The job it was started from |
patch | array | Required | The changes, in order |
version | integer | None |
Call it
Request
curl -X POST https://app.scrub.app/v1/tools/edit_draft \
-H "Authorization: Bearer $SCRUB_KEY" \
-H "Content-Type: application/json" \
-d '{"patch":[{"op":"add","path":"…"}]}'Answer
{
"ok": true,
"result": {
"…": "…"
}
}What result holds is said above.
Every call can also answer an error: what comes back. Try it with your key from Account.