remagicaDocs home
API referenceClip jobs

Create a clip job

POST
/clip-jobs

Needs a key withclips:submit

Queues a job that turns one of your uploads into short vertical clips: it finds the strongest moments, reframes them to 9:16 and adds captions and a hook card.

Processing is asynchronous and takes minutes. The response is 202 Accepted with the job id; poll GET /clip-jobs/{jobId} (every 5 seconds or so) until status is completed or failed, or stream GET /clip-jobs/{jobId}/events. progress says which stage the job is in and how far along it is.

A job costs credits per minute of source it processes (see GET /credits). The upload's length is measured from the file itself when the job is created (a file whose length can't be read is refused with 400), and credits for that length, cut to maxMinutes, are set aside then (402 when the workspace can't cover it). The job processes no more of the source than that, is charged for the minutes it processed when it completes (never more than was set aside), and nothing if it fails.

Requires scope clips:submit.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body

The upload to clip and how to render it. Only sourceKey is required.

aspectRatio?string

Frame of the clips:

  • 9:16: 1080x1920.
  • 1:1: 1080x1080.
  • 16:9: 1920x1080.
  • 4:5: 1080x1350.

Speakers are tracked in every frame. Two people in one shot are stacked in 9:16 and side by side in 16:9; 1:1 and 4:5 keep the whole shot. A source already at the chosen shape passes through.

These are the 1080p sizes; resolution picks 720p instead.

Default"9:16"
Value in"9:16""1:1""16:9""4:5"
captionStyle?

Caption look: preset (one of the ids below) plus optional overrides, each patching one field of the preset's style: font (family, weight, italic, size, color, letterSpacing), stroke (enabled, color, width), shadow (enabled, color, x, y, blur), uppercase, animation (name, highlightColor, bgColor), highlight (primary, secondary), background (enabled, color, opacity), layout (lines, maxLines, maxWordsPerLine, maxCharsPerLine, maxSeconds) and position (anchor, offset). Sizes are reference units (1 unit = the frame's short side / 540 px); colours are #RRGGBB or #RRGGBBAA.

Presets: none, bold-pop, karaoke, deep-diver, youshaei, pod-p, simple, beasty, mozi, popline, think-media, soft-landing, baby-earthquake, breathe, seamless-bounce, focus, blur-switch, grow, glitch-infinite, highlighter-box, blur-in, with-backdrop, baby-steps, neon-glow, stream-pop, stream-box, one-word. none burns no captions.

Default
{  "preset": "bold-pop"}
captions?boolean

Burn word-by-word captions into every clip. false burns none; every clip still ships words.json for an editor.

Defaulttrue
clipLength?string

How long each clip should be (default auto).

  • auto (Auto (0m-3m)): 15-180 s.
  • lt30 (<30s): 10-30 s.
  • s30_59 (30s~59s): 30-59 s.
  • s60_89 (60s~89s): 60-89 s.
  • s90_3m (90s~3m): 90-180 s.
  • m3_5 (3m~5m): 180-300 s.
  • m5_10 (5m~10m): 300-600 s.
  • m10_15 (10m~15m): 600-900 s.

auto lets the selector pick each clip's length within its band. Longer lengths yield fewer clips. A video shorter than the chosen minimum completes with no clips and error explaining why.

Default"auto"
Value in"auto""lt30""s30_59""s60_89""s90_3m""m3_5""m5_10""m10_15"
facecam?string

Stream videos (a webcam overlay over gameplay or a screen): where the enlarged webcam goes when the clip stacks it with the gameplay in a 9:16 frame, top or bottom. 1:1 and 4:5 clips show the webcam as an inset in its own corner instead. A webcam too small to enlarge keeps the whole stream frame. Other videos ignore it.

Default"top"
Value in"top""bottom"
fps?unknown

The clips' frame rate at most, 30 (default) or 60. A faster source is cut down to it; a slower one (24 fps film) keeps its own rate. 60 suits fast gameplay and takes about half as many bytes again.

Default30
Value in3060
hook?boolean

Draw a hook card (a short headline grounded in the clip) over its first seconds.

Defaulttrue
hookStyle?string

Look of the hook card: pill (rounded label), classic, dark, yellow, red, outline, outline_yellow, title_card (a white box hugging each line, black bold sans), title_card_serif (the same in a heavy serif), headline (outlined white text, words marked *like this* in yellow) or bubble (a white speech bubble with a tail toward the face). The last four sit just above the seam of a facecam-over-gameplay clip.

Default"pill"
Value in"pill""classic""dark""yellow""red""outline""outline_yellow""title_card""title_card_serif""headline""bubble"
maxMinutes?number

Only process the first N minutes of the source. Omit it to process the whole video.

Range0 < value
resolution?string

Size of the clips: the frame's short side, keeping aspectRatio's shape (default 1080p).

  • 1080p: 1080x1920 (9:16), 1080x1080 (1:1), 1920x1080 (16:9), 1080x1350 (4:5).
  • 720p: 720x1280 (9:16), 720x720 (1:1), 1280x720 (16:9), 720x900 (4:5).

720p files are about 40% smaller and render faster. Captions, the hook card and the watermark scale with the frame.

Default"1080p"
Value in"1080p""720p"
sourceKey*string

The key returned by POST /uploads, after the PUT finished. It must be one of your own uploads.

Length1 <= length <= 1024
sourceSeconds?number

Ignored, and kept so older clients still validate: the job is held and charged for the length measured from the upload itself (cut to maxMinutes), never for what a caller says.

Range0 < value <= 36000

Response Body

Accepted: the job is queued.

application/json
  1. response

The queued job.

jobId*string

Id of the new job. Poll GET /clip-jobs/{jobId}.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/clip-jobs' \  -H 'Content-Type: application/json' \  -d '{  "sourceKey": "uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"}'
Example Response
{  "jobId": "5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"}