---
title: "Edit your video with a template"
method: POST
path: "/v1/templates/{id}/run"
tags: ["Templates"]
---

# Edit your video with a template

`POST /v1/templates/{id}/run`

## Request

- Base URL: `https://apihub.co.il`
- URL: `https://apihub.co.il/v1/templates/{id}/run`
- Auth: HTTP bearer

Opens a video-agent run: the transcript, then a model watches the video and picks the moments for the template, then ONE render in its look at the level asked. Every extra of the `full` level is optional — one that fails is left out and not charged. An AI clip is made only inside `max_credits`, above the plan's price. With `max_credits` the plan is approved by itself while it stays within it; otherwise approve it with POST /v1/agent/runs/{run}/actions { "action": "approve" }. Follow the run with GET /v1/agent/runs/{run}.

## Path parameters

- `id` string, required

## Request body

- object
  - `media_url` string, uri, required: The video to edit: a public file, or an upload (POST /v1/agent/uploads)
  - `media_name` string, nullable
  - `level` 'captions' | 'hook' | 'full'
  - `locale` 'he' | 'en' | 'ru' | 'uk' | 'null', nullable
  - `max_credits` integer, nullable: Approve the plan without asking while its total stays within this many credits; the room above the plan's price may pay for AI clips
  - `profile_id` string, nullable: Your agent (GET /v1/agent/profiles): its networks and publishing stay; the look is the template's
  - `client_key` string, nullable: Your idempotency key: the same key twice returns 409 instead of a second run

## Response `201`

The run (as GET /v1/agent/runs/{run}) and `template: { id, level }`

## Other responses

- `400`: invalid_input
- `404`: template_not_found
- `409`: template_not_available (still being built, or it needs a switch not open for you) · duplicate_client_key

---

[API](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai.md) · [All operations](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/apihub/apis/apihub-one-api-for-chat-image-video-ai/revisions/a8caa42835ce?raw)
