Skip to content

API reference / Clips

Create clips from a finished analysis

POST
/vod-analysis/{id}/clip-jobs

Starts cutting the analysis’s video into vertical (9:16) clips and returns the new job at once, in state SUBMITTING. Handing the video over can take minutes; poll getClipJob until the job is READY or FAILED. Clips can only be created while the analysis’s clips.available is true; otherwise 409 and nothing is created.

While emailVerificationRequired is true, the caller’s email must be confirmed, as for creating an analysis: otherwise 403 (EMAIL_NOT_VERIFIED) and nothing is created.

Every job counts towards the caller’s daily clip limits (429), also one that fails or is deleted later. The clips a job makes count towards the plan’s clips per period (clips in getUsage) once it is READY.

Not idempotent: repeating an accepted request creates another job and consumes quota again. After a timeout or lost response, inspect listClipJobs for this analysis before deciding to create another job. There is no idempotency-key header to deduplicate creation requests. An explicit 503 (CLIPS_UNAVAILABLE) creates nothing and can be retried later. See https://mediaseer.ai/docs/guides/retries/ for retry and reconciliation guidance.

Quota recovery policy

id
required
string

The analysis’s opaque id, returned by createVodAnalysis or listVodAnalyses.

Media typeapplication/json
object
mode
required

What to make.

string
Allowed values: FULL_VERTICAL_CROP PROMPTED_CLIPS MICRODRAMA
prompt

What the clips should show, in the user’s words. Required with PROMPTED_CLIPS, refused with any other mode, and refused when it is only whitespace (VALIDATION).

string
>= 1 characters <= 1000 characters

Example

The three funniest moments
options

Settings for the clips. Leaving out an option, or options as a whole, means its default.

object
subtitles

Burn subtitles of what is said into the clips.

boolean
default: true

Created. The job is SUBMITTING.

Media typeapplication/json

One request to cut an analysis’s video into clips, and its outcome.

object
id
required

Identifier of the clip job.

string
analysisId
required

The id of the analysis whose video the clips are cut from.

string
state
required

Where the job is. Brought up to date when the job is read.

string
Allowed values: SUBMITTING PROCESSING READY FAILED
mode
required

What the job makes.

string
Allowed values: FULL_VERTICAL_CROP PROMPTED_CLIPS MICRODRAMA
prompt

The prompt given at create. Only set with PROMPTED_CLIPS.

string
options
required

The options the job uses, defaults included.

object
subtitles

Burn subtitles of what is said into the clips.

boolean
default: true
createdAt
required

When the job was created.

string format: date-time
updatedAt
required

When the job last changed.

string format: date-time
finishedAt

When the job became READY or FAILED.

string format: date-time
error

Why the job failed. Only set in state FAILED.

object
code
required

The reason, for clients to branch on.

string
Allowed values: SOURCE_REJECTED UNAVAILABLE BUSY PIPELINE_FAILED LAUNCH_FAILED OUTCOME_UNKNOWN
message
required

The reason in words, safe to show to the user.

string
episodes

The clips, in order; their number is the episode count. Only set in state READY, and then with at least one clip.

Array<object>

One clip of a READY job.

object
number
required

Position of the clip in the job, counted from 1 without gaps. The episode of getClipEpisodeMedia.

integer
>= 1
title

Title the clip service gave the clip. Absent when it gave none.

string
editedAt

When the newest edit of the clip finished in the web app’s editor; get it with getClipEpisodeMedia and version=EDITED. Brought up to date when the job is read. Absent while the clip has no finished edit.

string format: date-time
editable

Whether the web app can open the job’s clips in its editor now: the job is READY and this environment offers the editor. Clips are edited only in the web app. Treat an absent editable as false.

boolean

Example

{
"id": "0b9e4d2c-5a1f-4e8b-b3c7-2f6a9d1e8c40",
"analysisId": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c",
"state": "SUBMITTING",
"mode": "FULL_VERTICAL_CROP",
"prompt": "The three funniest moments",
"options": {
"subtitles": true
},
"error": {
"code": "SOURCE_REJECTED",
"message": "This video can't be used for clips."
},
"episodes": [
{
"number": 1,
"title": "The storm hits the harbour"
}
]
}

The request is malformed or fails validation (VALIDATION).

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

Missing, invalid or expired credentials (UNAUTHENTICATED).

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

Confirming the email is required, and the caller’s email is not confirmed yet (EMAIL_NOT_VERIFIED).

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

No such resource for this caller (NOT_FOUND). Other users’ resources look the same.

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

No clips can be created from this analysis (INVALID_STATE): its clips.available is false, and clips.reason says why.

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

A clip limit was hit (QUOTA_EXCEEDED). details[].field can name clips (the clips your plan includes in this period), activeClipJobs (the caller’s jobs SUBMITTING or PROCESSING at once) or dailyClipJobs (the jobs the caller created this UTC day). Every job created counts towards the daily limit, also when it fails or is deleted. Storage never refuses a clip job: clips have no storage limit.

  • clips: the clips of this period are used up (clips in getUsage). They start again from 0 at period.end; deleting clip jobs does not give them back.
  • activeClipJobs: wait for an existing job to finish, reading getClipJob to refresh its state, or delete an unwanted job to free its active slot.
  • dailyClipJobs: wait until the next UTC day; deleting or failing a job does not refund it.

Follow the response’s guidance for another refusal. These quota refusals do not include a Retry-After header; do not repeatedly retry an unchanged request. See https://mediaseer.ai/docs/guides/retries/#quota-refusals for recovery guidance.

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

This environment offers no clips (CLIPS_NOT_CONFIGURED): its backend has no access to the clip service. Trying again does not help.

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

Creating clips is temporarily unavailable (CLIPS_UNAVAILABLE). Nothing was created; try again later.

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}

Unexpected error

Media typeapplication/json
object
code
required

Stable machine-readable code. Clients branch on this, never on message.

string
Allowed values: VALIDATION UNAUTHENTICATED INVALID_TOKEN FORBIDDEN EMAIL_NOT_VERIFIED NOT_FOUND INVALID_STATE UPLOAD_INCOMPLETE QUOTA_EXCEEDED RATE_LIMITED UPSTREAM_ERROR CLIPS_NOT_CONFIGURED CLIPS_UNAVAILABLE INTERNAL
message
required

Human-readable, safe to show to the user. For VALIDATION with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and details lists them.

string
details

Optional field-level or limit-level detail.

Array<object>
object
field

The request field the detail refers to, if any; for QUOTA_EXCEEDED, the limit that was hit.

string
message
required
string

Example

{
"code": "VALIDATION",
"message": "The file is larger than the limit of 2147483648 bytes.",
"details": [
{
"field": "sizeBytes",
"message": "must be at most 2147483648"
}
]
}