Scrub

API

Scrub's API

Call any Tool or Action over HTTP with a key, price it, run it, follow the job and fetch the result.

Issue a keyopenapi.json

On this page

Start

Every Tool and Action, and each Flow you save, is one call: POST https://app.scrub.app/v1/tools/<name> with its settings as a JSON body, the same settings as its page, at the same price. The same calls, keys, prices and limits as Scrub over MCP. Each one, with its settings and their defaults, is at https://app.scrub.app/api, and the whole list is at https://app.scrub.app/v1/openapi.json, both open without a key. The API answers with data: a setting left out runs on its default, and nothing asks you a question.

The examples read your key from SCRUB_KEY. What each Tool and Action costs is on Pricing; quote gives the exact price of a call before it runs.

Try it in Scrub

The API page in Scrub runs any call with a key of its own, so you can see what comes back before you write code.

Your key

Issue one in Account and send it with every call as the header Authorization: Bearer sk_…. It works in that workspace and pays from its balance. Revoke it in Account, and its next call is refused.

Price it first

quote prices one call, or several in the order they would run, before anything runs. It is free and writes nothing. Its answer gives each step's price_usd, the total_usd, and whether it fits your spending cap and your balance.

  • Terminal
    curl -X POST \
      https://app.scrub.app/v1/tools/quote \
      -H "Authorization: Bearer $SCRUB_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "steps": [
          {
            "tool": "transcribe_audio",
            "arguments": {
              "src": "FILE_ID"
            }
          }
        ]
      }'

Run it

Call the Tool or Action by its name. Work that takes time answers at once with its job_id, status running and its price_usd. A setting you leave out runs on its default.

  • Terminal
    curl -X POST \
      https://app.scrub.app/v1/tools/transcribe_audio \
      -H "Authorization: Bearer $SCRUB_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: interview-1" \
      -d '{
        "src": "FILE_ID"
      }'
  • Send the same Idempotency-Key again and you get the same job back, not a second one charged. Without it, every call is a new job.

Follow the job

Ask job_status with the job_id every few seconds. While it is queued or running, it says how much is done (fraction_done) and, where it can tell, about how long is left (seconds_left). It ends as succeeded, failed, refused or cancelled, each answered 200 with what happened and what was charged.

  • Terminal
    curl -X POST \
      https://app.scrub.app/v1/tools/job_status \
      -H "Authorization: Bearer $SCRUB_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "job_id": "JOB_ID"
      }'
  • Once it has succeeded, outputs names each file it made by its file_id, and downloads gives a link to each that works for an hour. The files stay in Files.
  • stop_job stops a job that is still running, charging only the steps that finished. A run that fails is not charged.

Your files

A Tool or Action takes a file by its file_id. To send one from your code:

  • Ask create_upload with the file's filename, content_type and size in bytes. It answers with the file_id, an upload_url, and the method and headers to send it with. The link works for an hour, for files up to 4 GB.
  • Terminal
    curl -X POST \
      https://app.scrub.app/v1/tools/create_upload \
      -H "Authorization: Bearer $SCRUB_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "filename": "interview.mp3",
        "content_type": "audio/mpeg",
        "bytes": 18350080
      }'
  • Send the file to the upload_url with that method and those headers, such as curl -X PUT -H "Content-Type: audio/mpeg" -T interview.mp3 "UPLOAD_URL"
  • Ask upload_status with the file_id until uploaded is true, then pass the file_id as the file the work takes.
  • Instead of a file, a file setting also takes the job_id of a finished job that made a file of that kind. list_files lists your files, and download_file gives a link to one.
  • An upload no Tool uses goes after a day; with keep set to true it stays in Files as long as your plan keeps files.

In JavaScript

Send each call with fetch: the key in the Authorization header, after Bearer, and the settings as the JSON body. Then ask job_status with result.job_id the same way.

JavaScript
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/transcribe_audio`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()

const status = await fetch(
  `${base}/v1/tools/job_status`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": result.job_id
    }),
  },
)
const job = await status.json()

In Python

Send each call with requests.post: the same header, and the settings as json. Then ask job_status with the job_id in the answer's result the same way.

Python
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/transcribe_audio",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())
job_id = r.json()["result"]["job_id"]

r = requests.post(
    f"{base}/v1/tools/job_status",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": job_id,
    },
)
print(r.json())

Answers and errors

A call that worked answers 200 with {"ok": true, "result": {…} }. One that could not answers {"ok": false, "error": {"code": "…", "message": "…"} }, the message saying why, with its status:

StatusCodeWhen
400bad_requestThe body is not a JSON object, or is larger than 1 MB.
401unauthorizedNo key was sent, or the key is not valid or was revoked.
403forbiddenA web page on a site other than Scrub's own sent it. Call from a server or a script.
404not_foundThere is no Tool or Action by that name.
405method_not_allowedIt was not a POST.
422refusedNothing was run or charged: the message says why, such as a setting out of range, a file not in this workspace, the spending cap or the balance.
429rate_limitedToo many calls this minute. The Retry-After header says how many seconds to wait.
503Scrub could not serve it just then, answered with only an error. Send it again.

Limits

  • A workspace makes up to 120 calls a minute, counted across the API, MCP and Scrub's own pages. Asking job_status every five seconds is well inside it.
  • Every workspace has a spending cap an hour. quote says whether work fits it, and work over it is refused, not charged, until the hour frees enough.
  • Work runs on the workspace's balance. quote says whether it fits, and credit is added in Account.

Reference

Work

Actions and Tools: the work Scrub does, priced by the work.

Video

Caption a video

POST/v1/tools/add_captions

Captions a video from the video alone, as subtitles burned into the picture, at most two lines and seven seconds each. Give a transcription to skip transcribing. Takes src (file), transcript (file, optional).

More

Returns video, preview, edl (the captions as drawn, each with its words, times, place and style, and the source they were drawn on). One job: transcribing, then making captions, then burning in captions. Given transcript, it skips transcribing. Afterwards, change the result with adjust on the job of the step that made it, listed in the result.

Up to 60 minutes. Caption a video, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

transcriptstring · optional

A file_id from create_upload, accepting application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

positionone of · optional · default "lower_third"

Where the captions sit.

lower_third centre top_left

styleone of · optional · default "clean"

How the captions look. clean: White, heavy, a few words at a time. Each word lights up as it is said. pill: The word being said sits in a white pill, in black. box: The phrase on a dark rounded box, for busy footage. bold: Heavy words that pop in as they are said; the word being said grows.

More

subtitles: One or two full lines, smaller, without movement: for talks and wide videos.

clean pill box bold subtitles

fontone of · optional · default "Inter Tight"

The font the captions are set in. Inter Tight: Tight and even; every caption style's face. Inter: The plainest, most legible sans; explainers and data. Manrope: Calm, geometric and modern. Hanken Grotesk: Soft, open grotesque; friendly captions that stay easy to read.

More

Archivo: Sturdy grotesque with real weight; news and how-tos. Montserrat: The face most short-form captions are set in. Poppins: Round geometric sans; friendly brands and lifestyle. Figtree: Clean and warm, a little softer than Inter. Bricolage Grotesque: Quirky editorial sans. Rubik: Slightly rounded corners; playful but tidy. Bebas Neue: Tall capitals; titles, numbers and sport. Anton: Heavy, narrow capitals; the loudest hook text. Oswald: Condensed, with weights; lists and labels. League Gothic: Classic condensed gothic; posters and film titles. Fraunces: Soft, old-style serif; warm stories. Playfair Display: High-contrast serif; elegant titles. Instrument Serif: Narrow editorial serif. DM Serif Display: Bold display serif; quotes and headlines. PT Serif: Classic text serif with italics; reports, history and quotes. Caveat: Quick handwriting; notes and asides. Bangers: Comic-book capitals; reactions and gaming. Luckiest Guy: Fat cartoon capitals; kids, gaming and hooks. JetBrains Mono: Monospace; code, terminals and numbers that line up.

Inter Tight Inter Manrope Hanken Grotesk Archivo Montserrat Poppins Figtree Bricolage Grotesque Rubik Bebas Neue Anton Oswald League Gothic Fraunces Playfair Display Instrument Serif DM Serif Display PT Serif Caveat Bangers Luckiest Guy JetBrains Mono

sizenumber · optional · default 72

The captions' type size, in pixels on a frame whose shorter side is 1080; larger shows fewer words at a time.

rowsnumber · optional · default 1

How many lines a caption runs to; as many words show at once as fit.

caseone of · optional · default "as_said"

Capital letters as said, all capitals, or all lower case.

as_said capitals lower_case

weightone of · optional · default "style"

How heavy its letters are; the nearest weight its font has is drawn. style: its style's own

style 100 200 300 400 500 600 700 800 900

aheadone of · optional · default "style"

How the words of a caption not said yet look, in a style that shows a caption's words together. style: as its style shows them faded: faint until each is said full: as clear as the word being said

style faded full

inone of · optional · default "style"

How each caption comes in. style: the move its style has none: just there fade: comes up from nothing rise: lifts into place pop: springs up with a little overshoot

style none fade rise pop

outone of · optional · default "fade"

How each caption goes as the next comes. fade: a quick fade as the next comes none: just gone

fade none

colourstring · optional · default null

The words' colour. Left alone, the style's own.

highlightstring · optional · default null

The colour of the style's highlight, the pill the word being said sits in, the box behind the phrase, or the word being said, as the style has it. Left alone, the style's own; nothing in a style with no highlight.

alignone of · optional · default "centre"

Where the words sit in their box. left: the words start at the left of their box centre: the words centred in their box right: the words end at the right of their box

left centre right

backgroundone of · optional · default "style"

What is behind the words; as its style has it when left. style: its style's own none: nothing behind the words box: a rounded box round the phrase bar: a band the width of the caption's box

style none box bar

background_colourstring · optional · default "#111114"

The background's colour, when a box or a bar is chosen.

background_opacitynumber · optional · default 80

How solid the background is, when a box or a bar is chosen.

edgeone of · optional · default "style"

What is round each letter; as its style has it when left. style: its style's own none: nothing round the letters outline: a line round each letter shadow: a soft shadow under the words

style none outline shadow

edge_colourstring · optional · default "#000000"

The outline's or the shadow's colour, when one is chosen.

boxobject · optional · default null

Where the caption sits and the room its words wrap in: x and y its centre, width and height its size, as shares of the frame. Left out, the placement's own place. On the page it is dragged and its handles pulled; it snaps to the frame's safe lines.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/add_captions" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/add_captions`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/add_captions",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Make a loop

POST/v1/tools/make_a_loop

Makes a short video that loops: it plays on repeat with no jump, for a background or a post. From a few words, or from an image, which is the clip's first and last frame.

More

The movement has to come back round, like waves, a fire, a flag in the wind or birds circling; something crossing the picture one way cannot loop. 8 seconds at most, without sound. Takes image (file, optional). Returns video. One job: making the image, then filming, then finding the loop. Given image, it skips making the image.

Up to 8 seconds. Make a loop, on its own page.

Parameters

imagestring · optional

A file_id from create_upload, accepting image/jpeg, image/png, image/webp, up to 20 MB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

promptstring · required

What is in the picture and what moves, in a sentence or a few, such as steam rising from a cup of coffee; English works best. With an image, what moves in it.

aspect_ratioone of · optional · default "16:9"

Its aspect ratio, width to height.

16:9 9:16

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/make_a_loop" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A vinyl record spinning"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/make_a_loop`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "prompt": "A vinyl record spinning"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/make_a_loop",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "prompt": "A vinyl record spinning",
    },
)
print(r.json())

Generate a video

POST/v1/tools/generate_video

Creates a short video clip with sound from a description (text to video), 4, 6 or 8 seconds, wide or upright, 720p or 1080p, as an MP4. Reference images, optional, keep a person, a product, a place or a look from images you give in the clip.

More

Takes prompt (text), references (a list of files, up to 3, optional, with model recommended or Kling 4.0 or Seedance 2.5 or Seedance 2.0 Fast, with seconds 8). Returns video (the clip, an MP4 with sound, at 24 frames a second).

Up to 8 seconds. Generate a video, on its own page.

Parameters

referencesarray of string · optional

A list: A file_id from create_upload, accepting image/jpeg, image/png, image/webp, up to 20 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. All of them are one job.

promptstring · required

What happens, how it looks and what is heard, in a sentence or a few; English works best. Describe how a place or thing looks rather than naming it, since a named landmark is drawn as the model imagines it.

modelone of · optional · default "recommended"

The model it is made with. Recommended is Scrub's pick, Gemini Omni 1.1 Flash; the others by name, each at its own price.

recommended Kling 4.0 Kling 3.0 Seedance 2.5 Seedance 2.0 Fast

aspect_ratioone of · optional · default "16:9"

Its aspect ratio, width to height.

16:9 9:16

secondsone of · optional · default 8

How long it runs, in seconds.

4 6 8

resolutionone of · optional · default "720p"

Its resolution. 1080p only at 8 seconds.

720p 1080p

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/generate_video" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A drone over a surfer at sunrise"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/generate_video`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "prompt": "A drone over a surfer at sunrise"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/generate_video",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "prompt": "A drone over a surfer at sunrise",
    },
)
print(r.json())

Animate an image

POST/v1/tools/animate_image

Turns an image into a short video clip with sound (image to video): it starts on the image and moves as the words describe, 4, 6 or 8 seconds, wide or upright, 720p or 1080p, as an MP4. It can also end on the same image, so the clip plays on repeat with no jump.

Takes image (file). Returns video (the clip, an MP4 with sound, at 24 frames a second).

Up to 8 seconds. Animate an image, on its own page.

Parameters

imagestring · required

A file_id from create_upload, accepting image/jpeg, image/png, image/webp, up to 20 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, draw_diagram (Draw a diagram) makes one, or generate_image (Generate an image) makes one: run it first and pass its job_id here.

promptstring · required

What moves and how, and what is heard, in a sentence or a few; English works best.

end_on_imageboolean · optional · default false

The clip ends on the image it starts on, so it plays on repeat with no jump; only at 8 seconds. Movement has to come back round for that, like waves, a fire or birds circling, not something crossing the picture one way.

aspect_ratioone of · optional · default "16:9"

Its aspect ratio, width to height. An image of another shape is cut from the middle to fill it, with no bars.

16:9 9:16

secondsone of · optional · default 8

How long it runs, in seconds.

4 6 8

resolutionone of · optional · default "720p"

Its resolution. 1080p only at 8 seconds.

720p 1080p

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/animate_image" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "FILE_ID",
    "prompt": "The camera pushes in as steam rises"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/animate_image`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "image": "FILE_ID",
      "prompt": "The camera pushes in as steam rises"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/animate_image",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "image": "FILE_ID",
        "prompt": "The camera pushes in as steam rises",
    },
)
print(r.json())

Assemble a video

POST/v1/tools/assemble_video

Draws a video from its timeline: the voice, images, words on screen, captions, logo, sounds and music, each at its moment, upright, square, portrait or wide. Files already made go in as they are, so nothing is made twice; music said in words is made first, priced on the quote.

More

Takes timeline (a video's timeline). Returns video, preview, contact_sheet (one frame of the video every two seconds, six to a row, to check what is in it at a glance), captions (every caption as it is shown, from when it shows until it goes, as an SRT file. None when the video has no captions).

Up to 60 minutes. Assemble a video, on its own page.

Parameters

timelineobject or string · required

The video's timeline, as the builder shows it. Or the job_id of a finished job that made one, a draft's name (draft_…) or the file_id of one: what it holds is used as it is. Pass it rather than retyping its result.

More

A timeline is {version: 2, title?, aspect_ratios: [9:16, 1:1, 4:5, 16:9], brand?: {back, text, accent: colours like #1c1c1c (the accent colours a caption style's key or said word; leave it out to keep captions black and white), font: the font of words on screen that name none, one of Inter Tight, Inter, Manrope, Hanken Grotesk, Archivo, Montserrat, Poppins, Figtree, Bricolage Grotesque, Rubik, Bebas Neue, Anton, Oswald, League Gothic, Fraunces, Playfair Display, Instrument Serif, DM Serif Display, PT Serif, Caveat, Bangers, Luckiest Guy, JetBrains Mono; display?: the font titles are set in, one of the same; card?, tile?, tile_ink?, mark?: colours for a card, an icon's tile, an icon on its tile and the highlight behind marked words (card and tile a step from back towards text, tile_ink the accent and mark #FFD60A when left out)}, voice?: {name: one of Achernar (soft, female), Achird (friendly, male), Algenib (gravelly, male), Algieba (smooth, male), Alnilam (firm, male), Aoede (breezy, female), Autonoe (bright, female), Callirrhoe (easy-going, female), Charon (informative, male), Despina (smooth, female), Enceladus (breathy, male), Erinome (clear, female), Fenrir (excitable, male), Gacrux (mature, female), Iapetus (clear, male), Kore (firm, female), Laomedeia (upbeat, female), Leda (youthful, female), Orus (firm, male), Pulcherrima (forward, female), Puck (upbeat, male), Rasalgethi (informative, male), Sadachbia (lively, male), Sadaltager (knowledgeable, male), Schedar (even, male), Sulafat (warm, female), Umbriel (easy-going, male), Vindemiatrix (gentle, female), Zephyr (bright, female), Zubenelgenubi (casual, male); accent?: the accent it is said in, one of none (The voice's own), scottish (Scottish), irish (Irish), welsh (Welsh), british (British), american (American), australian (Australian) (none when left out)}, captions?: {style: clean (Clean: White, heavy, a few words at a time. Each word lights up as it is said.), pill (Pill: The word being said sits in a white pill, in black.), box (Box: The phrase on a dark rounded box, for busy footage.), bold (Bold: Heavy words that pop in as they are said; the word being said grows.), subtitles (Subtitles: One or two full lines, smaller, without movement: for talks and wide videos.) or off; size?: a type size, 16 to 400, pixels on a frame whose shorter side is 1080 (about 72 reads like a phone app's captions; larger means fewer words at a time); font?: one of the fonts below (Inter Tight when left out); rows?: 1 or 2 lines a caption runs to (1 when left out); width?: how wide a caption may run, as a share of the frame's shorter side, 0.2 to 3; colour?: a colour like #ffffff; said_colour?: the word being said in Pill, on its pill (near-black when left out); weight?: 100 to 900, the nearest its font has (its style's when left out); ahead?: the words not said yet, style (As its style: as its style shows them), faded (Faded: faint until each is said), full (Full: as clear as the word being said) (style when left out; none to come in a style that shows each word as it is said); outline?: false for none, or {colour?, width?: 0 to 30, percent of the type size}; shadow?: false for none, or {colour?, opacity?: 0 to 100 percent, blur?: 0 to 100 and distance?: 0 to 50, percent of the type size, the shadow dropped straight down} (the style's own when left out); in?: style (As its style: the move its style has), none (None: just there), fade (Fade: comes up from nothing), rise (Rise: lifts into place), pop (Pop: springs up with a little overshoot) (style when left out); out?: fade (Fade out: a quick fade as the next comes), none (None: just gone) (fade when left out); with a size, each caption is as many words as fit its width in its rows, never ending on a weak word; case: as_said, capitals, lower_case; place?: {x, y}: where every caption sits, its middle as shares of the frame's width and height, 0.05 to 0.95 (above the bottom of the safe area when left out); lines?: [{from, to: the first and last word of one scene's line it shows, each {scene: id, word, nth?}; text?: what it shows instead of those words, such as 58% for fifty-eight percent, at most 120 characters; place?: {x, y} for this one; hide?: true to show nothing for it; hold?: true to stay on screen until the next caption; inline?: true for text shown among the words around it, in their caption, such as a figure for words said, never a caption of its own}]: captions set by hand, none overlapping; every other caption is made from the words said, a few at a time}, pauses?: {longest?: seconds, 0 to 5, that every longer pause plays; at?: [{after: {scene: id, word, nth?}, seconds: 0 to 10}]: a pause after that word set by hand, made where there was none; or {before: {scene: id, word}, seconds} for the quiet before the first word of a line with nothing said before it, from its scene's start}: a pause is a gap of a quarter second or more between two words the voice said, or before a line's first word or after its last where nothing is said before or after it; a line not voiced yet has only the pauses set on it by hand, which play exactly as set once it is voiced; longest leaves the quiet before a first word and after a last word as voiced; shortened, lengthened or removed, the video is that much shorter or longer and everything after it moves with its words, and nothing is voiced again, transition?: cut, blur, fade, push, zoom between images (cut, none, when left out), look?: natural, mono, film, crisp over the images, progress?: true for a thin bar showing how much is left, safe?: {area: usual (TikTok, Reels and Shorts: inside the lines captions and text sit on, clear of what the apps put over a video), tiktok (TikTok: clear of TikTok's buttons, name and caption), reels (Instagram Reels: clear of Instagram's buttons, name and caption), shorts (YouTube Shorts: clear of YouTube's buttons, name and caption), even (Even margin: the same distance from every edge), none (None: only the frame's edges and middle) (usual when left out; TikTok, Reels and Shorts each in 9:16 only, the usual one in other shapes), margin?: for even, a share of the frame's shorter side, 0.01 to 0.25 (0.05 when left out)}: where nothing a person needs to read should sit, as placed gives it in each aspect ratio; keep text boxes, logos and captions inside it, music?: {prompt?: what it sounds like, its mood, instruments and pace, only when music is asked for (made by Generate music when it runs, as long as the video, a line of its own in the quote), src?: a file_id, from?: prompt when it was made from those words, volume 0 to 1}, scenes: [{id, line: what is said, duration: seconds, hold?: seconds it runs on after its line and its clips end, keys?: one or two words of the line, exactly as written, that carry its meaning}], images: [{id, at, until?, src?: a file_id, kind: image or video, motion: still, push, punch, zoom_in, zoom_out, pan_left, pan_right (still when left out; punch jumps closer on a key word), fit?: whole to show all of an image of another shape on a blurred copy of itself, prompt?: what it shows in a sentence or two (made from those words when it has no src), from?: prompt when it was made from them, make?: false to show the video's colours instead (true, or left out, to make it), style?: the style it is drawn in when made from its prompt, by the name the action that makes images gives it, box?: where it sits when not filling the frame, on_dark?: a file_id: a logo's white or reversed version, shown in place of src where it reads better over the picture behind it, plate?: card, scrim or none: what goes behind a logo that would not read over the picture behind it (card, in the brand's colour, when left out; measured before the video is drawn, only where needed), fades?: true for an image with an until to fade in and out (it is simply there when left out), turn?: degrees turned clockwise (-180 to 180), radius?: how round a placed image's corners are, 0 to 0.5 of its shorter side, crop?: {left, top, right, bottom}: shares of the image trimmed from each side, 0 to 0.9, length?: a clip's own seconds (read from its file when a draft is saved), start?: seconds into a clip where it begins, to cut its beginning, to?: seconds into a clip where it stops, to cut it short, volume?: 0 to 1 and fade?: seconds for a clip's own sound, in?: how it comes in, none, fade, rise, slide, pop, zoom, blur, wipe, word_pop, stomp (none when left out), out?: how it goes, none, fade, sink, slide_out, pop_out, blur_out, wipe_out (none when left out), speed?: quick (0.3 s), even (0.5 s), slow (1 s), how long it takes to come in and to go (even when left out)}], words: [{id, value: the words shown, at most 200 characters, a new line where it breaks, at, until?, box: {x, y, w}: where the text box sits (a box as below; w is the width its words wrap at), font?: one of Inter Tight (Tight and even; every caption style's face.), Inter (The plainest, most legible sans; explainers and data.), Manrope (Calm, geometric and modern.), Hanken Grotesk (Soft, open grotesque; friendly captions that stay easy to read.), Archivo (Sturdy grotesque with real weight; news and how-tos.), Montserrat (The face most short-form captions are set in.), Poppins (Round geometric sans; friendly brands and lifestyle.), Figtree (Clean and warm, a little softer than Inter.), Bricolage Grotesque (Quirky editorial sans.), Rubik (Slightly rounded corners; playful but tidy.), Bebas Neue (Tall capitals; titles, numbers and sport.), Anton (Heavy, narrow capitals; the loudest hook text.), Oswald (Condensed, with weights; lists and labels.), League Gothic (Classic condensed gothic; posters and film titles.), Fraunces (Soft, old-style serif; warm stories.), Playfair Display (High-contrast serif; elegant titles.), Instrument Serif (Narrow editorial serif.), DM Serif Display (Bold display serif; quotes and headlines.), PT Serif (Classic text serif with italics; reports, history and quotes.), Caveat (Quick handwriting; notes and asides.), Bangers (Comic-book capitals; reactions and gaming.), Luckiest Guy (Fat cartoon capitals; kids, gaming and hooks.), JetBrains Mono (Monospace; code, terminals and numbers that line up.), weight?: 400 to 900 (the nearest the font has), italic?: true for its italics where it has them, size?: a type size, 16 to 400, pixels on a frame whose shorter side is 1080 (about 120 a title, 72 a line, 48 small print), colour?, align?: left, center, right, leading?: how far apart its lines are, 0.8 to 2.5 times its size (1.12 when left out), outline?: false for none, or {colour?, width?: 0 to 30, percent of the type size}; shadow?: false for none, or {colour?, opacity?: 0 to 100 percent, blur?: 0 to 100 and distance?: 0 to 50, percent of the type size, the shadow dropped straight down} (none and a soft shadow when left out; an outline may also be a colour alone), back?: a colour for a rounded box behind each line, in?: how it comes in, none (None: Just there.), fade (Fade: Comes up from nothing.), rise (Rise: Each word lifts into place.), slide (Slide: Slides in from the left.), pop (Pop: Springs up from small, with a little overshoot.), zoom (Zoom: Grows into place from smaller.), blur (Blur in: Each word sharpens out of a blur.), typewriter (Typewriter: Typed out, letter by letter.), wipe (Wipe: Revealed from left to right.), word_pop (Word by word: Words pop in one after another.), stomp (Stomp: Slams down from huge with a small shake.), highlighter (Highlighter: A marker swipes in behind the words.), letters (Letter cascade: Letters tumble in one by one.), count (Count up: Its numbers run up to their value.) (none when left out), out?: how it goes, none (None: Just gone.), fade (Fade out: Fades away.), sink (Sink: Each word drops away.), slide_out (Slide out: Slides off to the right.), pop_out (Pop out: Swells a touch, then shrinks to nothing.), blur_out (Blur out: Dissolves into a blur.), wipe_out (Wipe out: Wiped away from left to right.), backspace (Backspace: Deleted letter by letter from the end.) (none when left out), speed?: quick (0.3 s), even (0.5 s), slow (1 s), how long it takes to come in and to go (its move's own when left out), marks?: [{from, to, at?}]: stretches of value drawn highlighted, the brand's mark colour sweeping in behind them at at (a moment, such as the word that says it; 0.6 seconds after the box comes in when left out), from and to counting value's characters from 0, from its first to just after its last, in order and none overlapping, role?: title or callout: what it is in the video, a title (a hook, a heading) or a callout (a figure or a short phrase said, shown big), so a Brand Kit's style of that name is put on it}]: text boxes, inside the safe area unless another place is given; words without a box are from before and sit at a place (top, middle, bottom) and come in by an animation (blur, rise, hook, pop, slide, fade, typewriter), sounds: [{id, src?: a file_id, prompt?: music it is, its mood, instruments and pace (made from those words, as long as it plays, when it has no src), from?: prompt when it was made from them, at, until?, volume 0 to 1, fade: seconds it fades in and out}], shapes?: [{id, kind: ground (fills the frame, a slide's background), card (a rounded rectangle) or icon (one of Lucide's, square), at, until?, box?: a card's or an icon's {x, y, w, h?}, a box as below, h a card's height as a share of the frame's shorter side as w is (square when left out), fill?: page, card, tile, tile_ink, accent, ink (the brand's back, card, tile, tile_ink, accent and text) or a colour like #1c1c1c (page for a ground, card for a card; an icon's own colour, tile_ink on a tile and text when not, when left out), radius?: how round its corners are, 0 to 0.5 of its box's shorter side, line?: true for a thin edge round a card, icon?: its Lucide name, such as leaf, piggy-bank or chart-line, tile?: true for an icon on a rounded tile, in?, out?, speed?: as an image's}]: drawn under the images, grounds first, then cards, then icons; one with no until lasts for the scene it begins in, slides?: [{id, at: {scene: id}, chapter?: the part of the video it begins, at most 80 characters, items: [ids of its words, images and shapes, bottom first]}]: items shown together, each slide from its scene's start until the next slide's begins (or the end), in the order of their scenes, an item in one slide at most; an item of a slide with no until of its own lasts until the slide ends, and where its items would otherwise tie, an earlier one in items is drawn under a later one}. The script is said in one voice, scene after scene; a scene lasts its duration, at least as long as its line takes to say, and a scene with no line is a pause; a clip that begins in a scene, with no until or until the scene's end, plays from its start (or its first frame) to its own end (or its to) and the scene runs on until it does, then for its hold, and everything after moves along. A clip's sound plays, lowered while the voice speaks, and at 0.3 under music when it has no volume of its own. Images, words and sounds each begin at their at and end at their until. A moment is {scene: id} (its start, or with end: true its end), {scene: id, word: one word of its line, nth?: 2 for its second time, end?: true when it has been said}, or {item: id of an image, words, sound or shape, end?: true}, any of them with plus?: seconds after it (in tenths). An image with no until lasts until the next image with no until begins; a clip never shows past its own end (or its to); words on screen last for the scene they begin in; a sound lasts its own length. Where images show at the same time, a later one in images is drawn on top of an earlier one; where none shows, the video's colours. A logo, or anything else that stays on screen, is an image with a box from the first scene's start until the last scene's end, small (w about 0.18) in a top corner inside the safe area, unless another place is given. A box is {x, y, w}: its middle as shares of the frame's width and height (0.5, 0.5 is the middle; -1 to 2, so it can hang over an edge) and its width as a share of the frame's shorter side (0.02 to 10); its height follows its own shape, and what is outside the frame is not shown. Ids are short names, each used once. files?: [file_id, …]: files kept with the video and not yet placed in it, so its Media shows them when it is opened again. Files are file_ids from this workspace, or the job_id of a finished job that made one: its file is used.

aspect_ratioone of · optional · default "9:16"

The aspect ratio it is drawn in, width to height. 9:16 is upright for stories and reels, 1:1 square, 4:5 portrait for feeds, 16:9 wide.

9:16 1:1 4:5 16:9

brand_kitstring · optional

A Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/assemble_video" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timeline": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/assemble_video`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "timeline": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/assemble_video",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "timeline": "JOB_ID",
    },
)
print(r.json())

Burn captions into a video

POST/v1/tools/burn_captions

Draws captions onto a video's picture (burned-in subtitles), from a subtitle file, captions written out or one line of text, in the place, style and size chosen. Takes src (file), subtitle_file (file). Give exactly one of: text, start and end; or captions; or subtitle_file.

More

Returns video, preview, edl (the captions as drawn, each with its words, times, place and style, and the source they were drawn on). Afterwards, change start, end, position, text or captions with adjust; quote_adjustment prices the change.

Up to 60 minutes. Burn captions into a video, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

subtitle_filestring · optional

A file_id from create_upload, accepting application/vnd.scrub.timed-text+json, application/json, application/x-subrip, text/vtt, text/plain, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) from the file given as src makes the transcript_file that convert (Convert a transcript) with as json makes one from: run them in that order first and pass the last one's job_id here.

textstring · optional

One caption's text, with start and end.

startnumber · optional

When that one caption appears, in seconds.

endnumber · optional

Greater than start.

captionsarray of object · optional

Captions written out, each with start and end in seconds and its text.

positionone of · optional · default "lower_third"

lower_third centre top_left

styleone of · optional · default "clean"

How the captions look. clean: White, heavy, a few words at a time. Each word lights up as it is said. pill: The word being said sits in a white pill, in black. box: The phrase on a dark rounded box, for busy footage. bold: Heavy words that pop in as they are said; the word being said grows.

More

subtitles: One or two full lines, smaller, without movement: for talks and wide videos.

clean pill box bold subtitles

fontone of · optional · default "Inter Tight"

The font the captions are set in. Inter Tight: Tight and even; every caption style's face. Inter: The plainest, most legible sans; explainers and data. Manrope: Calm, geometric and modern. Hanken Grotesk: Soft, open grotesque; friendly captions that stay easy to read.

More

Archivo: Sturdy grotesque with real weight; news and how-tos. Montserrat: The face most short-form captions are set in. Poppins: Round geometric sans; friendly brands and lifestyle. Figtree: Clean and warm, a little softer than Inter. Bricolage Grotesque: Quirky editorial sans. Rubik: Slightly rounded corners; playful but tidy. Bebas Neue: Tall capitals; titles, numbers and sport. Anton: Heavy, narrow capitals; the loudest hook text. Oswald: Condensed, with weights; lists and labels. League Gothic: Classic condensed gothic; posters and film titles. Fraunces: Soft, old-style serif; warm stories. Playfair Display: High-contrast serif; elegant titles. Instrument Serif: Narrow editorial serif. DM Serif Display: Bold display serif; quotes and headlines. PT Serif: Classic text serif with italics; reports, history and quotes. Caveat: Quick handwriting; notes and asides. Bangers: Comic-book capitals; reactions and gaming. Luckiest Guy: Fat cartoon capitals; kids, gaming and hooks. JetBrains Mono: Monospace; code, terminals and numbers that line up.

Inter Tight Inter Manrope Hanken Grotesk Archivo Montserrat Poppins Figtree Bricolage Grotesque Rubik Bebas Neue Anton Oswald League Gothic Fraunces Playfair Display Instrument Serif DM Serif Display PT Serif Caveat Bangers Luckiest Guy JetBrains Mono

sizenumber · optional · default 72

The captions' type size, in pixels on a frame whose shorter side is 1080; larger shows fewer words at a time.

rowsnumber · optional · default 1

How many lines a caption runs to; as many words show at once as fit.

caseone of · optional · default "as_said"

Capital letters as said, all capitals, or all lower case.

as_said capitals lower_case

weightone of · optional · default "style"

How heavy its letters are; the nearest weight its font has is drawn. style: its style's own

style 100 200 300 400 500 600 700 800 900

aheadone of · optional · default "style"

How the words of a caption not said yet look, in a style that shows a caption's words together. style: as its style shows them faded: faint until each is said full: as clear as the word being said

style faded full

inone of · optional · default "style"

How each caption comes in. style: the move its style has none: just there fade: comes up from nothing rise: lifts into place pop: springs up with a little overshoot

style none fade rise pop

outone of · optional · default "fade"

How each caption goes as the next comes. fade: a quick fade as the next comes none: just gone

fade none

colourstring · optional · default null

The words' colour. Left alone, the style's own.

highlightstring · optional · default null

The colour of the style's highlight, the pill the word being said sits in, the box behind the phrase, or the word being said, as the style has it. Left alone, the style's own; nothing in a style with no highlight.

alignone of · optional · default "centre"

Where the words sit in their box. left: the words start at the left of their box centre: the words centred in their box right: the words end at the right of their box

left centre right

backgroundone of · optional · default "style"

What is behind the words; as its style has it when left. style: its style's own none: nothing behind the words box: a rounded box round the phrase bar: a band the width of the caption's box

style none box bar

background_colourstring · optional · default "#111114"

The background's colour, when a box or a bar is chosen.

background_opacitynumber · optional · default 80

How solid the background is, when a box or a bar is chosen.

edgeone of · optional · default "style"

What is round each letter; as its style has it when left. style: its style's own none: nothing round the letters outline: a line round each letter shadow: a soft shadow under the words

style none outline shadow

edge_colourstring · optional · default "#000000"

The outline's or the shadow's colour, when one is chosen.

boxobject · optional · default null

Where the caption sits and the room its words wrap in: x and y its centre, width and height its size, as shares of the frame. Left out, the placement's own place. On the page it is dragged and its handles pulled; it snaps to the frame's safe lines.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/burn_captions" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/burn_captions`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/burn_captions",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Loop a clip

POST/v1/tools/make_loop

Makes a loop of a video from its own frames that plays on repeat with no jump, for a background or a post. It finds where the picture and its motion come back to the start and keeps the frames between, without sound. A video whose movement never comes back, like something crossing the picture one way, is refused.

Takes src (file). Returns video.

Up to 60 seconds. Loop a clip, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 512 MB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used.

More

Pass the job_id rather than retyping its result. Without one, animate_image (Animate an image) makes one, or generate_video (Generate a video) makes one: run it first and pass its job_id here.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/make_loop" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/make_loop`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/make_loop",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Compress a video

POST/v1/tools/compress_video

Makes a video file smaller to send or upload: looking the same, much smaller with no difference most people notice, or as small as it goes.

Takes src (file). Returns video.

Afterwards, change quality with adjust; quote_adjustment prices the change.

Up to 30 minutes. Compress a video, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used.

More

Pass the job_id rather than retyping its result. Or a file_id (cf_…) from list_computers: a file on the person’s computer, run there by the Scrub app while it is open, at the price there.

qualityone of · optional · default "balanced"

How much to keep. Looks the same (looks_the_same) is hard to tell from the original; Balanced (balanced) is much smaller, with no difference most people notice; Smallest (smallest) is smallest, a little softer.

looks_the_same balanced smallest

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/compress_video" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/compress_video`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/compress_video",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Cut a video

POST/v1/tools/cut_video

Cuts a video into the parts you keep and lays them at their times into one MP4, black in any gap. Give a sound and it plays under the picture in place of the parts' own, for as long as the longer of the two. Give an aspect ratio and each part fills it, cropped from the centre.

More

It only cuts, shapes and lays sound under. Takes timeline (sound clips on tracks), sound (file, optional). Returns video (the cut video as an MP4 that starts playing before it has downloaded, H.264 with AAC sound). Afterwards, change timeline with adjust; quote_adjustment prices the change.

Up to 30 minutes. Cut a video, on its own page.

Parameters

soundstring · optional

A file_id from create_upload, accepting audio/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

timelineobject · required

The video's parts as a mix's clips: {tracks: [{clips: [{file, at, from, to}]}]}. file is a video of yours (its file_id), from and to the part of it kept, in seconds, at where it starts in the result. Where parts overlap, the later track's is shown; where none is, the picture is black.

aspect_ratioone of · optional · default null

The aspect ratio it is made in, width to height. 9:16 is upright for stories and reels, 1:1 square, 4:5 portrait for feeds, 16:9 wide. Every part fills it, cropped from its centre, its longer side up to 1920 pixels. Left out, the first part's own.

9:16 1:1 4:5 16:9

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/cut_video" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timeline": {
      "tracks": [
        {
          "clips": [
            {
              "file": "FILE_ID",
              "at": 0,
              "from": 0,
              "to": 15
            },
            {
              "file": "FILE_ID",
              "at": 20,
              "from": 15,
              "to": 40
            }
          ]
        }
      ]
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/cut_video`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "timeline": {
        "tracks": [
          {
            "clips": [
              {
                "file": "FILE_ID",
                "at": 0,
                "from": 0,
                "to": 15
              },
              {
                "file": "FILE_ID",
                "at": 20,
                "from": 15,
                "to": 40
              }
            ]
          }
        ]
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/cut_video",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "timeline": {
            "tracks": [
                {
                    "clips": [
                        {
                            "file": "FILE_ID",
                            "at": 0,
                            "from": 0,
                            "to": 15,
                        },
                        {
                            "file": "FILE_ID",
                            "at": 20,
                            "from": 15,
                            "to": 40,
                        },
                    ],
                },
            ],
        },
    },
)
print(r.json())

Find the moments

POST/v1/tools/find_moments

Finds the moments in a recording that stand alone as clips, from its transcription: up to so many or exactly so many, each a run of whole sentences between a shortest and a longest length, with a title, when it is said, its opening words and why it stands alone, as a table. Takes transcript (file).

More

Returns moments (the moments, one row each in the order they are said, with its title, when it starts and ends, how many seconds it runs, its opening line and why it stands alone).

Up to 10 hours. Find the moments, on its own page.

Parameters

transcriptstring · required

A file_id from create_upload, accepting application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) makes one, or transcribe_audio (Transcribe audio) makes one: run it first and pass its job_id here.

momentsnumber · optional · default 5

The most moments it finds; fewer when fewer stand alone.

exactlyboolean · optional · default false

Finds exactly that many moments, where the recording holds them.

shortestnumber · optional · default 20

The shortest a moment runs, in seconds.

longestnumber · optional · default 60

Greater than shortest.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/find_moments" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/find_moments`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "transcript": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/find_moments",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "transcript": "JOB_ID",
    },
)
print(r.json())

Plan the cutaways

POST/v1/tools/plan_cutaways

Lays out a short from a video, a podcast or a webinar, from its transcription: the stretch by times or words, the speaker upright (audio alone: pictures), cutaways on key points (a webinar's: its shared screen), callouts on figures, a hook. Changes no word; makes no image.

More

The skill make-short-from-a-video makes it. Takes src (file), transcript (file). Returns timeline (the short as a timeline to change before it is made, upright, its lines said in the recording, the recording under everything (from audio alone, the cutaways one after another instead), each cutaway on its words saying what it shows (in a webinar, the shared screen at that moment where it fits), each callout a text box on its words, and its hook, its title or nothing on top, as asked).

Plan the cutaways, on its own page.

Parameters

srcstring · optional

A file_id from create_upload, accepting video/*, audio/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

transcriptstring · optional

A file_id from create_upload, accepting application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) from the file given as src when it is a video makes one, or transcribe_audio (Transcribe audio) from the file given as src when it is an audio file makes one: run it first and pass its job_id here.

momentstring · required

Which stretch, by its start and end (8:48 to 9:35) or by what is said in it, and what it is about; a title it gives names the short.

More

Or one row of a table: find_moments (Find the moments) from the file given as transcript makes the table, or plan_content (Plan content) from the file given as transcript makes the table, or write_content (Write content) from the file given as transcript makes the table; run it, then give one row's words here, every column by its label.

topone of · optional · default "hook_at_the_start"

What sits at the top of the short. Hook at the start is a line that makes someone stop scrolling, for its first 3 seconds; Title throughout names it the whole way through; None leaves the top clear.

hook_at_the_start title_throughout none

quietnumber · optional · default 1

Any quiet longer than this, in seconds, is cut down to half a second (or to this, when shorter), from the sound and the picture together.

speakernumber · optional · default 4

The longest the speaker is on screen before a cutaway, in seconds. From audio alone nobody is on screen, and every stretch is a cutaway.

cutawaynumber · optional · default 3

The longest a cutaway shows, in seconds; from audio alone, the longest each picture shows.

screenboolean · optional · default true

In a webinar or a call, where the speaker is in a small camera beside a shared screen, each cutaway that falls while the screen is shared shows the part of it that fits its words, at that moment, instead of a picture to make; it keeps what a picture would show, to make one in its place later. Off, every cutaway is a picture to make.

calloutsnumber · optional · default 4

The most callouts, each a figure or a short phrase said (at most five words), shown big on the words that say it; 0 for none.

brand_kitstring · optional

A Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/plan_cutaways" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "moment": "8:48 to 9:35, the first sell-out drop"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/plan_cutaways`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "moment": "8:48 to 9:35, the first sell-out drop"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/plan_cutaways",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "moment": "8:48 to 9:35, the first sell-out drop",
    },
)
print(r.json())

Study reference videos

POST/v1/tools/study_videos

Studies a few reference videos, such as the best Shorts in a field, and measures how each is made: when the first words land, every shot and cut, moves within a shot, words on screen and where, music under the voice, the ending.

More

Gives the patterns they share as taste rules a brand keeps, with where each shows. Takes videos (a list of files, up to 10). Returns rules (the taste rules the videos share, one row each, with the measure it is about and its lowest, usual and highest value among the videos that follow it, how many follow it of how many studied, and where it shows, by video and time), videos (each video measured, one row each, in the order given; times in seconds, moving shots and words on screen as a share of the video in %, music as decibels under the voice (empty where none plays under it)), shots (every shot of every video, one row each, with when it starts and ends, what it shows, how the picture moves and the words on screen with where they sit).

Up to 30 minutes. Study reference videos, on its own page.

Parameters

videosarray of string · required

A list: A file_id from create_upload, accepting video/*, up to 1 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used.

More

Pass the job_id rather than retyping its result. All of them are one job.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/study_videos" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "videos": [
      "FILE_ID",
      "FILE_ID"
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/study_videos`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "videos": [
        "FILE_ID",
        "FILE_ID"
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/study_videos",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "videos": [
            "FILE_ID",
            "FILE_ID",
        ],
    },
)
print(r.json())

Read a brand from a website

POST/v1/tools/read_brand

Reads a website's colours, fonts and logo into a draft Brand Kit to check: the page's background, text and accent colours from where the site's own CSS uses them, its fonts as Scrub draws them, its logo and its name, from a public web address. Takes address (text).

More

Returns kit (a draft Brand Kit's look (the page's background, its text and accent colours, its text font as Scrub draws it, and the logo), with everything found on the site and where it was used, to check before it is saved), logo (the site's logo, as the page draws it; an SVG keeps its drawing and nothing that runs or reaches out).

Read a brand from a website, on its own page.

Parameters

addressstring · required

The website's address, such as example.com or https://www.example.com/about. Only public websites are read; its home page usually says the most about its look.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/read_brand" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "ADDRESS"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/read_brand`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "address": "ADDRESS"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/read_brand",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "address": "ADDRESS",
    },
)
print(r.json())

Take a still

POST/v1/tools/take_still

One frame of a video as a picture (a still, a screenshot, a frame grab), taken at a time or where words are said, at the video's own pixels, never enlarged.

More

Cropped to the whole frame, the screen shared in a webinar or a call without its browser bars, call buttons or cameras, or the part of that screen that matters. Takes src (file), transcript (file). Give exactly one of: at; or said and transcript. Returns still (the frame as a PNG at the video's own pixels, cropped as asked and never enlarged; the result says its size).

Take a still, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

transcriptstring · optional

A file_id from create_upload, accepting application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) from the file given as src makes one: run it first and pass its job_id here.

atnumber · optional

The moment, in seconds from the video's start.

saidstring · optional

The moment by words said in it, as the transcription has them; the still is the frame in the middle of where they are first said, and the part that matters is what they are about.

cropone of · optional · default "whole_frame"

What the still shows. Whole frame is the frame as it is. Shared screen is the screen shared in a webinar or a call, without the browser's bars, the call's buttons or the cameras; where no screen is shared at that moment it is refused and not charged.

More

Part that matters is the part of that screen its words are about, or, at a time, the main picture it shows, such as the product or the chart, never smaller than a quarter of the screen each way.

whole_frame shared_screen part_that_matters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/take_still" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/take_still`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/take_still",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Draw a chart

POST/v1/tools/draw_chart

A table drawn as an animated chart (a line or bars, a graph) in a brand's colours and font, the line that matters drawn through its points and the answer settling on screen with what it says. A clip, transparent to lay over a video or on a colour, and a picture of the settled chart.

More

Takes table_file (file). Give exactly one of: table_file; or table_text. Returns clip (the chart drawn and settling, at the aspect ratio's size and 30 frames a second. With no background, a WebM whose background is transparent, to lie over a video; with one, an MP4), picture (the settled chart as a PNG, transparent where the clip is). Afterwards, change chart, says, note, title, answer, across, values, main, aspect_ratio, seconds, back, text, accent, gradient_from, gradient_to or font with adjust; quote_adjustment prices the change.

Draw a chart, on its own page.

Parameters

table_filestring · optional

A file_id from create_upload, accepting application/vnd.scrub.table+json, text/csv, text/tab-separated-values, application/json, text/plain, up to 20 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, read_fields (Read documents into a table) makes one, or study_videos (Study reference videos) makes one: run it first and pass its job_id here.

table_textstring · optional

A table typed or pasted, one row a line, values separated by commas or tabs, the first line the column names.

chartone of · optional · default "line"

A line through the points, for a change from one row to the next; or bars, for comparing rows side by side.

line bars

saysstring · optional

The words at the answer, the one thing the chart shows, such as "Mesh independent". Left empty, nothing is written there.

notestring · optional

A line under what it says, smaller, such as "finer cells stop changing the answer".

titlestring · optional

A title over the chart. Left empty, the chart has none, to sit under a title the video already has.

answerstring · optional

The row the chart settles on, by its name in the column that runs along the bottom. Left empty, the last row.

acrossstring · optional

The column whose values run along the bottom, by name. Left empty, the table's first column of words.

valuesstring · optional

The columns of numbers to draw, by name, comma separated, at most four. Left empty, every column of numbers.

mainstring · optional

Of the columns drawn, the one in the brand's colours with the answer on it, by name; the others are drawn quiet. Left empty, the first.

aspect_ratioone of · optional · default "9:16"

The aspect ratio it is drawn in, width to height. 9:16 fills an upright video; 16:9 is wide, or a band across an upright one.

9:16 1:1 4:5 16:9

secondsnumber · optional · default 6

How long the clip is. The line is drawn and the answer settles in the first part; the rest holds the settled chart.

backstring · optional · default null

The colour behind the chart. Left empty, none, so the clip is transparent and lies over a video.

textstring · optional · default "#1a1a1c"

The colour of the words and the points' rings; the axes and the quiet lines are mixed from it.

accentstring · optional · default "#1d4fd8"

The colour of the line that matters, the answer and what it says. What it says is written in the text colour where the accent would not read against the background.

gradient_fromstring · optional · default null

A colour the line that matters starts in, passing through the accent. Left empty, it starts in the accent.

gradient_tostring · optional · default null

A colour the line that matters ends in, from the accent. Left empty, it ends in the accent.

fontone of · optional · default "Inter Tight"

The font every word on the chart is set in. Inter Tight: Tight and even; every caption style's face. Inter: The plainest, most legible sans; explainers and data. Manrope: Calm, geometric and modern. Hanken Grotesk: Soft, open grotesque; friendly captions that stay easy to read.

More

Archivo: Sturdy grotesque with real weight; news and how-tos. Montserrat: The face most short-form captions are set in. Poppins: Round geometric sans; friendly brands and lifestyle. Figtree: Clean and warm, a little softer than Inter. Bricolage Grotesque: Quirky editorial sans. Rubik: Slightly rounded corners; playful but tidy. Bebas Neue: Tall capitals; titles, numbers and sport. Anton: Heavy, narrow capitals; the loudest hook text. Oswald: Condensed, with weights; lists and labels. League Gothic: Classic condensed gothic; posters and film titles. Fraunces: Soft, old-style serif; warm stories. Playfair Display: High-contrast serif; elegant titles. Instrument Serif: Narrow editorial serif. DM Serif Display: Bold display serif; quotes and headlines. PT Serif: Classic text serif with italics; reports, history and quotes. Caveat: Quick handwriting; notes and asides. Bangers: Comic-book capitals; reactions and gaming. Luckiest Guy: Fat cartoon capitals; kids, gaming and hooks. JetBrains Mono: Monospace; code, terminals and numbers that line up.

Inter Tight Inter Manrope Hanken Grotesk Archivo Montserrat Poppins Figtree Bricolage Grotesque Rubik Bebas Neue Anton Oswald League Gothic Fraunces Playfair Display Instrument Serif DM Serif Display PT Serif Caveat Bangers Luckiest Guy JetBrains Mono

brand_kitstring · optional

A Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/draw_chart" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/draw_chart`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/draw_chart",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Frame the speaker

POST/v1/tools/frame_speaker

Frames the speaker of a call or a webinar: crops round their face in the call's camera picture, clear of its edge and the name tag, enlarged and cleaned into a clip of its own with its sound, 4:5 for a card. Lists the shots with how much of each the speaker looks into the camera.

More

Takes src (file). Returns speaker (the speaker framed, as an MP4 in the aspect ratio asked, in time with the video and with its sound, enlarged and cleaned), shots (the shots of the speaker's clip, one row each in order, with when each starts and ends in the clip, whether it shows the speaker or no face, how much of it they look into the camera in %, and Use, Yes where that is at the eye contact asked or more).

Up to 10 minutes. Frame the speaker, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

aspect_ratioone of · optional · default "4:5"

The aspect ratio the speaker is framed in, width to height. 4:5 is a card for a Short or a feed, 9:16 upright, 1:1 square, 16:9 wide. The clip is made 1080 pixels wide (1920 at 16:9).

9:16 1:1 4:5 16:9

eye_contactnumber · optional · default 90

How much of a shot the speaker must look into the camera for it to be one to use, in %. Shots are split where their eye contact rises above this or falls below it.

fromnumber · optional · default null

Only this part, where it starts, in seconds into the video; the clip is that part, and only it is priced. Left out, from the start.

tonumber · optional · default null

Greater than from.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/frame_speaker" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/frame_speaker`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/frame_speaker",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Audio

Voice a script

POST/v1/tools/voice_script

Voices a script line by line in a chosen voice, in an accent when one is asked for, as one take with every word's time: each line's stretch of the audio, a changed line voiced again on its own, lines timed to subtitles or a video. Takes script (text).

More

Returns voice (the voice as one file, each line where it plays), script (the script with each line's stretch of the take, where it plays in the voice file and how long, and every word's time; given again with a line changed, only that line is voiced), timeline (given a video's timeline, the same timeline with each scene's stretch of the take, its length and its word timings set. None when given a script).

Up to 3600 seconds. Voice a script, on its own page.

Parameters

scriptstring or object · required

What is said, line by line, as one take in its voice, given exactly as the person wrote it, its notes word for word, never shortened or reworded: text, each paragraph a line (each line when no blank lines part them), a note wholly in brackets never said and a stretch of time in it, 0:00–0:20, where the line after it starts and ends, each part filling its time with its pauses and the voice ending at the last part's end, words before the first time never said; after a bar in the note, [0:00–0:20 | calm, slow], how the part is said; (pause) or (pause 2s) in a line, a pause there; a subtitle file's text, SRT or VTT, each cue a line that starts at its time; {lines: [{id, text, at?, until?, how?}], voice?: {name, accent?}, timing?: fit, cues or straight}, at and until in seconds; or a video's timeline, whose scenes are its lines.

More

A line voiced before, as it reads and in the same voice and accent, is reused; words moved between lines of one take are cut from it again, not voiced. Or the job_id of a finished job that made one, a draft's name (draft_…) or the file_id of one: what it holds is used as it is. Pass it rather than retyping its result. A script is text, or {lines: [{id, text, at?, until?, how?}], voice?: {name: one of Achernar (soft, female), Achird (friendly, male), Algenib (gravelly, male), Algieba (smooth, male), Alnilam (firm, male), Aoede (breezy, female), Autonoe (bright, female), Callirrhoe (easy-going, female), Charon (informative, male), Despina (smooth, female), Enceladus (breathy, male), Erinome (clear, female), Fenrir (excitable, male), Gacrux (mature, female), Iapetus (clear, male), Kore (firm, female), Laomedeia (upbeat, female), Leda (youthful, female), Orus (firm, male), Pulcherrima (forward, female), Puck (upbeat, male), Rasalgethi (informative, male), Sadachbia (lively, male), Sadaltager (knowledgeable, male), Schedar (even, male), Sulafat (warm, female), Umbriel (easy-going, male), Vindemiatrix (gentle, female), Zephyr (bright, female), Zubenelgenubi (casual, male); accent?: the accent it is said in, one of none (The voice's own), scottish (Scottish), irish (Irish), welsh (Welsh), british (British), american (American), australian (Australian) (none when left out; changing it voices every line again)}, timing?: fit (each line starts at its at and fills its time to its until, or to the next line's at, with its pauses; the voice ends at the last until), cues (each line starts at its at, the default for lines) or straight (one after another)}; how: how the line is said, such as calm and slow, never read out; {text, voice?, timing?} reads text as given, and text with times is fitted to them. In text, [0:00–0:16 | calm, slow] before a part times it and says how; (pause) or (pause 2s) in a line is a pause there. A subtitle file's text (SRT or VTT) is read as one line for each cue, at its times. Ids are short names, each used once; a line given back voiced keeps its recording, so send it back as it came to voice only what changed.

deliveryone of · optional · default "follow_the_notes"

Each part said as the note before it asks, after a bar, [0:00–0:16 | calm, slow], never read out; or one even reading of every part, as written.

follow_the_notes as_written

linesstring · optional

Some of the script's lines, by id, comma-separated, to voice only those, each on its own; every other line keeps the voice it has, a changed one still waiting to be voiced. Empty, every line that needs it is voiced.

voiceone of · optional · default "Kore"

Who says it, when the script names no voice of its own. Achernar: soft, female Achird: friendly, male Algenib: gravelly, male Algieba: smooth, male Alnilam: firm, male Aoede: breezy, female Autonoe: bright, female Callirrhoe: easy-going, female Charon: informative, male Despina: smooth, female Enceladus: breathy, male Erinome: clear, female Fenrir: excitable, male Gacrux: mature, female Iapetus: clear, male Kore: firm, female Laomedeia: upbeat, female Leda: youthful, female Orus: firm, male Pulcherrima: forward, female Puck: upbeat, male Rasalgethi: informative, male Sadachbia: lively, male Sadaltager: knowledgeable, male Schedar: even, male Sulafat: warm, female Umbriel: easy-going, male Vindemiatrix: gentle, female Zephyr: bright, female Zubenelgenubi: casual, male

Achernar Achird Algenib Algieba Alnilam Aoede Autonoe Callirrhoe Charon Despina Enceladus Erinome Fenrir Gacrux Iapetus Kore Laomedeia Leda Orus Pulcherrima Puck Rasalgethi Sadachbia Sadaltager Schedar Sulafat Umbriel Vindemiatrix Zephyr Zubenelgenubi

voice_likestring · optional

What the voice should sound like, in the person's words, such as a calm man, when no voice is named. The voices recommended follow it; it is never read out.

accentone of · optional · default "none"

The accent it is said in, with any voice, when the script names none; the voice's own when none is chosen. Changing it voices every line again. none: the voice as it speaks, no accent asked for

none scottish irish welsh british american australian

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/voice_script" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "script": "Three tricks for a faster reel."
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/voice_script`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "script": "Three tricks for a faster reel."
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/voice_script",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "script": "Three tricks for a faster reel.",
    },
)
print(r.json())

Text to speech

POST/v1/tools/text_to_speech

Generates speech from text, turning text into speech (text to speech, TTS): the words read aloud as one audio file, such as a voiceover or narration, in a chosen voice and accent, male or female, from soft to firm, as one take.

Takes text (text). Returns speech (the text spoken, as one file).

Up to 3600 seconds. Text to speech, on its own page.

Parameters

textstring · required

What is said, exactly as written, as one take; any language. Written first in brackets, [calm, slow], how it is said, never read out; (pause) or (pause 2s), a pause there.

voiceone of · optional · default "Kore"

Who says it. Achernar: soft, female Achird: friendly, male Algenib: gravelly, male Algieba: smooth, male Alnilam: firm, male Aoede: breezy, female Autonoe: bright, female Callirrhoe: easy-going, female Charon: informative, male Despina: smooth, female Enceladus: breathy, male Erinome: clear, female Fenrir: excitable, male Gacrux: mature, female Iapetus: clear, male Kore: firm, female Laomedeia: upbeat, female Leda: youthful, female Orus: firm, male Pulcherrima: forward, female Puck: upbeat, male Rasalgethi: informative, male Sadachbia: lively, male Sadaltager: knowledgeable, male Schedar: even, male Sulafat: warm, female Umbriel: easy-going, male Vindemiatrix: gentle, female Zephyr: bright, female Zubenelgenubi: casual, male

Achernar Achird Algenib Algieba Alnilam Aoede Autonoe Callirrhoe Charon Despina Enceladus Erinome Fenrir Gacrux Iapetus Kore Laomedeia Leda Orus Pulcherrima Puck Rasalgethi Sadachbia Sadaltager Schedar Sulafat Umbriel Vindemiatrix Zephyr Zubenelgenubi

howstring · optional

How the words are said, in your own words, such as calm and slow; never read out. Empty, as the voice says them.

voice_likestring · optional

What the voice should sound like, in the person's words, such as a calm man, when no voice is named. The voices recommended follow it; it is never read out.

accentone of · optional · default "none"

The accent it is said in, with any voice; the voice's own when none is chosen. none: the voice as it speaks, no accent asked for

none scottish irish welsh british american australian

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/text_to_speech" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Three tricks for a faster reel."
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/text_to_speech`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "text": "Three tricks for a faster reel."
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/text_to_speech",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "text": "Three tricks for a faster reel.",
    },
)
print(r.json())

Mix and finish a sound

POST/v1/tools/mix_a_recording

A recording made into one finished sound from its timeline: cut into clips with gaps where you want them, each clip's voice cleaned up or played through a speaker, in a room or on a phone line, speech and music made for the clips that say what they hold, Scrub's chimes and room sounds laid in, and everything mixed into one M4A as long as the last clip's end.

More

A clip whose sound is already made is used as it is and not made again. Takes timeline (sound clips on tracks). Returns sound (the mix as one sound, an M4A, as long as the last clip's end, brought to an even loudness without clipping). One job: making the speech, then voicing the scripts, then making the music, then cleaning up the voices, then adding the effects, then adding the effects, then adding the effects, then mixing. Afterwards, change the result with adjust on the job of the step that made it, listed in the result.

Up to 90 minutes. Mix and finish a sound, on its own page.

Parameters

timelineobject · required

The tracks and their clips, as Mix sounds takes them, each clip with the work to do on it named by its action and holding that action's settings: clean_up_voice, add_voice_effect, add_voice_effect_2 and add_voice_effect_3 (through and room, stacked in that order) on its file; text_to_speech, voice_script or generate_music to make its sound when it has no file yet.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/mix_a_recording" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timeline": {
      "tracks": [
        {
          "clips": [
            {
              "sound": "bright_chime",
              "at": 0,
              "to": 3
            }
          ]
        },
        {
          "clips": [
            {
              "file": "FILE_ID",
              "at": 2.5,
              "to": 30,
              "clean_up_voice": {}
            }
          ]
        }
      ]
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/mix_a_recording`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "timeline": {
        "tracks": [
          {
            "clips": [
              {
                "sound": "bright_chime",
                "at": 0,
                "to": 3
              }
            ]
          },
          {
            "clips": [
              {
                "file": "FILE_ID",
                "at": 2.5,
                "to": 30,
                "clean_up_voice": {}
              }
            ]
          }
        ]
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/mix_a_recording",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "timeline": {
            "tracks": [
                {
                    "clips": [
                        {
                            "sound": "bright_chime",
                            "at": 0,
                            "to": 3,
                        },
                    ],
                },
                {
                    "clips": [
                        {
                            "file": "FILE_ID",
                            "at": 2.5,
                            "to": 30,
                            "clean_up_voice": {},
                        },
                    ],
                },
            ],
        },
    },
)
print(r.json())

Mix and finish a video's sound

POST/v1/tools/mix_a_video

A video's sound finished from its timeline as Mix and finish a sound finishes one, every clip's voice cleaned up or given its effects, speech, music and Scrub's sounds laid in and mixed, then the video cut as its clips are laid, black in any gap, with the finished sound under it.

More

Gives the video and the sound. Takes timeline (sound clips on tracks). Returns video (the cut video as an MP4 that starts playing before it has downloaded, H.264 with AAC sound). One job: making the speech, then voicing the scripts, then making the music, then cleaning up the voices, then adding the effects, then adding the effects, then adding the effects, then mixing, then cutting the video. Afterwards, change the result with adjust on the job of the step that made it, listed in the result.

Up to 30 minutes. Mix and finish a video's sound, on its own page.

Parameters

timelineobject · required

The tracks and their clips, as Mix and finish a sound takes them: the video's own clips on the first track, each with the work to do on it named by its action and holding that action's settings.

pictureobject · required

The video's clips as the timeline lays them, before any work on them, {tracks: [{clips: [{file, at, from, to}]}]}: the video is cut the same way, with the finished sound under it.

aspect_ratioone of · optional · default null

The aspect ratio the video is made in, width to height. 9:16 is upright for stories and reels, 1:1 square, 4:5 portrait for feeds, 16:9 wide. Every clip fills it, cropped from its centre. Left out, the first clip's own.

9:16 1:1 4:5 16:9

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/mix_a_video" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timeline": {
      "tracks": [
        {
          "clips": [
            {
              "file": "FILE_ID",
              "at": 0,
              "from": 0,
              "to": 15,
              "clean_up_voice": {}
            },
            {
              "file": "FILE_ID",
              "at": 20,
              "from": 15,
              "to": 40,
              "clean_up_voice": {}
            }
          ]
        }
      ]
    },
    "picture": {
      "tracks": [
        {
          "clips": [
            {
              "file": "FILE_ID",
              "at": 0,
              "from": 0,
              "to": 15
            },
            {
              "file": "FILE_ID",
              "at": 20,
              "from": 15,
              "to": 40
            }
          ]
        }
      ]
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/mix_a_video`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "timeline": {
        "tracks": [
          {
            "clips": [
              {
                "file": "FILE_ID",
                "at": 0,
                "from": 0,
                "to": 15,
                "clean_up_voice": {}
              },
              {
                "file": "FILE_ID",
                "at": 20,
                "from": 15,
                "to": 40,
                "clean_up_voice": {}
              }
            ]
          }
        ]
      },
      "picture": {
        "tracks": [
          {
            "clips": [
              {
                "file": "FILE_ID",
                "at": 0,
                "from": 0,
                "to": 15
              },
              {
                "file": "FILE_ID",
                "at": 20,
                "from": 15,
                "to": 40
              }
            ]
          }
        ]
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/mix_a_video",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "timeline": {
            "tracks": [
                {
                    "clips": [
                        {
                            "file": "FILE_ID",
                            "at": 0,
                            "from": 0,
                            "to": 15,
                            "clean_up_voice": {},
                        },
                        {
                            "file": "FILE_ID",
                            "at": 20,
                            "from": 15,
                            "to": 40,
                            "clean_up_voice": {},
                        },
                    ],
                },
            ],
        },
        "picture": {
            "tracks": [
                {
                    "clips": [
                        {
                            "file": "FILE_ID",
                            "at": 0,
                            "from": 0,
                            "to": 15,
                        },
                        {
                            "file": "FILE_ID",
                            "at": 20,
                            "from": 15,
                            "to": 40,
                        },
                    ],
                },
            ],
        },
    },
)
print(r.json())

Clean up a voice

POST/v1/tools/clean_up_voice

Cleans up the voice in a recording, audio or video, whole or in stretches, each with its own setting: sharp S sounds and bursts of hiss softened. A video's picture is kept as it is. Returns the recording and the moments found and treated, with their times, so later work can aim at them.

More

Takes src (file). Returns recording, moments (the moments found and treated, one row each in order, with when each starts and ends, its setting and how many dB it was turned down; one found where the sound was left as it is says so, at 0). Afterwards, change parts, s_sounds, highs_from, listen_above, sensitivity, amount, recovery or steady with adjust; quote_adjustment prices the change.

Up to 360 minutes. Clean up a voice, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting audio/*, video/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

partsarray of object · optional · default []

The stretches to clean up, each a from and a to in seconds, and any settings of its own; left out, the whole recording. Outside the stretches the sound is left as it is.

s_soundsone of · optional · default "softer"

How hard sharp S sounds and bursts of hiss are softened. As recorded (as_recorded) leaves them; Softer (softer) turns them down while the voice is untouched; Softest (softest) turns down quieter ones too; Custom (custom) uses the six values below.

as_recorded softer softest custom

highs_fromnumber · optional · default 4000

With S sounds Custom, above this the sound can be turned down; below it the voice is never touched. In hertz.

listen_abovenumber · optional · default 11000

With S sounds Custom, only sound this high decides when to turn down. In hertz.

sensitivitynumber · optional · default -54

With S sounds Custom, how quiet a burst may be and still be turned down; lower turns down more. In dB.

amountnumber · optional · default 20

With S sounds Custom, how hard it turns down, as a ratio to 1.

recoverynumber · optional · default 40

With S sounds Custom, how soon the highs come back after a burst. In milliseconds.

steadynumber · optional · default 4

With S sounds Custom, how much softer the highs are all the time, as well. In dB.

fromnumber · optional · default null

Only this part, where it starts, in seconds into the sound; the result is that part, and only it is priced. Left out, from the start.

tonumber · optional · default null

Greater than from.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/clean_up_voice" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/clean_up_voice`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/clean_up_voice",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Add a voice effect

POST/v1/tools/add_voice_effect

Makes a voice or any sound sound as heard where it plays: through loudspeakers, a phone line, a horn, a small speaker, an intercom or headphones, in a hall, shop, warehouse, kitchen or cabin, with a chime or ring before it and the room's sound around it, as an airport announcement or a call.

More

Its first 15 s free. Takes src (file). Returns sound (the sound as heard where it plays, an M4A, longer than the sound given by the sound before it and the room's echo after it). Afterwards, change through, room, first or around with adjust; quote_adjustment prices the change.

Up to 90 minutes. Add a voice effect, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting audio/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

throughone of · optional · default "loudspeakers"

What it plays through. Nothing (none) leaves the sound as it is. none: The sound as it is loudspeakers: Public address speakers, the far ones a beat behind ceiling_speakers: Speakers overhead, as in a shop horn: Hard and loud, as on a site phone: As a call carries it small_speaker: A speaker on a counter intercom: A small speaker in a ceiling, as on a plane or a train headphones: Close and full

none loudspeakers ceiling_speakers horn phone small_speaker intercom headphones

roomone of · optional · default "none"

The room it plays in, heard as its echo. No room (none) adds none. none: Nothing around it big_hall: Three seconds of echo shop: A bright room, under two seconds warehouse: Steel and concrete kitchen: Tiles, a short echo cabin: Small and close

none big_hall shop warehouse kitchen cabin

firstone of · optional · default "none"

A sound played before it, through the same speaker, such as a chime. Nothing (none) starts with the sound. none: It starts with the sound three_chime: Three bell tones, rising two_chime: Ding, dong bright_chime: Two high tones, short ring: Rung twice, then answered

none three_chime two_chime bright_chime ring

aroundone of · optional · default "none"

The room's own sound, heard under it from a moment before it starts. Nothing (none) adds none. none: Only the sound busy_hall: Voices far off, air, wheels rolling shoppers: A few people, a till beeping machines: Lights humming, fans, something reversing fridge: A fridge humming engines: A steady low roar visitors: Quiet voices in a big room

none busy_hall shoppers machines fridge engines visitors

fromnumber · optional · default null

Only this part, where it starts, in seconds into the sound; the result is that part, and only it is priced. Left out, from the start.

tonumber · optional · default null

Greater than from.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/add_voice_effect" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/add_voice_effect`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/add_voice_effect",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Mix sounds

POST/v1/tools/mix_sounds

Mixes sound clips on tracks into one M4A: parts of a recording, voices, music and Scrub's chimes and room sounds, each at its moment and level, a room's sound looped, music lowered under a voice if asked, so a recording can be cut into clips with gaps. As long as the last clip's end.

More

It only mixes. Takes timeline (sound clips on tracks). Returns sound (the mix as one sound, an M4A, as long as the last clip's end, brought to an even loudness without clipping). Afterwards, change timeline with adjust; quote_adjustment prices the change.

Up to 90 minutes. Mix sounds, on its own page.

Parameters

timelineobject · required

The tracks, each a list of clips: {tracks: [{gain_db?, voice?, clips: [{file or sound, at, from?, to, loop?, gain_db?}]}]}.

More

A clip is a sound or video file of yours (file, its file_id) or one of Scrub's sounds, by its name (sound), the chimes and room sounds Add a voice effect plays; at is where it starts on the timeline, from and to the part of its sound used, in seconds (a chime runs about 2 to 3 seconds, a room's sound 30 and loops); loop repeats it to fill that part; gain_db makes a clip or a whole track louder or quieter. voice: true says a track is someone speaking: while it speaks, every other track is lowered under it, so the words are heard over the music, and comes back up when it stops. Off unless set.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/mix_sounds" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timeline": {
      "tracks": [
        {
          "clips": [
            {
              "sound": "bright_chime",
              "at": 0,
              "to": 3
            }
          ]
        },
        {
          "clips": [
            {
              "file": "FILE_ID",
              "at": 2.5,
              "to": 30
            }
          ]
        }
      ]
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/mix_sounds`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "timeline": {
        "tracks": [
          {
            "clips": [
              {
                "sound": "bright_chime",
                "at": 0,
                "to": 3
              }
            ]
          },
          {
            "clips": [
              {
                "file": "FILE_ID",
                "at": 2.5,
                "to": 30
              }
            ]
          }
        ]
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/mix_sounds",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "timeline": {
            "tracks": [
                {
                    "clips": [
                        {
                            "sound": "bright_chime",
                            "at": 0,
                            "to": 3,
                        },
                    ],
                },
                {
                    "clips": [
                        {
                            "file": "FILE_ID",
                            "at": 2.5,
                            "to": 30,
                        },
                    ],
                },
            ],
        },
    },
)
print(r.json())

Generate music

POST/v1/tools/generate_music

Composes music, for a video or anything else, from a description of its mood, instruments and pace, up to an hour, as an MP3: instrumental unless singing is asked for, or a song sung with given lyrics. Past three minutes, its three minutes play on, crossfaded each time they begin again.

Takes prompt (text), lyrics (text). Returns music (the music, an MP3).

Up to 3600 seconds. Generate music, on its own page.

Parameters

promptstring · required

The music in a sentence or a few, such as its mood, instruments, pace and who sings; any language. Instrumental unless you ask for singing or give lyrics.

lyricsstring · optional

Words to sing, in any language, its parts marked like [Verse] and [Chorus] if you like; sung as written. Without them it is instrumental, unless the prompt asks for singing, when lyrics are written for it.

secondsnumber · optional · default 30

How long it runs, in seconds, up to an hour; past three minutes, its three minutes play on, crossfaded each time they begin again. It ends in a fade.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/generate_music" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Lo-fi hip hop, warm keys, 85 bpm"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/generate_music`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "prompt": "Lo-fi hip hop, warm keys, 85 bpm"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/generate_music",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "prompt": "Lo-fi hip hop, warm keys, 85 bpm",
    },
)
print(r.json())

Transcribe audio

POST/v1/tools/transcribe_audio

Transcribes audio, such as a call, a podcast or a voice note: writes down what is said, every word with its time (speech to text), in the language it detects or the one given.

Takes src (file). Returns transcript.

Afterwards, change language with adjust; quote_adjustment prices the change.

Up to 360 minutes. Transcribe audio, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting audio/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

languagestring · optional · default "auto"

Left as auto, the language is detected. To choose one, give its code, such as en, fr or de.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/transcribe_audio" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/transcribe_audio`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/transcribe_audio",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Transcribe a video

POST/v1/tools/transcribe

Transcribes a video: writes down what is said in it, every word with its time (speech to text), in the language it detects or the one given.

Takes src (file). Returns transcript.

Afterwards, change language with adjust; quote_adjustment prices the change.

Up to 360 minutes. Transcribe a video, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.

languagestring · optional · default "auto"

Left as auto, the language is detected. To choose one, give its code, such as en, fr or de.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/transcribe" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/transcribe`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/transcribe",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Extract audio from a video

POST/v1/tools/extract_audio

Extracts the audio from a video as an audio file (M4A), the whole length, copied untouched when it can be. Useful on its own, and much smaller to send than the video when only the sound is needed, such as to transcribe it. A video with no sound is refused.

Takes src (file). Returns audio.

Up to 6 hours. Extract audio from a video, on its own page.

Parameters

srcstring · required

A file_id from create_upload, accepting video/*, up to 4 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used.

More

Pass the job_id rather than retyping its result. Or a file_id (cf_…) from list_computers: a file on the person’s computer, run there by the Scrub app while it is open, at the price there.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/extract_audio" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "src": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/extract_audio`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "src": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/extract_audio",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "src": "FILE_ID",
    },
)
print(r.json())

Images

Generate an image

POST/v1/tools/generate_image

Creates an image from a description (text to image), upright, square, portrait or wide, as a JPEG. Reference images, optional, keep a person, a product, a place or a look from images you give (image to image).

Takes prompt (text), references (a list of files, up to 3, optional). Returns image (the image, a JPEG).

Generate an image, on its own page.

Parameters

referencesarray of string · optional

A list: A file_id from create_upload, accepting image/jpeg, image/png, image/webp, up to 20 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. All of them are one job.

promptstring · required

What the image shows and how it looks, in a sentence or a few; any language. It has no words in it unless you ask for them.

modelone of · optional · default "recommended"

The model that draws it. Recommended is Scrub's pick for what the words ask, the best scored for the price; the others by name, each at its own price. The words choose the model, and so the price: a quote holds for the exact words it priced.

recommended Nano Banana 2 Nano Banana Pro GPT Image 2

aspect_ratioone of · optional · default "1:1"

Its aspect ratio, width to height.

9:16 1:1 4:5 16:9

styleone of · optional · default "none"

A style it is drawn in, the same for every picture of a set so they belong together. Papercraft is layered cut-paper shapes in soft greens and ochre. None draws it as the prompt says.

none papercraft

goes_withstring · optional

For a video, what goes with the line the prompt says, such as what the video is about. Scrub picks what to show, never words. Empty, it draws the prompt.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/generate_image" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A neon ramen bar at night, rain"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/generate_image`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "prompt": "A neon ramen bar at night, rain"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/generate_image",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "prompt": "A neon ramen bar at night, rain",
    },
)
print(r.json())

Draw a diagram

POST/v1/tools/draw_diagram

Draws an idea as a clean, flat, labelled diagram (an explainer figure, a schematic, a before and after, a process), every label spelled exactly as given in the brand's font and colours, readable on a phone. Gives a PNG at full size and an SVG to edit.

More

Takes explains (text), labels (text), title (text). Returns image (the drawing as a PNG, 1080 pixels wide, or 1080 tall when wide), drawing (the same drawing as an SVG, its labels as text in the font, which travels with it, to edit in any design tool).

Draw a diagram, on its own page.

Parameters

explainsstring · required

The idea the drawing shows, in a sentence or a few, such as finer cells near a wing where the flow changes fastest.

labelsstring · optional

The words on the drawing, one label a line, each spelled exactly as it is drawn; at most 10, each at most 60 characters.

titlestring · optional

A heading across the top, spelled exactly as it is drawn; none when left out.

aspect_ratioone of · optional · default "1:1"

Its aspect ratio, width to height. 1080 pixels wide, or 1080 tall when wide.

9:16 1:1 4:5 16:9

backgroundstring · optional · default "#f5f5f3"

The colour of the ground, such as a Brand Kit's background.

textstring · optional · default "#1a1a1c"

The colour of the words and outlines, such as a Brand Kit's text; it must read on the background.

accentstring · optional · default "#1d4fd8"

The one colour that marks the point of the drawing, such as a Brand Kit's accent.

fontone of · optional · default "Inter Tight"

The font every label is set in, such as a Brand Kit's font. Inter Tight: Tight and even; every caption style's face. Inter: The plainest, most legible sans; explainers and data. Manrope: Calm, geometric and modern.

More

Hanken Grotesk: Soft, open grotesque; friendly captions that stay easy to read. Archivo: Sturdy grotesque with real weight; news and how-tos. Montserrat: The face most short-form captions are set in. Poppins: Round geometric sans; friendly brands and lifestyle. Figtree: Clean and warm, a little softer than Inter. Bricolage Grotesque: Quirky editorial sans. Rubik: Slightly rounded corners; playful but tidy. Bebas Neue: Tall capitals; titles, numbers and sport. Anton: Heavy, narrow capitals; the loudest hook text. Oswald: Condensed, with weights; lists and labels. League Gothic: Classic condensed gothic; posters and film titles. Fraunces: Soft, old-style serif; warm stories. Playfair Display: High-contrast serif; elegant titles. Instrument Serif: Narrow editorial serif. DM Serif Display: Bold display serif; quotes and headlines. PT Serif: Classic text serif with italics; reports, history and quotes. Caveat: Quick handwriting; notes and asides. Bangers: Comic-book capitals; reactions and gaming. Luckiest Guy: Fat cartoon capitals; kids, gaming and hooks. JetBrains Mono: Monospace; code, terminals and numbers that line up.

Inter Tight Inter Manrope Hanken Grotesk Archivo Montserrat Poppins Figtree Bricolage Grotesque Rubik Bebas Neue Anton Oswald League Gothic Fraunces Playfair Display Instrument Serif DM Serif Display PT Serif Caveat Bangers Luckiest Guy JetBrains Mono

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/draw_diagram" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "explains": "Finer cells near the wing"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/draw_diagram`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "explains": "Finer cells near the wing"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/draw_diagram",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "explains": "Finer cells near the wing",
    },
)
print(r.json())

Plan the slides

POST/v1/tools/plan_slides

Plans an explainer video's slides, to be shown while a script is said with a voiceover, kept word for word: a slide every few lines, laid out to make each point clear, with the words to remember highlighted as they are said and a picture place for each part.

More

The skill make-narrated-video makes the video from them. Takes script (text). Returns timeline (the script as a timeline, scene by scene with what is said, and its slides, each with its words on screen, the words to remember marked to light as they are said, its cards and icons, and its picture places with what each shows, every part coming in on the word that says it).

Up to 60 minutes. Plan the slides, on its own page.

Parameters

scriptstring · required

What is said, word for word, in its own language. Scene labels, directions in round brackets and words in square brackets are read as a script's are, and never said.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/plan_slides" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "script": "Most creators post daily and stall."
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/plan_slides`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "script": "Most creators post daily and stall."
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/plan_slides",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "script": "Most creators post daily and stall.",
    },
)
print(r.json())

Writing

Write content

POST/v1/tools/write_content

Writes posts for X or LinkedIn, Instagram captions, blog posts, reels plans, recaps, newsletters, emails or show notes from words, a document or a transcription, one kind or several in one run: it decides how many distinct pieces it holds, up to the most asked for of each, and writes each, ready to post, one row each.

More

Takes file (file). Give exactly one of: source; or file. Returns pieces (the pieces written, one row each, strongest first, each with its title and its text ready to post), text (every piece under its title, as one text to read or copy).

Up to 90 pieces. Write content, on its own page.

Parameters

filestring · optional

A file_id from create_upload, accepting text/plain, text/markdown, application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) makes one, or transcribe_audio (Transcribe audio) makes one: run it first and pass its job_id here.

sourcestring · optional

The words to write from, typed or pasted, up to 60,000 characters (about 45 minutes of fast speech); an article, notes, a transcript or a script.

skillarray of one of · optional · default "LinkedIn post"

What it writes, one kind or several in one run (LinkedIn post and Blog post), each up to At most pieces. A recap, a newsletter, an email or show notes covers the whole source, so one is usually written.

mostnumber · optional · default 5

The most pieces it writes of each kind; fewer when the source holds fewer distinct points.

lengthone of · optional · default "standard"

How long each piece runs, within its kind's own limits.

short standard long

piecesarray of object · optional · default []

The pieces to write, one by one, in place of Write and At most: each its kind and, from a plan, its idea, angle and moment; a length in its kind's own unit (characters for a post or caption, words for a blog post, newsletter, email, recap or show notes, seconds for a reels plan); or up_to, as many as the source holds of that kind up to that number.

audiencestring · optional

Who it is written for, in a few words; left empty, for whoever the source speaks to.

tonestring · optional

How the brand sounds, in a few words or a sentence (warm, direct, no jargon); left empty, as the source sounds.

brand_kitstring · optional

A Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/write_content" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/write_content`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/write_content",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Plan content

POST/v1/tools/plan_content

Plans the posts, captions, blog posts, reels plans, recaps, newsletters or show notes worth writing from words, a document or a transcription: the distinct ideas it holds, each with the moment it starts, and the pieces that would work best from each, one row each, before anything is written.

More

Takes file (file). Give exactly one of: source; or file. Returns plan (the pieces proposed, one row each, read by the idea each comes from, with its kind and its angle; an idea with nothing proposed has a row of its own. Its rows are the pieces Write content is given to write), text (every idea and the pieces proposed from it, as one text to read).

Plan content, on its own page.

Parameters

filestring · optional

A file_id from create_upload, accepting text/plain, text/markdown, application/vnd.scrub.transcript+json, application/json, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) makes one, or transcribe_audio (Transcribe audio) makes one: run it first and pass its job_id here.

sourcestring · optional

The words to plan from, typed or pasted, up to 60,000 characters (about 45 minutes of fast speech); an article, notes, a transcript or a script.

audiencestring · optional

Who it is written for, in a few words; it proposes what works best for them. Left empty, whoever the source speaks to.

tonestring · optional

How the brand sounds, in a few words or a sentence; left empty, as the source sounds.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/plan_content" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/plan_content`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/plan_content",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Draft a video script

POST/v1/tools/write_script

Drafts a narrated video, such as a short with a voiceover over pictures, from an idea, or divides a script of up to an hour into scenes, every word kept, its labels and directions never said: what is said, the words on screen, the images and the music.

More

The skill make-narrated-video makes the video from it. Takes idea (text). Returns timeline (the draft as a timeline, scene by scene, each with what is said and the words on screen, and its images, each from a moment of the line with what it shows, and the music it asks for, in words, to change before it is voiced and made).

Draft a video script, on its own page.

Parameters

ideastring · required

What the video is about, in a sentence or a few; or a script of up to an hour, whose words are kept as they are, divided into scenes, in its own language. Music it asks for is described in the draft.

secondsnumber · optional · default 30

About how long a video drafted from an idea runs, in seconds. A script given keeps its own length, whatever this says.

picturesone of · optional · default "images"

How its images are described. Images, as a picture; videos, as a shot of at most 8 seconds, what moves, how the camera moves and the sound of the place, for a clip to be made from.

images videos

brand_kitstring · optional

A Brand Kit's id (kit_…) from list_brand_kits: its look and settings fill what this call leaves out, and what the call gives wins. Read once when the job starts.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/write_script" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "idea": "Why short videos get watched to the end"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/write_script`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "idea": "Why short videos get watched to the end"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/write_script",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "idea": "Why short videos get watched to the end",
    },
)
print(r.json())

Convert a transcript

POST/v1/tools/convert

Writes a transcript as subtitles (SRT or VTT), text, Markdown, HTML or JSON, grouped by caption, sentence, paragraph or word, from a transcription or a transcript or subtitle file; the whole of it, or a stretch timed from its start. Takes transcript_file (file). Returns file.

More

Afterwards, change as or by with adjust; quote_adjustment prices the change.

Convert a transcript, on its own page.

Parameters

transcript_filestring · required

A file_id from create_upload, accepting application/vnd.scrub.transcript+json, application/json, application/x-subrip, text/vtt, text/plain, up to 16 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, transcribe (Transcribe a video) makes one, or transcribe_audio (Transcribe audio) makes one: run it first and pass its job_id here.

asone of · optional · default "srt"

How it is written. srt and vtt are subtitle files; markdown and html carry a timestamp on each part.

text markdown html json srt vtt

byone of · optional · default "auto"

How words are grouped. auto is caption for srt and vtt, paragraph for text, markdown and html, and word for json. Captions are at most two lines of 42 characters and seven seconds.

auto caption sentence paragraph word

startnumber · optional · default 0

Seconds into the transcript where the stretch begins; its words are timed from here.

endnumber · optional · default 0

Seconds into the transcript where the stretch ends; at 0 it runs to the end.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/convert" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript_file": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/convert`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "transcript_file": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/convert",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "transcript_file": "JOB_ID",
    },
)
print(r.json())

Documents

Read documents into a table

POST/v1/tools/read_fields

Reads photos, scans or PDFs into a table (data extraction), one row per item found, with the columns asked for or chosen from what is printed. Takes documents (a list of files, up to 200). Returns rows (the table read, one row per item found, with the file and page each came from).

More

Afterwards, change fields or row with adjust; quote_adjustment prices the change.

Up to 200 pages. Read documents into a table, on its own page.

Parameters

documentsarray of string · required

A list: A file_id from create_upload, accepting image/jpeg, image/png, image/webp, image/heic, image/heif, application/pdf, up to 14 MB a photo, 30 MB a PDF. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. All of them are one job.

fieldsarray of object · optional · default []

What to read, each a column of the table. A field has a name, what it means when the name is not enough, and the kind of value it is (text, number, amount, currency, date, or one of a list of choices). Left empty, the columns are chosen from what is printed on the documents.

rowstring · optional · default "document"

Left as document, every document is read, and each row says what kind it is. Name a kind, such as invoice, or several joined by or, and anything else is left out and not charged. Several on one page, or one running over several pages, are each one row.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/read_fields" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      "FILE_ID"
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/read_fields`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "documents": [
        "FILE_ID"
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/read_fields",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "documents": [
            "FILE_ID",
        ],
    },
)
print(r.json())

Read documents as text

POST/v1/tools/read_text

Reads the text of photos, scans and PDFs (OCR), every page, each headed by its file and page.

Takes documents (a list of files, up to 200). Returns text (the text of every page, each headed by its file and page), pages.

Up to 200 pages. Read documents as text, on its own page.

Parameters

documentsarray of string · required

A list: A file_id from create_upload, accepting image/jpeg, image/png, image/webp, image/heic, image/heif, application/pdf, up to 20 MB a photo, 30 MB a PDF. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. All of them are one job.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/read_text" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "documents": [
      "FILE_ID"
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/read_text`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "documents": [
        "FILE_ID"
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/read_text",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "documents": [
            "FILE_ID",
        ],
    },
)
print(r.json())

Make a spreadsheet

POST/v1/tools/make_spreadsheet

Writes a spreadsheet as an Excel file and a CSV: sheets with formulas, formats and tabs, or a table another action read, a CSV or JSON file, or rows typed or pasted. Takes table_file (file). Give exactly one of: workbook; or table_file; or table_text.

More

Returns excel, csv, table (the table as written into the files). Afterwards, change columns or sheet with adjust; quote_adjustment prices the change.

Make a spreadsheet, on its own page.

Parameters

table_filestring · optional

A file_id from create_upload, accepting application/vnd.scrub.table+json, text/csv, text/tab-separated-values, application/json, text/plain, up to 20 MB. Get one with create_upload.

More

Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result. Without one, read_fields (Read documents into a table) makes one, or study_videos (Study reference videos) makes one: run it first and pass its job_id here.

workbookobject · optional

The spreadsheet, sheet by sheet, each cell by its address, with formulas and formats.

table_textstring · optional

A table typed or pasted, one row a line, values separated by commas or tabs, the first line the column names.

columnsstring · optional

Which columns to include, in order, by name, comma separated. Leave it empty for every column.

sheetstring · optional · default "Sheet 1"

The name of the sheet in the Excel file.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/make_spreadsheet" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "table_file": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/make_spreadsheet`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "table_file": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/make_spreadsheet",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "table_file": "JOB_ID",
    },
)
print(r.json())

Reference

Prices and jobs

Quote before, follow a job, change a finished one.

Price work before it runs

POST/v1/tools/quote

Prices one call or a whole chain of calls before anything runs, with the workspace spending cap. Writes nothing and charges nothing. Where Scrub can tell, it also says about how big a file would come out.

Parameters

stepsarray of object · required

The calls, in the order they would run, each priced on its own. A chain run as one job is one step, {tool: "run_flow", arguments} as run_flow takes them, priced once on the whole chain.

recommendarray of string · optional

Settings, by name, such as voice or quality, to recommend a value for where a step leaves one out: that step answers recommended, the best for its material first, each with why where Scrub gives one. A step that sets it answers none.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/quote" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "steps": [
      {
        "tool": "transcribe_audio",
        "arguments": {
          "src": "FILE_ID"
        }
      }
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/quote`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "steps": [
        {
          "tool": "transcribe_audio",
          "arguments": {
            "src": "FILE_ID"
          }
        }
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/quote",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "steps": [
            {
                "tool": "transcribe_audio",
                "arguments": {
                    "src": "FILE_ID",
                },
            },
        ],
    },
)
print(r.json())

Run a flow

POST/v1/tools/run_flow

Runs a chain of tools as one job at one price: quoted and rounded once on the whole chain, not charged if it fails, and Stop charges only the steps that finished.

More

Give a saved flow by its name (flow_…), as calling that name does; the chain itself as definition, as save_flow takes it; or a chain one of Scrub’s skills gives, by its file, as skill_chain. Nothing is saved. quote gives its price first: a step {tool: "run_flow", arguments} with the same arguments.

Parameters

flowstring · optional

A saved flow, by its name, flow_…

definitionobject · optional

Or the chain itself, in place of flow: its inputs, params and steps, as save_flow takes them, each step an action or one of Scrub's tools on the chain's inputs or an earlier step's result (step.output). Not saved.

skill_chainstring · optional

Or a chain one of Scrub's skills gives, in place of flow or definition: the skill's name and the file's path in it, as its steps say (make-narrated-video/references/narrated-chain.json). Run as the skill defines it, never a copy.

titlestring · optional

What the chain's run is called; its steps' names when left out, or its skill's title for a skill_chain

argumentsobject · required

Its inputs and settings, by the names its inputs and params give them

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/run_flow" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {
      "src": "FILE_ID"
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/run_flow`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "arguments": {
        "src": "FILE_ID"
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/run_flow",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "arguments": {
            "src": "FILE_ID",
        },
    },
)
print(r.json())

Check a job

POST/v1/tools/job_status

Where a job got to, and its result when it has one. Work that takes longer than a request can hold is handed back as a job id: ask this for it.

More

While it runs: the stage, its count, and fraction_done, how much of the whole job is finished, with fraction_by: time when its steps are weighed by how long they usually take, steps when only counted; and seconds_left, about how long is left, where that can be told; past_usual_time when it has run longer than it usually takes, and how long is left is not known. For a tool’s run it also gives each step’s price and state, the files a finished step made, and the jobs made for the run before it started, with what they came to in all. For a run on a computer, the file it made there, which stays there: its file_id (cf_…), name, size and length.

Parameters

job_idstring · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/job_status" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/job_status`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/job_status",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
    },
)
print(r.json())

Stop a job

POST/v1/tools/stop_job

Stops a job that is still running. An action already running is not stopped: its work is under way and paid for, so it runs to the end and is charged when it finishes (status running_on); one still queued stops, not charged.

More

A tool stopped is charged for the steps that finished, each at its own price and never more than its quote, and not for the step running or those not started; job_status says what stopping now charges (stop_now). Its finished steps are kept, so running it again reuses them; the step running ends with it. A job that has finished, or one answered at once, is left as it is.

Parameters

job_idstring · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/stop_job" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/stop_job`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/stop_job",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
    },
)
print(r.json())

Price a change

POST/v1/tools/quote_adjustment

Prices a change to a finished job without running it. Returns what adjust would charge for the same patch, and which params it changes.

More

Adjustable params by action: add_voice_effect: through, room, first, around; burn_captions: start, end, position, text, captions; clean_up_voice: parts, s_sounds, highs_from, listen_above, sensitivity, amount, recovery, steady; compress_video: quality; convert: as, by; cut_video: timeline; draw_chart: chart, says, note, title, answer, across, values, main, aspect_ratio, seconds, back, text, accent, gradient_from, gradient_to, font; make_spreadsheet: columns, sheet; mix_sounds: timeline; read_fields: fields, row; transcribe: language; transcribe_audio: language.

Parameters

job_idstring · required
patcharray of object · required

An RFC 6902 JSON Patch against the job's params, e.g. [{"op":"replace","path":"/start","value":15.3}]. replace, add and test are accepted.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/quote_adjustment" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID",
    "patch": [
      {
        "op": "replace",
        "path": "/language",
        "value": "en"
      }
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/quote_adjustment`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID",
      "patch": [
        {
          "op": "replace",
          "path": "/language",
          "value": "en"
        }
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/quote_adjustment",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
        "patch": [
            {
                "op": "replace",
                "path": "/language",
                "value": "en",
            },
        ],
    },
)
print(r.json())

Change a finished job

POST/v1/tools/adjust

Re-runs a finished job with a patch applied, as a new job linked to the original, which is kept as it was. Charged the price quote_adjustment returns for the same patch. A chain of adjustments stops at 10.

More

Adjustable params by action: add_voice_effect: through, room, first, around; burn_captions: start, end, position, text, captions; clean_up_voice: parts, s_sounds, highs_from, listen_above, sensitivity, amount, recovery, steady; compress_video: quality; convert: as, by; cut_video: timeline; draw_chart: chart, says, note, title, answer, across, values, main, aspect_ratio, seconds, back, text, accent, gradient_from, gradient_to, font; make_spreadsheet: columns, sheet; mix_sounds: timeline; read_fields: fields, row; transcribe: language; transcribe_audio: language.

Parameters

job_idstring · required
patcharray of object · required

An RFC 6902 JSON Patch against the job's params, e.g. [{"op":"replace","path":"/start","value":15.3}]. replace, add and test are accepted.

noncestring · optional

Optional. Send the same nonce again to get the same job back rather than a second charge.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/adjust" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID",
    "patch": [
      {
        "op": "replace",
        "path": "/language",
        "value": "en"
      }
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/adjust`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID",
      "patch": [
        {
          "op": "replace",
          "path": "/language",
          "value": "en"
        }
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/adjust",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
        "patch": [
            {
                "op": "replace",
                "path": "/language",
                "value": "en",
            },
        ],
    },
)
print(r.json())

Download a file

POST/v1/tools/download_file

A link to download one of this workspace's files, an upload or a result, named as the person knows it. It works for an hour.

Parameters

file_idstring · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/download_file" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/download_file`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file_id": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/download_file",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file_id": "FILE_ID",
    },
)
print(r.json())

Make a folder

POST/v1/tools/make_folder

Makes a folder in this workspace's Files, free, by its name, and gives its id (fld_…): at the top of Files, or inside another folder by its id. Put files or folders in it with move_files. Folders go 10 deep at most, and a workspace keeps at most 200.

Parameters

namestring · required

Its name, as the person calls it

folderstring · optional

The folder to make it in, by its id (fld_…); left out, the top of Files

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/make_folder" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Client shoots"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/make_folder`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "Client shoots"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/make_folder",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "name": "Client shoots",
    },
)
print(r.json())

Rename a folder

POST/v1/tools/rename_folder

Renames a folder in Files, free, by its id (fld_…). Its files stay in it.

Parameters

folderstring · required

Its id, fld_…

namestring · required

Its new name

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/rename_folder" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "folder": "FOLDER_ID",
    "name": "Client shoots, autumn"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/rename_folder`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "folder": "FOLDER_ID",
      "name": "Client shoots, autumn"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/rename_folder",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "folder": "FOLDER_ID",
        "name": "Client shoots, autumn",
    },
)
print(r.json())

Delete a folder

POST/v1/tools/delete_folder

Deletes a folder from Files, free, by its id (fld_…). Nothing in it is deleted: its files and folders move to where it was, the folder it was in or the top of Files. It cannot be undone.

Parameters

folderstring · required

Its id, fld_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_folder" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "folder": "FOLDER_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_folder`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "folder": "FOLDER_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_folder",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "folder": "FOLDER_ID",
    },
)
print(r.json())

Move files and folders

POST/v1/tools/move_files

Puts files, folders or both in a folder, free: files by their file_ids (from list_files), folders by their ids (fld_…), and the folder's id, or folder none for the top of Files.

More

A file or folder is in one folder at a time; a folder moves with everything in it, never into itself or a folder inside it. A job's files are listed with its job_id; move them together to keep them together.

Parameters

file_idsarray of string · optional
folder_idsarray of string · optional

Folders to move, by their ids (fld_…)

folderstring · required

The folder’s id, fld_…, or none for the top of Files

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/move_files" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "folder": "FOLDER_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/move_files`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "folder": "FOLDER_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/move_files",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "folder": "FOLDER_ID",
    },
)
print(r.json())

List projects

POST/v1/tools/list_projects

This workspace's projects, newest first, fifty at a time, free: the work people come back to, each an App's (Media's) work as it was left. Each with its id (prj_…), its App, its title, what it holds (a sound, a video, a picture, or empty), how many runs it has had and when it last changed. Give app to list one App's only.

Parameters

appone of · optional

One App only

audio

offsetnumber · optional

For the next fifty

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_projects" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_projects`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_projects",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Open a project

POST/v1/tools/open_project

A project, free, as it was left: its App, its title, its state (the file it started from, its timeline as the App keeps it, the steps after it) and its runs, newest first, each a job_… that job_status reads.

More

Open it by its id (prj_…), or by a job_… run in it to find its project. A person opens it in its App at /<app>?project=<id>.

Parameters

projectstring · optional

Its id, prj_…

jobstring · optional

A job run in it, job_…, to find its project

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/open_project" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/open_project`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/open_project",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a project

POST/v1/tools/save_project

Saves a project, free, as its App holds it: give app and state (its file as src, its timeline, the steps after it, as open_project gives them) and a title; a new one is given its id (prj_…).

More

Give project and the version it was opened at to save over it; a version older than the latest is refused and says when the newer one was saved. Give ran, a job_… run in it, to keep that run in its history (with charged, as shown).

Parameters

projectstring · optional

Its id, prj_…, to save over it

appone of · required

Its App

audio

titlestring · optional

What it is called

stateobject · optional

What its App holds, as open_project gives it

versionnumber · optional

The version it was opened at

ranstring · optional

A job run in it, job_…, kept in its history

chargedstring · optional

What that run charged, as shown

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_project" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app": "audio"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_project`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "app": "audio"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_project",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "app": "audio",
    },
)
print(r.json())

List computers

POST/v1/tools/list_computers

The computers running the Scrub app for this workspace, the one seen last first: each with its own name, the app and its version, whether it is open to take work now, when it was last seen and since when, and the files the person gave Scrub there (the latest 20), by name, size and length, and whether the person asking signed it in (yours).

More

Give a file's file_id (cf_…) to an action that runs on a computer to run it there, while the app is open; send it to Files with add_computer_file for anything else. A run on a computer is listed in Jobs like any job, under the computer's name.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_computers" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_computers`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_computers",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Remove a computer

POST/v1/tools/remove_computer

Removes a computer from this workspace, free: the Scrub app on it is signed out and records no more work there. Its jobs stay. Signing in again adds it back. The workspace’s owner removes any computer; a member only their own (yours in list_computers).

Parameters

computer_idstring · required

pc_…, from list_computers

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/remove_computer" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "computer_id": "COMPUTER_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/remove_computer`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "computer_id": "COMPUTER_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/remove_computer",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "computer_id": "COMPUTER_ID",
    },
)
print(r.json())

Add a file from a computer to Files

POST/v1/tools/add_computer_file

Sends a file the person gave Scrub on a computer (cf_…, from list_computers) to Files, from the Scrub app there, while it is open.

More

Answers its file_id when it has arrived; a large file may still be on its way, so check list_computers, where it shows in Files once there. A file sent before and unchanged is not sent again. Then give the file_id to any tool.

Parameters

file_idstring · required

cf_…, from list_computers

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/add_computer_file" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/add_computer_file`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file_id": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/add_computer_file",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file_id": "FILE_ID",
    },
)
print(r.json())

Connect an AI to Scrub

POST/v1/tools/connect_steps

How a person adds Scrub to an AI they use, step by step, with the address or command to paste. Give ai for one AI's steps, or nothing for every one. The AIs: Claude (claude), Claude Code (claude-code), Another AI (other). For any other AI, give other. asks are things to ask once it is connected.

Parameters

aione of · optional

Which AI

claude claude-code other

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/connect_steps" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/connect_steps`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/connect_steps",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List connected AIs

POST/v1/tools/list_connections

The AIs connected to this workspace and not disconnected, newest first: each with its name, where it connected from, since when and when it was last used. A person disconnects one in Account.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_connections" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_connections`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_connections",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List the team

POST/v1/tools/list_team

The people in this workspace, free: each one’s name, address and role (owner or member), the invitations still waiting, and how many people the plan holds. Everyone in a workspace shares its bill, its month of work, its files, Flows, Brand Kits and drafts. Only the owner manages the plan, billing, keys and the people.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_team" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_team`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_team",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Invite a teammate

POST/v1/tools/invite_teammate

Invites a person to this workspace by email, free: they get an email with a link to join, working 7 days, and join by pressing Join on its page, signed in with that address. Inviting an address already invited sends a new link. The owner's alone.

More

The first invitation names the workspace: workspace_name, what the people invited see it called, a name and never an address. How many people a workspace holds is its plan's: refused, and says so, when it is full. At most 20 invitations a day from a workspace, and 3 a day to one address.

Parameters

emailstring · required

Their email address

workspace_namestring · optional

What the workspace is called; needed the first time

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/invite_teammate" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "EMAIL"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/invite_teammate`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "email": "EMAIL"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/invite_teammate",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "email": "EMAIL",
    },
)
print(r.json())

Cancel an invitation

POST/v1/tools/cancel_invite

Takes back an invitation before it is used, by the address it went to, free: its link stops working. The owner’s alone.

Parameters

emailstring · required

The address invited

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/cancel_invite" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "EMAIL"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/cancel_invite`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "email": "EMAIL"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/cancel_invite",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "email": "EMAIL",
    },
)
print(r.json())

Remove a teammate

POST/v1/tools/remove_teammate

Takes a person out of this workspace, by their address, free. What they made stays the workspace’s; the AIs they connected to it are disconnected. The owner’s alone, and the owner stays.

Parameters

emailstring · required

Their email address

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/remove_teammate" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "EMAIL"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/remove_teammate`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "email": "EMAIL"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/remove_teammate",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "email": "EMAIL",
    },
)
print(r.json())

Leave the team

POST/v1/tools/leave_team

You leave this workspace, free: the person this call acts for, never anyone else. What you made stays the workspace’s; the AIs you connected to it are disconnected, the keys you made for it and your upload links stop working, and your browsers leave it. To come back, the owner invites you again. A member’s; the owner stays in their own workspace.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/leave_team" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/leave_team`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/leave_team",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Usage by person

POST/v1/tools/team_usage

This month so far, by person, free: each one’s jobs and what their work was charged, from the ledger, adding up to the workspace’s total. The owner’s alone.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/team_usage" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/team_usage`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/team_usage",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List rooms

POST/v1/tools/list_rooms

The team’s rooms in this workspace, free: each room (#general and the rest, open to everyone in the workspace) with how many messages are new and how many name you, a direct conversation with each teammate, and how much waits for you in Activity. Rooms are where the people of a workspace, and their AIs, talk; Chat is a person’s own conversation with Scrub.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_rooms" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_rooms`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_rooms",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Read a room

POST/v1/tools/read_room

A room’s or direct conversation’s messages, newest last, free: who wrote each (a person, Scrub, or a person’s AI such as Tom’s Claude), what it says, who it names, any job shared, its reactions and whether it was edited, with the room’s topic, people and AIs, and the first message new to you.

More

Give before (a time) for the page before it, or after (a rev) for only what was written or changed since, deleted messages included. An AI reads a room before it answers there.

Parameters

roomstring · required

The room: its id, its name (#general or general), or a teammate’s name or address for your direct conversation with them

beforestring · optional

Only messages written before this time (ISO 8601)

afternumber · optional

Only messages written or changed after this rev

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/read_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "room": "ROOM"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/read_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "room": "ROOM"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/read_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "room": "ROOM",
    },
)
print(r.json())

Post to a room

POST/v1/tools/post_to_room

Posts a message in a room or a direct conversation, free. On the Rooms page it is the person’s; from an AI it is that AI’s, shown as whose it is. Name people with @ and their name, and @Scrub to have Scrub work on it in the room. Write **bold**, `code`, links and lists starting "- ".

More

An AI posts only when a person named it or asked it to; after 3 messages in a row from AIs, none may post until a person writes. In a room for updates (list_rooms says which), an AI posts news as it comes, as often as it has some, such as a routine posting each product update; there an AI naming @Scrub does not set it to work.

Parameters

roomstring · required

The room: its id, its name (#general or general), or a teammate’s name or address for your direct conversation with them

textstring · required

What to say

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/post_to_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "room": "ROOM",
    "text": "TEXT"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/post_to_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "room": "ROOM",
      "text": "TEXT"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/post_to_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "room": "ROOM",
        "text": "TEXT",
    },
)
print(r.json())

Make a room

POST/v1/tools/make_room

Makes a room in this workspace, open to everyone in it, free. Its name is lowercase letters, digits and hyphens, such as launch-week; spaces become hyphens. Give it a topic, said under its name, and make it a room for updates when AIs will post news there as it comes, such as product updates from a routine.

Parameters

namestring · required

The room’s name, such as launch-week

topicstring · optional

What the room is for, said under its name

updatesboolean · optional

A room for updates: AIs post there as news comes, with no limit of 3 in a row

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/make_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/make_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/make_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "name": "NAME",
    },
)
print(r.json())

Remove a room

POST/v1/tools/remove_room

Removes a room from this workspace, free: it leaves everyone’s list and its name is free again. #general and direct conversations stay. The owner’s alone.

Parameters

roomstring · required

The room: its id or its name

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/remove_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "room": "ROOM"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/remove_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "room": "ROOM"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/remove_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "room": "ROOM",
    },
)
print(r.json())

Activity

POST/v1/tools/room_activity

What is for you in Rooms, newest first, free: messages naming you in any room, and what others wrote in your direct conversations, each with where it was and whether it is new.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/room_activity" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/room_activity`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/room_activity",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Share to a room

POST/v1/tools/share_to_room

Shares a job of this workspace in a room or a direct conversation, free: a message showing the job, with words of your own if you like. From an AI it is that AI’s, shown as whose it is.

Parameters

roomstring · required

The room: its id, its name (#general or general), or a teammate’s name or address for your direct conversation with them

jobstring · required

The job’s id

textstring · optional

What to say with it

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/share_to_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "room": "ROOM",
    "job": "JOB"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/share_to_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "room": "ROOM",
      "job": "JOB"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/share_to_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "room": "ROOM",
        "job": "JOB",
    },
)
print(r.json())

Emails about Rooms

POST/v1/tools/rooms_email

Turns your emails about Rooms in this workspace on or off, free. While on, the default, Scrub emails you at most once a day when messages for you (naming you, or in your direct conversations) have waited an hour unread. Only your own; list_rooms says whether they are on.

Parameters

onboolean · required

true to be emailed, false to stop

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/rooms_email" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "on": true
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/rooms_email`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "on": true
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/rooms_email",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "on": True,
    },
)
print(r.json())

Change a room

POST/v1/tools/change_room

Changes a room in this workspace, free: its name, its topic (said under its name, at most 250 characters; empty to clear it), or whether it is a room for updates, where AIs post news as it comes with no limit of 3 in a row. #general keeps its name. Anyone in the workspace may.

Parameters

roomstring · required

The room: its id or its name

namestring · optional

Its new name

topicstring · optional

Its topic

updatesboolean · optional

true for a room for updates

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/change_room" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "room": "ROOM"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/change_room`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "room": "ROOM"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/change_room",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "room": "ROOM",
    },
)
print(r.json())

Edit a message

POST/v1/tools/edit_room_message

Edits the words of a message you wrote in a room or a direct conversation, free; from an AI, a message that AI wrote. It is marked edited, and naming @Scrub in an edit does not set Scrub to work.

Parameters

messagestring · required

The message’s id, from read_room

textstring · required

Its new words

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/edit_room_message" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "MESSAGE",
    "text": "TEXT"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/edit_room_message`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "message": "MESSAGE",
      "text": "TEXT"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/edit_room_message",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "message": "MESSAGE",
        "text": "TEXT",
    },
)
print(r.json())

Delete a message

POST/v1/tools/delete_room_message

Deletes a message in a room or a direct conversation, free: it leaves the room for everyone, with its reactions. Yours, or one written for you (your AI’s, or Scrub’s); from an AI, a message that AI wrote. A job it shared stays under Jobs.

Parameters

messagestring · required

The message’s id, from read_room

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_room_message" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "MESSAGE"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_room_message`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "message": "MESSAGE"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_room_message",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "message": "MESSAGE",
    },
)
print(r.json())

React to a message

POST/v1/tools/react_to_message

Reacts to a message in a room or a direct conversation, free, with one of 👍 ❤️ 😂 🎉 👀 ✅, or takes your reaction back with on: false. From an AI it is that AI’s, shown as whose it is.

Parameters

messagestring · required

The message’s id, from read_room

emojione of · required

The reaction

👍 ❤️ 😂 🎉 👀 ✅

onboolean · optional

false to take it back; true when left out

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/react_to_message" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "MESSAGE",
    "emoji": "👍"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/react_to_message`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "message": "MESSAGE",
      "emoji": "👍"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/react_to_message",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "message": "MESSAGE",
        "emoji": "👍",
    },
)
print(r.json())

Download everything

POST/v1/tools/download_everything

Every file in this workspace, uploads and results, in one zip, on a link that works for an hour. A large workspace takes a minute or more: while it is being made the answer says so, and asking again gives the link once it is ready. Drafts, flows and chats are not files and are not in it.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/download_everything" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/download_everything`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/download_everything",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Close your account

POST/v1/tools/close_account

Closes this account and its workspace for good. Called without confirm, it closes nothing: it says what goes (files, drafts, flows, chats, jobs, connected AIs, API keys, computers), what is kept for tax, what happens to a paid plan and the credit left, and gives a code.

More

Called again with that code as confirm, within ten minutes, it closes them. Closing cancels a paid plan, signs out everywhere, deletes every file and record but the payment records the law keeps, and emails the account’s address that it is done. download_everything gives every file first.

Parameters

confirmstring · optional

The code the first call gave

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/close_account" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/close_account`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/close_account",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Reference

Files

Put files in, find them, look at them, delete them.

Upload a file

POST/v1/tools/create_upload

Gets a place for one file, or several with filenames on one page, and returns each file_id. upload_page is a link where the file is picked in a browser; upload_status says when it has arrived.

More

A caller that can send bytes passes bytes and content_type to get upload_url as well. Files up to 4096 MB, larger than chat attachments. An upload no tool uses goes after a day; with keep it stays in Files, where files are kept until you delete them. Links last a day, and the result says until when.

Parameters

filenamestring · optional

The name of the file, e.g. interview.mp4, if you know it

filenamesarray of string · optional

Several files at once, by name: one upload_page takes them all, and each gets its own file_id, in this order. In place of filename.

content_typestring · optional

Its media type, e.g. video/mp4. Only needed with bytes.

bytesnumber · optional

Its size in bytes. Only if you will send the bytes yourself.

keepboolean · optional

Keep it in Files even if no tool uses it, for a person putting a file in Files, where files are kept until you delete them. Off by default.

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/create_upload" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "interview.mp3",
    "content_type": "audio/mpeg",
    "bytes": 18350080
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/create_upload`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "filename": "interview.mp3",
      "content_type": "audio/mpeg",
      "bytes": 18350080
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/create_upload",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "filename": "interview.mp3",
        "content_type": "audio/mpeg",
        "bytes": 18350080,
    },
)
print(r.json())

Check an upload

POST/v1/tools/upload_status

Checks whether a file has arrived at a file_id from create_upload, and for a photo, scan or PDF how many pages it has. Use it once the upload has finished, before passing the file_id to a tool.

Parameters

file_idstring · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/upload_status" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/upload_status`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file_id": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/upload_status",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file_id": "FILE_ID",
    },
)
print(r.json())

List your files

POST/v1/tools/list_files

Lists the files in this workspace, newest first, fifty at a time: uploads and results, each with its file_id to pass as a file input, its size, what made it (with its job_id, and the results of that job that fill a setting, by type: a voice’s script), and the folder it is in.

More

Also the workspace’s folders, each with its id (fld_…), name and how many files it holds. Give folder to list only one folder’s files (none for those in no folder), tool (and input) to list only the files that input takes, kind to list only images, clips, sound or documents, name to find files whose name has those words, in any folder, and file_ids to include those files however old. total says how many match; when more is true, pass the last file_id as before for the next fifty.

Parameters

toolstring · optional

An action or tool id, to list only files it takes

inputstring · optional

One of its file inputs, by name

kindarray of one of · optional

Only these kinds of file: image, video, audio, or document (anything else: PDFs, spreadsheets, text, subtitles, transcripts)

file_idsarray of string · optional

Files to include however old, by file_id

namestring · optional

Only files whose name has these words, however old

beforestring · optional

The next page: the files after this file_id, the last one listed

folderstring · optional

A folder’s id (fld_…) for its files only, or none for the files in no folder

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_files" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_files`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_files",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Look at files

POST/v1/tools/look_at_files

A quick look at a stack of files before reading them: what kind of document each is, how many pages, and the columns worth reading. For Read documents into a table (read_fields). Use it to offer what to read before a run.

Parameters

actionone of · required

read_fields

file_idsarray of string · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/look_at_files" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "read_fields",
    "file_ids": [
      "FILE_ID"
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/look_at_files`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "action": "read_fields",
      "file_ids": [
        "FILE_ID"
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/look_at_files",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "action": "read_fields",
        "file_ids": [
            "FILE_ID",
        ],
    },
)
print(r.json())

Delete a file

POST/v1/tools/delete_file

Deletes a file from this workspace straight away, freeing its room; identical copies go with it. The jobs and receipts stay. It cannot be undone. A file a running job is reading is not deleted.

Parameters

file_idstring · required
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_file" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "FILE_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_file`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file_id": "FILE_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_file",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file_id": "FILE_ID",
    },
)
print(r.json())

Reference

Corrections

Correct a result by hand, free.

Correct a transcript

POST/v1/tools/correct_transcript

Saves a corrected copy of a finished transcription's words, free: one string per paragraph, in order, as the person wants them read; or words to change everywhere they stand (replace), such as a name spelt wrongly throughout. Words kept keep their times; the original stays; captions and conversions made afterwards use the corrected words.

Parameters

job_idstring · required

The transcription job, or a tool run that made one

paragraphsarray of string · optional

Every paragraph as corrected, in order

replacearray of object · optional

Instead of paragraphs: each word changed everywhere it stands as a whole word, the case as written

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/correct_transcript" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/correct_transcript`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/correct_transcript",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
    },
)
print(r.json())

Correct a table

POST/v1/tools/correct_table

Corrects cells of a finished table, or adds a column read from its documents, free. Cells by row (from 0) and column key; the files made from the table, a spreadsheet made from it too, are written again with the corrections. The table as first made is kept.

Parameters

job_idstring · required
cellsarray of object · optional
addarray of string · optional

Columns to add, by name

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/correct_table" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "job_id": "JOB_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/correct_table`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "job_id": "JOB_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/correct_table",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "job_id": "JOB_ID",
    },
)
print(r.json())

Reference

Drafts

What is set on a page and not yet run, kept as it is made.

Open a draft

POST/v1/tools/open_draft

A draft, free: what was set on a tool's or action's page and not yet run, kept by Scrub as it was changed, to carry on where a person or an AI left off.

More

Open it by its name (draft_…, from list_drafts or a save), or by tool and from, the job it was started from (a result's next step, or a run being changed); by tool alone, the person's latest draft of it. Gives its name, tool, title, params as the page holds them, the job it came from, when it was saved and its version. A finished job with no draft started from it yet opens as its page opens it: a run of that tool with everything it was given, each setting as its steps finished it (a video's timeline voiced and word-timed), or another's result in the setting it fills; it has no name and is at version 0 until edit_draft or save_draft keeps it, by tool and from. 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.

Parameters

draftstring · optional

Its name, draft_…

toolstring · optional

The tool or action

fromstring · optional

The job it was started from, if any

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/open_draft" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/open_draft`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/open_draft",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List drafts

POST/v1/tools/list_drafts

A person's drafts, newest first, fifty at a time, free: what was set on a page and not yet run. Each with its name (draft_…), its tool, its own title (a script's title, the first words of an idea or a prompt, or the file it takes), when it was saved and the job it was started from.

More

Give tool to list one tool's, words to find drafts with those words in them. total says how many match; when more is true, pass the last one's name as after for the next fifty.

Parameters

toolstring · optional

Only this tool’s or action’s drafts

wordsstring · optional

Only drafts with these words in them

afterstring · optional

The next page: the drafts after this one

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_drafts" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_drafts`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_drafts",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a draft

POST/v1/tools/save_draft

Keeps what is set on a tool's or action's page before it runs, free, so the person opens it there as it was left, on any device: its params by name, each as text, a script as its JSON as open_draft gives it (a script that is not one is refused).

More

Nothing runs. Give draft, the name a save or open_draft gave, to save over that draft; or from, the job it was started from, for that job's one draft; give neither to start a new draft, and its name is given back. Give the version you opened to save over only that one: if it was saved since, nothing is saved and the newer one's time is given. Empty params delete it. A person keeps up to 500 drafts.

Parameters

toolstring · required

The tool or action

draftstring · optional

Its name, draft_…, to save over it

fromstring · optional

The job it was started from, if any

paramsobject · required
versionnumber · optional
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_draft" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "generate_image",
    "params": {
      "prompt": "A neon ramen bar at night, rain"
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_draft`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "tool": "generate_image",
      "params": {
        "prompt": "A neon ramen bar at night, rain"
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_draft",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "tool": "generate_image",
        "params": {
            "prompt": "A neon ramen bar at night, rain",
        },
    },
)
print(r.json())

Change part of a draft

POST/v1/tools/edit_draft

Changes part of a draft, free, without sending it all back: one pause, one caption line, one image.

More

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.

Parameters

draftstring · optional

Its name, draft_…

toolstring · optional

The tool or action, with from

fromstring · optional

The job it was started from

patcharray of object · required

The changes, in order

versionnumber · optional
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/edit_draft" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "draft": "DRAFT_NAME",
    "patch": [
      {
        "op": "replace",
        "path": "/prompt",
        "value": "The same bar at dawn"
      }
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/edit_draft`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "draft": "DRAFT_NAME",
      "patch": [
        {
          "op": "replace",
          "path": "/prompt",
          "value": "The same bar at dawn"
        }
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/edit_draft",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "draft": "DRAFT_NAME",
        "patch": [
            {
                "op": "replace",
                "path": "/prompt",
                "value": "The same bar at dawn",
            },
        ],
    },
)
print(r.json())

See a draft’s history

POST/v1/tools/draft_history

A draft's history, free: every version it was saved at, newest first, fifty at a time, each with when it was saved, who saved it (by: a tool page, Chat, the assistant, a connected AI by its name, an API key, a computer; none where it was not recorded), where (page, chat, assistant, mcp, api or computer) and how many changes made it from the version before.

More

Give version to open that one as well: its params as open_draft gives them, and patch, its change from the version before as JSON Patch on the params. To go back to an earlier version, save its params over the draft with save_draft. total says how many versions there are; when more is true, pass the last one's version as before for the next fifty. 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.

Parameters

draftstring · required

Its name, draft_…

versionnumber · optional

A version to open

beforenumber · optional

The next page: the versions before this one

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/draft_history" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "draft": "DRAFT_NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/draft_history`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "draft": "DRAFT_NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/draft_history",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "draft": "DRAFT_NAME",
    },
)
print(r.json())

Delete a draft

POST/v1/tools/delete_draft

Deletes a draft for good, by its name (draft_…): what was set on a page and not yet run. The runs made from it stay. It cannot be undone.

Parameters

draftstring · required

Its name, draft_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_draft" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "draft": "DRAFT_NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_draft`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "draft": "DRAFT_NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_draft",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "draft": "DRAFT_NAME",
    },
)
print(r.json())

Reference

Flows

Tools and Actions chained on the canvas, kept with each version. A flow runs at /v1/tools/<its name>, as a tool does..

List flows

POST/v1/tools/list_flows

This workspace's flows, newest saved first, free: what a person or an AI chained on the canvas from tools and actions.

More

Each with its name (flow_…, the name it runs by, as any tool does), its title, its version, when it was saved, its steps by their names, app where it was made in one of Scrub's Apps and, in a workspace of more than one person, who saved it (by). Give app to list only the flows made in that App, or at to list only those chained on an action's or tool's own page (by its name).

Parameters

appstring · optional

An App, by its name ("audio"): only the flows made in it

atstring · optional

An action or tool, by its name ("write_content"): only the flows chained on its page

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_flows" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_flows`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_flows",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

What can be added

POST/v1/tools/list_addable

What Add offers on Scrub's pages, free: the actions and tools that can be added to one of this workspace's files after the steps already chained on it, in order.

More

Each with its name, its title and feeds: which of its file inputs the file feeds (as the flow's input, src unless input names it) and which an earlier step's result feeds (step.output, a step named by its action or tool, _2 where it is chained a second time). One that cannot be fed yet is left out until a step makes what it takes; words it needs are given as its settings. Chained into a flow with save_flow, each step's inputs as feeds says, it runs by the flow's name, priced before it runs.

Parameters

filestring · required

The file, by its file_id from list_files

stepsarray of string · optional

The actions and tools already chained on it, in order, by their names as tools/list gives them

inputstring · optional

The flow's input the file is given as; src when left out

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_addable" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "FILE"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_addable`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file": "FILE"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_addable",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file": "FILE",
    },
)
print(r.json())

Open a flow

POST/v1/tools/open_flow

A flow, free, by its name (flow_…): its definition as save_flow takes it (its inputs, its settings and its steps, each running an action or one of Scrub's tools on the flow's inputs or an earlier step's result) and where its steps sit on the canvas.

More

Its latest version, or an earlier one by version.

Parameters

flowstring · required

Its name, flow_…

versionnumber · optional

An earlier version

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/open_flow" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "flow": "FLOW_NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/open_flow`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "flow": "FLOW_NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/open_flow",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "flow": "FLOW_NAME",
    },
)
print(r.json())

Save a flow

POST/v1/tools/save_flow

Saves a flow, free: its title, its definition as open_flow gives it (inputs, params and steps; at most 20 steps), and where its steps sit.

More

A step may be one of Scrub's tools ({id, tool, inputs, params, pass, params_from}): it runs as that tool is when the flow runs, its settings fixed by params, given each run by pass, read from an earlier step's result by params_from (its material only: the slides Plan the slides makes, for Make an explainer video, which then makes no pictures, its places keeping their icons, since how many is known only once the slides are made; pictures are one press away on its page from the result), or the tool's own. It is checked as a tool is: every step's inputs from the flow's inputs or an earlier step's result, every step priced by what is given before anything runs; one that would not run is not saved, and says why. A new flow is given its name (flow_…) and runs by that name, as any tool does, priced before it runs; its title changes freely. Saving one by its name keeps a new version; given version, it is saved only if that is still its latest.

Parameters

flowstring · optional

Its name, flow_…, to save a new version

titlestring · required

What it is called

definitionobject · required

Its inputs, params and steps, as open_flow gives them; its title, version, category and icon are filled in from its title and first step when left out.

layoutobject · optional

Where its steps sit on the canvas

versionnumber · optional

The version it was opened at

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_flow" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Caption every upload",
    "definition": {
      "inputs": {
        "src": {
          "type": "file",
          "label": "Video",
          "accept": [
            "video/*"
          ]
        }
      },
      "steps": [
        {
          "id": "captions",
          "tool": "add_captions",
          "inputs": {
            "src": "src"
          }
        }
      ]
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_flow`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "title": "Caption every upload",
      "definition": {
        "inputs": {
          "src": {
            "type": "file",
            "label": "Video",
            "accept": [
              "video/*"
            ]
          }
        },
        "steps": [
          {
            "id": "captions",
            "tool": "add_captions",
            "inputs": {
              "src": "src"
            }
          }
        ]
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_flow",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "title": "Caption every upload",
        "definition": {
            "inputs": {
                "src": {
                    "type": "file",
                    "label": "Video",
                    "accept": [
                        "video/*",
                    ],
                },
            },
            "steps": [
                {
                    "id": "captions",
                    "tool": "add_captions",
                    "inputs": {
                        "src": "src",
                    },
                },
            ],
        },
    },
)
print(r.json())

Delete a flow

POST/v1/tools/delete_flow

Deletes a flow for good, by its name (flow_…): it no longer runs. Its runs stay. It cannot be undone.

Parameters

flowstring · required

Its name, flow_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_flow" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "flow": "FLOW_NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_flow`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "flow": "FLOW_NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_flow",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "flow": "FLOW_NAME",
    },
)
print(r.json())

Reference

Brand Kits

A workspace's look, kept by name: a timeline's own parts, put on a video by writing them into its timeline..

List Brand Kits

POST/v1/tools/list_brand_kits

This workspace's Brand Kits, by name, free: the look and taste a person keeps for a brand's work.

More

Each with its id (kit_…), its name, its parts (brand {back, text, accent, font}, captions, safe, voice, music {prompt}, and logo {src: a file_id, the logo as it is, for light pictures; on_dark?: a file_id, its white or reversed version for dark or busy pictures, shown where it reads better; box?; plate?: card, scrim or none, what goes behind it where neither reads (card when left out)}, a timeline's own; writing {tone, audience}: how the brand sounds and who it writes for, in words, for Write content's own settings of those names; styles {title, callout}: the look of words on screen marked with that role in a timeline (a hook or heading, a figure or phrase shown big), each {font, weight, size, colour, back, in, out} as a text box has them; taste: at most 40 rules for how the brand's videos are made, each {about: one of opening, shots, movement, words on screen, music, ending; rule: in words, at most 200 characters; measure?: one of first_words_s, shot_s, cuts_per_minute, moving_shots_share, words_on_screen_share, caption_words, music_under_voice_db, tail_s; low?, usual?, high?: what was measured across the videos studied; unit?: one of s, dB, %, words, per minute; held?, of?: how many of the videos studied hold it; seen?: where it shows, in words; sets?: {setting, value}: the setting that follows it, one of seconds: write_script.seconds (write_script.seconds); top: plan_cutaways.top (plan_cutaways.top); cutaway: plan_cutaways.cutaway (plan_cutaways.cutaway); speaker: plan_cutaways.speaker (plan_cutaways.speaker); quiet: plan_cutaways.quiet (plan_cutaways.quiet); callouts: plan_cutaways.callouts (plan_cutaways.callouts); transition: the video's transition between pictures, one of cut, blur, fade, push, zoom; motion: how each full-frame picture moves, an image's motion; music: the music's level under the voice, 0 to 1 (music.volume)}. A rule with no sets is followed by whoever makes the video, reading it.), and fills: the values it gives each action's settings, by action id. To make work in the brand, give the kit's id as brand_kit to assemble_video, write_content, draw_chart, write_script, plan_cutaways: its parts and the settings fills names fill what the call leaves out, the logo shown from the first scene to the last where the video has none of its own, and what the call gives wins. Follow the rules with no sets.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_brand_kits" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_brand_kits`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_brand_kits",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a Brand Kit

POST/v1/tools/save_brand_kit

Saves a Brand Kit, free: its name and its parts (brand {back, text, accent, font}, captions, safe, voice, music {prompt}, and logo {src: a file_id, the logo as it is, for light pictures; on_dark?: a file_id, its white or reversed version for dark or busy pictures, shown where it reads better; box?; plate?: card, scrim or none, what goes behind it where neither reads (card when left out)}, a timeline's own; writing {tone, audience}: how the brand sounds and who it writes for, in words, for Write content's own settings of those names; styles {title, callout}: the look of words on screen marked with that role in a timeline (a hook or heading, a figure or phrase shown big), each {font, weight, size, colour, back, in, out} as a text box has them; taste: at most 40 rules for how the brand's videos are made, each {about: one of opening, shots, movement, words on screen, music, ending; rule: in words, at most 200 characters; measure?: one of first_words_s, shot_s, cuts_per_minute, moving_shots_share, words_on_screen_share, caption_words, music_under_voice_db, tail_s; low?, usual?, high?: what was measured across the videos studied; unit?: one of s, dB, %, words, per minute; held?, of?: how many of the videos studied hold it; seen?: where it shows, in words; sets?: {setting, value}: the setting that follows it, one of seconds: write_script.seconds (write_script.seconds); top: plan_cutaways.top (plan_cutaways.top); cutaway: plan_cutaways.cutaway (plan_cutaways.cutaway); speaker: plan_cutaways.speaker (plan_cutaways.speaker); quiet: plan_cutaways.quiet (plan_cutaways.quiet); callouts: plan_cutaways.callouts (plan_cutaways.callouts); transition: the video's transition between pictures, one of cut, blur, fade, push, zoom; motion: how each full-frame picture moves, an image's motion; music: the music's level under the voice, 0 to 1 (music.volume)}.

More

A rule with no sets is followed by whoever makes the video, reading it.), each checked as a timeline or the action it fills checks it; one that is not right is not saved, and says why. A new kit is given its id (kit_…); saving one by its id saves over it, so give every part it keeps. A workspace keeps at most 50.

Parameters

kitstring · optional

Its id, kit_…, to save over it

namestring · required

What it is called

partsobject · required

Its parts, as a timeline has them

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_brand_kit" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "House look",
    "parts": {
      "brand": {
        "back": "#0c0c0c",
        "text": "#ffffff",
        "accent": "#ff5a1f",
        "font": "Inter Tight"
      }
    }
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_brand_kit`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "House look",
      "parts": {
        "brand": {
          "back": "#0c0c0c",
          "text": "#ffffff",
          "accent": "#ff5a1f",
          "font": "Inter Tight"
        }
      }
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_brand_kit",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "name": "House look",
        "parts": {
            "brand": {
                "back": "#0c0c0c",
                "text": "#ffffff",
                "accent": "#ff5a1f",
                "font": "Inter Tight",
            },
        },
    },
)
print(r.json())

Delete a Brand Kit

POST/v1/tools/delete_brand_kit

Deletes a Brand Kit for good, by its id (kit_…). Videos made with it keep their look. It cannot be undone.

Parameters

kitstring · required

Its id, kit_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_brand_kit" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "kit": "KIT_ID"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_brand_kit`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "kit": "KIT_ID"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_brand_kit",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "kit": "KIT_ID",
    },
)
print(r.json())

Reference

Skills

How to do a whole job with Scrub, written for any AI to follow in the open Agent Skills format: Scrub’s own and the workspace’s, read, saved and deleted..

List skills

POST/v1/tools/list_skills

The skills an AI follows to do a whole job with Scrub, free: Scrub's own and this workspace's. A skill is step-by-step instructions for one job (which of Scrub's tools to call, in what order, what to ask first), in the open Agent Skills format.

More

Before a job one of them describes, read it with open_skill and follow it. Hosts that read MCP's Skills extension find the same skills as skill:// resources.

Parameters

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_skills" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_skills`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_skills",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Open a skill

POST/v1/tools/open_skill

A skill's instructions, by its name, free: its SKILL.md, and the files beside it by path. Follow the instructions; when they point to a file (references/checks.md), open it by giving its path as file.

Parameters

namestring · required

The skill's name, as list_skills gives it

filestring · optional

A file of the skill by its path, references/checks.md; its SKILL.md if left out

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/open_skill" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/open_skill`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/open_skill",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "name": "NAME",
    },
)
print(r.json())

Save a skill

POST/v1/tools/save_skill

Saves a skill to this workspace, free, so every AI connected to it can follow it, and the people in it read and download it on Skills.

More

A skill is a folder in the open Agent Skills format: a SKILL.md whose frontmatter, between --- lines, gives its name (lowercase words joined by hyphens) and a description of what it does and when to use it, then the instructions; and any files it points to, by their paths inside the folder (references/checks.md). Each file is given as words, or as its bytes in base64; at most 100 files and 1 MB together. A skill of the same name is saved over; a name one of Scrub's own skills has is refused. A workspace keeps at most 50.

Parameters

filesarray of object · required

Every file of the skill, SKILL.md among them

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_skill" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "files": [
      {
        "path": "SKILL.md",
        "text": "SKILL_MD_TEXT"
      }
    ]
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_skill`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "files": [
        {
          "path": "SKILL.md",
          "text": "SKILL_MD_TEXT"
        }
      ]
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_skill",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "files": [
            {
                "path": "SKILL.md",
                "text": "SKILL_MD_TEXT",
            },
        ],
    },
)
print(r.json())

Delete a skill

POST/v1/tools/delete_skill

Deletes one of this workspace's skills for good, by its name: no AI connected to the workspace finds it again. Scrub's own skills stay. It cannot be undone.

Parameters

namestring · required

The skill's name

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_skill" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "NAME"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_skill`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "name": "NAME"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_skill",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "name": "NAME",
    },
)
print(r.json())

Reference

CRM

The people and companies a workspace works with, its deals with them, and the tasks about any of them..

List people

POST/v1/tools/list_people

The people in this workspace's CRM, free: each with its id (pe_…), name, email, phone, job title, company (co_…) and its name, type (customer, lead, partner, supplier, investor or team), notes and who added them. Narrow by words in a name, email, job title or company, by type, or by a company's id.

Parameters

searchstring · optional

Words in a name, email, job title or company

typeone of · optional

customer lead partner supplier investor team

companystring · optional

A company's id, co_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_people" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_people`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_people",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List companies

POST/v1/tools/list_companies

The companies in this workspace's CRM, free: each with its id (co_…), name, website, notes and who added it. Narrow by words in a name or website.

Parameters

searchstring · optional

Words in a name or website

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_companies" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_companies`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_companies",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List deals

POST/v1/tools/list_deals

The deals in this workspace's CRM, free: each with its id (de_…), title, amount and currency, stage (lead, qualified, proposal, won or lost), the day it closes, its company and its people (pe_…), notes and who added it. Narrow by words, stage, a company's id or a person's id.

Parameters

searchstring · optional

Words in a title or company

stageone of · optional

lead qualified proposal won lost

companystring · optional

A company's id, co_…

personstring · optional

A person's id, pe_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_deals" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_deals`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_deals",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

List tasks

POST/v1/tools/list_tasks

The tasks in this workspace, free: each with its id (ta_…), what it is, the day it is due, whether it is done, and the record it is about (a person pe_…, a company co_… or a deal de_…). Give a record's id for only the tasks about it.

Parameters

aboutstring · optional

A record's id: pe_…, co_… or de_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/list_tasks" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/list_tasks`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/list_tasks",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Open a person, company or deal

POST/v1/tools/open_record

One record from this workspace's CRM by its id, free, with what it is linked to: a person with their deals and tasks; a company with its people, deals and the tasks about any of them; a deal with its people and tasks; a task as it is.

Parameters

recordstring · required

Its id: pe_…, co_…, de_… or ta_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/open_record" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "record": "RECORD"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/open_record`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "record": "RECORD"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/open_record",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "record": "RECORD",
    },
)
print(r.json())

Save a person

POST/v1/tools/save_person

Saves a person in this workspace's CRM, free. A new person needs a name or an email; give person (pe_…) to change one, and only the fields given change. An email someone here already has is refused, naming them.

More

company is a company's id (co_…) or its exact name, or empty for none; a company that is not here is refused, never made. A new person with a work email and no company given joins the company with that website, and says so. type is customer, lead, partner, supplier, investor or team.

Parameters

personstring · optional

Its id, pe_…, to change it

namestring · optional
emailstring · optional
phonestring · optional
job_titlestring · optional
companystring · optional

A company's id (co_…) or exact name; empty for none

typeone of · optional

customer lead partner supplier investor team

notesstring · optional
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_person" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_person`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_person",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a company

POST/v1/tools/save_company

Saves a company in this workspace's CRM, free. A new company needs a name; give company (co_…) to change one, and only the fields given change. website is its address or domain (skye-ferries.com); a website another company here has is refused, naming it.

Parameters

companystring · optional

Its id, co_…, to change it

namestring · optional
websitestring · optional

Its address or domain; empty for none

notesstring · optional
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_company" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_company`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_company",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a deal

POST/v1/tools/save_deal

Saves a deal in this workspace's CRM, free. A new deal needs its title, what the deal is; give deal (de_…) to change one, and only the fields given change.

More

amount is a number in the currency (12400.50); currency is GBP, EUR or USD; stage is lead, qualified, proposal, won or lost; closes is a day, YYYY-MM-DD, or empty for none. company is a company's id (co_…) or exact name; people is the list of its people's ids (pe_…), all of them, replacing those it had.

Parameters

dealstring · optional

Its id, de_…, to change it

titlestring · optional

What the deal is

amountnumber · optional
currencyone of · optional

GBP EUR USD

stageone of · optional

lead qualified proposal won lost

closesstring · optional

YYYY-MM-DD; empty for none

companystring · optional

A company's id (co_…) or exact name; empty for none

peoplearray of string · optional

Its people's ids, pe_…

notesstring · optional
Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_deal" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_deal`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_deal",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Save a task

POST/v1/tools/save_task

Saves a task, free, about a person (pe_…), a company (co_…) or a deal (de_…). A new task needs its title, what it is; give task (ta_…) to change one, and only the fields given change. due is a day, YYYY-MM-DD, or empty for none; done ticks it or unticks it.

Parameters

taskstring · optional

Its id, ta_…, to change it

titlestring · optional

What it is

duestring · optional

YYYY-MM-DD; empty for none

doneboolean · optional
aboutstring · optional

The record's id: pe_…, co_… or de_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/save_task" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/save_task`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({}),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/save_task",
    headers={"Authorization": f"Bearer {key}"},
    json={},
)
print(r.json())

Delete a person, company, deal or task

POST/v1/tools/delete_record

Deletes a person, company, deal or task by its id, free. It is kept 30 days and restore_record brings it back, links and all. Deleting a person keeps their deals and tasks; a company keeps its people and deals, without a company; a deal keeps its tasks.

Parameters

recordstring · required

Its id: pe_…, co_…, de_… or ta_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/delete_record" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "record": "RECORD"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/delete_record`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "record": "RECORD"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/delete_record",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "record": "RECORD",
    },
)
print(r.json())

Restore a deleted record

POST/v1/tools/restore_record

Brings back a person, company, deal or task deleted in the last 30 days, by its id, free, with its links as they were. Refused when someone kept since has its email, or a company its website.

Parameters

recordstring · required

Its id: pe_…, co_…, de_… or ta_…

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/restore_record" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "record": "RECORD"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/restore_record`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "record": "RECORD"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/restore_record",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "record": "RECORD",
    },
)
print(r.json())

Read a contacts export

POST/v1/tools/read_contacts_file

Reads a contacts export, free, such as the CSV HubSpot's Contacts page exports, and says what importing it would do, row by row, without adding anything: the new people, the people already here (matched by email) and what each would get that Scrub does not know yet, the rows left out and why, and the new companies its Company Name column names.

More

Pass file, a file_id from create_upload.

Parameters

filestring · required

A file_id from create_upload

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/read_contacts_file" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "FILE"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/read_contacts_file`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file": "FILE"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/read_contacts_file",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file": "FILE",
    },
)
print(r.json())

Import contacts

POST/v1/tools/import_contacts

Imports a contacts export into this workspace's CRM, free, as read_contacts_file says it would: adds the new people and the companies they name, gives people already here only what Scrub does not know yet (a phone, a job title, a company), and leaves out rows with no name or email or an email twice.

More

Nothing a person wrote is replaced. Says what to delete and set back to undo it. Pass file, a file_id from create_upload.

Parameters

filestring · required

A file_id from create_upload

Idempotency-Keyheader · optional

Send the same key again and the same job is found rather than a second one charged.

BASE=https://app.scrub.app
curl -X POST \
  "$BASE/v1/tools/import_contacts" \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file": "FILE"
  }'
const key = process.env.SCRUB_KEY
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools/import_contacts`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "file": "FILE"
    }),
  },
)
const { ok, result, error } = await res.json()
import os, requests

key = os.environ["SCRUB_KEY"]
base = "https://app.scrub.app"
r = requests.post(
    f"{base}/v1/tools/import_contacts",
    headers={"Authorization": f"Bearer {key}"},
    json={
        "file": "FILE",
    },
)
print(r.json())

Reference

About

What this API serves.

List the tools

GET/v1/tools

Every tool this API serves, with its input schema. Free; no key needed. Sent with a key, the key's workspace's flows too.

BASE=https://app.scrub.app
curl \
  "$BASE/v1/tools"
const base = "https://app.scrub.app"
const res = await fetch(
  `${base}/v1/tools`,
)
const tools = await res.json()
import requests

base = "https://app.scrub.app"
tools = requests.get(
    f"{base}/v1/tools",
).json()