Skip to content

Create shorts, a promo, or clips

POST
/videos/{videoId}/shorts
curl --request POST \
--url https://api.braiv.co/v1/videos/vid_01JZ8M6A/shorts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: import-launch-demo-20260901' \
--data '{ "kind": "shorts", "numClips": 3, "minDuration": 20, "maxDuration": 60, "aspectRatio": "9:16", "captionStyle": "highlight", "captionPosition": "bottom" }'

Queues the selected shorts-family workflow. The request is discriminated by kind; fields accepted by one variant are not forwarded to another. Poll getShorts until it returns 200 or 422. Required scope: shorts:write.

videoId
required
string
>= 1 characters

Braiv library video document ID.

Example
vid_01JZ8M6A
Idempotency-Key
string
>= 1 characters

Caller-generated key for safe POST retries. The API retains the first JSON response for 24 hours. Reusing a key with another path or body returns 409 IDEMPOTENCY_REPLAY.

Example
import-launch-demo-20260901
Media type application/json
Any of: discriminator: kind
Shorts

Generate short highlight videos with configurable duration, framing, and captions.

object
kind

Selects short highlight generation. You may omit this field because shorts is the default.

string
default: shorts
Allowed value: shorts
numClips

Number of separate highlight videos to generate. Send a JSON integer from 1 to 10.

integer
default: 3 >= 1 <= 10
minDuration

Shortest acceptable clip length in seconds. Send a JSON number from 15 to 180 that is no greater than maxDuration.

number
default: 15 >= 15 <= 180
maxDuration

Longest acceptable clip length in seconds. Send a JSON number from 15 to 180 that is no less than minDuration.

number
default: 180 >= 15 <= 180
aspectRatio

Output frame shape: 9:16 is vertical for Shorts, Reels, and TikTok; 16:9 is landscape; and 1:1 is square.

string
default: 9:16
Allowed values: 9:16 16:9 1:1
captionStyle

Visual preset used to burn captions into each clip.

  • default — uppercase text with an outline and soft shadow.
  • karaoke — uppercase text that progressively highlights words as they are spoken.
  • modern — uppercase text that highlights the currently spoken word.
  • impact — one large uppercase word at a time with a hard shadow.
  • subtle — smaller mixed-case text on a semi-transparent dark background.
  • highlight — the current word appears on a solid highlight-colour box while surrounding words are dimmed.
  • pro_highlight — a compact, outline-free single-word highlight treatment.
string
default: default
Allowed values: default karaoke modern impact subtle highlight pro_highlight
captionPosition

Vertical caption placement: top uses the upper safe area, middle centres the captions, and bottom uses the lower safe area.

string
default: bottom
Allowed values: top middle bottom
clipSelectionPrompt

Optional natural-language guidance for choosing moments from the source video. Describe topics, speakers, or moments to prioritise. The value is trimmed, must be no more than 2,000 characters, and an empty string is treated as omitted.

string
<= 2000 characters
Examples
{
"kind": "shorts",
"numClips": 3,
"minDuration": 20,
"maxDuration": 60,
"aspectRatio": "9:16",
"captionStyle": "highlight",
"captionPosition": "bottom"
}

Shorts-family request queued.

Media type application/json
object
shortsRequestId
required

Created shorts-family request ID.

string
jobId
required

Pollable shorts job ID.

string
creditsSpent
required

Credits charged or consumed from escrow.

number
balance
required

Remaining account credit balance.

number
Example
{
"shortsRequestId": "req_01JZA",
"jobId": "shorts_req_01JZA",
"creditsSpent": 60,
"balance": 240
}

Request fields are missing, malformed, out of bounds, or mutually inconsistent.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Example
{
"error": {
"code": "INVALID_ARGUMENT",
"message": "The request contains invalid or missing fields.",
"details": {}
}
}

A supported authentication header is missing or contains an invalid Public API key.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Examples

Authentication header missing

{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing API key.",
"details": {}
}
}

Authentication succeeded, but the required scope, workspace role, or resource permission is missing.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Examples
Example scope
{
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "The API key lacks the required scope.",
"details": {}
}
}

The resource does not exist or is not accessible to the caller.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Example
{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found.",
"details": {}
}
}

The Idempotency-Key was reused with a different path or request body.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Example
{
"error": {
"code": "IDEMPOTENCY_REPLAY",
"message": "Idempotency-Key was reused with a different request.",
"details": {
"pathMatch": true,
"hashMatch": false
}
}
}

The account has insufficient credits, or the request exceeded a rate limit.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Example
{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "Not enough credits.",
"details": {
"required": 60,
"available": 20,
"shortfall": 40
}
}
}

An unexpected server error occurred.

Media type application/json
object
error
required

Structured public API error envelope.

object
code
required

Stable machine-readable error code.

string
Allowed values: UNAUTHENTICATED INVALID_API_KEY INSUFFICIENT_SCOPE PERMISSION_DENIED ROLE_CANNOT_PRODUCE NOT_FOUND INVALID_ARGUMENT UNSUPPORTED_SOURCE DURATION_UNKNOWN INSUFFICIENT_CREDITS CONFLICT ALREADY_EXISTS IDEMPOTENCY_REPLAY RATE_LIMITED PREVIEW_NOT_DOWNLOADABLE DOWNLOAD_TIER_NONE FAILED_PRECONDITION GONE METHOD_NOT_ALLOWED INTERNAL
message
required

Human-readable error summary.

string
details
required

Machine-readable operation-specific context; empty when unavailable.

object
key
additional properties
any
Example
{
"error": {
"code": "INTERNAL",
"message": "An unexpected error occurred.",
"details": {}
}
}