Styling

Styling

You can fully customize the visual style of your videos in the Klap editor and reuse that look via a preset.

Create a Style Preset

  1. Open the Klap editor at klap.app.
  2. Customize captions, fonts, colors, add a logo, an intro or outro video, and more.
  3. Save your style as a preset.
  4. On your preset card, click the ... menu, then click “Copy id”.
  5. Use the copied value as style_preset_id in your API request body.

Use With Tasks

Both task types accept style_preset_id in the request payload.

Video to Shorts

POST /v2/tasks/video-to-shorts
Authorization: Bearer <your-api-key>
Content-Type: application/json
 
{
  "source_video_url": "https://example.com/video.mp4",
  "language": "en",
  "style_preset_id": "dd2875e8-4e75-4887-973c-2adc928dd2ab",
  "target_clip_count": 5,
  "editing_options": {
    "captions": true,
    "reframe": true
  }
}

Video to Video

POST /v2/tasks/video-to-video
Authorization: Bearer <your-api-key>
Content-Type: application/json
 
{
  "source_video_url": "https://example.com/video.mp4",
  "language": "en",
  "style_preset_id": "dd2875e8-4e75-4887-973c-2adc928dd2ab",
  "editing_options": {
    "captions": true,
    "reframe": true
  }
}

Intro and Outro From a URL

You can set a preset’s intro and outro through the API, from the URL of a video, without opening the editor. Every video generated with the preset then plays it before or after the content.

Create a Preset

Endpoint: POST /templates

POST /v2/templates
Authorization: Bearer <your-api-key>
Content-Type: application/json
 
{
  "name": "Brand",
  "config": {
    "intro": { "url": "https://example.com/intro.mp4" },
    "outro": { "url": "https://example.com/outro.mp4" }
  }
}

The response (201) is the preset. Use its id as style_preset_id. Settings you don’t send use Klap’s default style.

{
  "id": "dd2875e8-4e75-4887-973c-2adc928dd2ab",
  "name": "Brand",
  "is_klap_preset": false,
  "config": {
    "intro": { "mediaId": "6f1c2a9e-7c1b-5d0a-9a57-3f6f0c8f2b11", "srcStart": 0, "duration": null, "muted": false, "volume": 1, "layout": "blur" },
    "outro": { "mediaId": "b05d0ea0-55d4-526b-a9ea-c36c2a371744", "srcStart": 0, "duration": null, "muted": false, "volume": 1, "layout": "blur" }
  },
  "created_at": "2026-12-01T10:00:00.000Z",
  "updated_at": "2026-12-01T10:00:00.000Z"
}

config also holds the preset’s other settings (captions, reframing and so on), left out here.

Update a Preset

Endpoint: PATCH /templates/{template_id}

template_id is the preset’s id: the one returned above, or the one copied from the editor. Only what you send changes.

PATCH /v2/templates/dd2875e8-4e75-4887-973c-2adc928dd2ab
Authorization: Bearer <your-api-key>
Content-Type: application/json
 
{
  "config": {
    "intro": { "url": "https://example.com/new-intro.mp4" },
    "outro": null
  }
}
Value of intro or outroResult
Not sentThe preset keeps the intro or outro it has
An object with a urlThe video at this URL becomes the preset’s intro or outro
An object without a url, for example { "muted": true }Only these settings change, the video stays
nullThe preset has no intro or outro

The response (200) is the updated preset, in the same format.

Intro and Outro Fields

ParameterTypeRequiredDescription
urlstringYes, to set a videoURL of the video, starting with http:// or https://. A direct link to a video file, or a link to a single video on YouTube, Vimeo, Twitch, Loom, Google Drive or Dropbox
mutedbooleanNoPlay the video without its audio (default: false)
volumenumberNoVolume of the video’s audio, from 0 to 10 (default: 1)
layoutstringNo"blur" fits the whole video inside the short over a blurred copy of itself. "full" centers it and crops it to fill the short (default: "blur")
srcStartnumberNoWhere the video starts, in microseconds from its beginning (default: 0)
durationnumber | nullNoHow much of the video plays, in microseconds. null plays it to its end (default: null)
  • The video can be up to 120 seconds long.
  • Klap downloads the video and keeps its own copy when you send the request, so the link only has to work at that moment. The preset stores the copy as a mediaId, which the response returns. You can send mediaId in place of url to use that copy again; sending both is rejected with a 400 error.
  • The request answers once the video is ready: within a few seconds as a rule, sometimes up to a minute. If the video is not ready after 90 seconds, the answer is 503 and the preset is not changed. Send the same request again.
  • When you update a preset with a new url, the new video plays in full from its first frame unless you send srcStart or duration. muted, volume and layout stay as the preset had them.
  • Intro and outro videos get no captions and no automatic reframing.
  • With managed users, create the preset with the same X-On-Behalf-Of header as the tasks that use it. A video only gets the intro or outro when the preset’s video belongs to the user the task is created for.

Errors

If the video can’t be used, the preset is not created or changed.

Statuserror_codeMeaning
400-url is not an http:// or https:// URL, is sent with mediaId, or a field is invalid
422invalid_videoKlap couldn’t read the link as a single video, or couldn’t download or process it
422no_video_streamThe file has no video track
422video_too_longThe video is longer than 120 seconds
503-The video is still being prepared. Send the same request again in a moment

A link to a provider can also be refused with the provider’s own reason, for example yt_video_not_available.

Notes

  • If style_preset_id is provided, its styling will be applied to the generated video(s).
  • If the preset has an intro or outro video, every generated video plays it before or after the content. To set it through the API, see Intro and Outro From a URL. To use a different intro or outro, or none, for one export, see Intro and Outro.
  • You can override aspects of a preset by combining style_preset_id with specific editing_options or dimensions in the same request.
  • For full task request details, see Tasks.