---
operationId: startVodAnalysis
title: Start the analysis after the upload finished
url: "https://mediaseer.ai/docs/api/operations/startvodanalysis/"
---

# Start the analysis after the upload finished

> Starting an analysis is a paid start. Stopping or deleting the analysis does not give it back. The numbers are on the [limits page](https://mediaseer.ai/docs/limits/).

`POST /vod-analysis/{id}/start`

URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/start`

Verifies that the uploaded object exists in storage, records its size and starts the encoding with scene analysis. Moves the resource from `UPLOADING` to `QUEUED`. Refused (`429`, field `minutes`) when no analysed minutes are left in this period; a video longer than the minutes left ends `FAILED` once its length is known (`minutes` in `getUsage`).

While `QUEUED`, the whole video is read to check its length before the encoding starts. A file that can’t be read as a video, one without a video track, and a video longer than the length limit or the minutes left end `FAILED` with a reason in `error.message`; such a start doesn’t count towards the daily starts, and no minutes are counted.

Idempotent: calling it again while `QUEUED` or `PROCESSING` returns the current resource without starting anything. In a terminal state it returns `409`, as does an `UPLOADING` resource whose upload window (7 days from creation) has passed: create a new one instead. A `502` (`UPSTREAM_ERROR`) can be retried safely. Check the analysis’s state after an uncertain answer. See <https://mediaseer.ai/docs/guides/retries/> for retry and reconciliation guidance.

[Quota recovery policy](https://mediaseer.ai/docs/guides/retries/#quota-refusals)

## Authorizations

- **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)**

## Parameters

### Path Parameters

- `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`.

## Responses

### 202

Accepted. The resource is `QUEUED` (or already further along). Poll `getVodAnalysis` (`GET /vod-analysis/{id}`) with this resource’s `id` until `state` is `FINISHED`, `FAILED` or `CANCELLED`. The `Location` header is a same-origin status-resource URI reference; resolve it against the request URL. Acceptance does not mean that results are ready.

Media type: application/json

object

- `id` string, required

- `state` string, required

  - `UPLOADING`: created, waiting for the client to upload and call `start`
  - `QUEUED`: started; the video’s length is checked, then it waits to be processed
  - `PROCESSING`: encoding and analysis running
  - `FINISHED`: results available
  - `FAILED`: could not start or finish, or the video was too long; see `error`
  - `CANCELLED`: stopped by you or the processing service

  Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED`

- `fileName` string, required: Name of the uploaded file.

- `createdAt` string, format: date-time, required

- `title` string: Given at create, else inferred by the analysis.

- `description` string: Summary of the whole video, from the analysis.

- `sceneCount` integer

- `keywords` Array\<string>

- `durationSeconds` number, format: double

- `updatedAt` string, format: date-time, required

- `sizeBytes` integer, format: int64: Size of the uploaded object; known from `start` on.

- `startedAt` string, format: date-time: When `start` was accepted.

- `finishedAt` string, format: date-time: When the resource reached a terminal state.

- `error`: Why the analysis failed. Only set in state `FAILED`.

  object

  - `message` string, required: A sentence for people, in Mediaseer’s own words, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording.

- `clips`: Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available.

  object

  - `available` boolean, required: Whether clips can be created from the analysis now.

  - `reason` string: Why not. Set exactly while `available` is `false`.

    Allowed values: `UNSUPPORTED_FILE_TYPE`, `NOT_FINISHED`, `TOO_LONG`, `CREATED_BEFORE_CLIPS`, `SOURCE_NOT_KEPT`

#### Example

```json
{
  "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c",
  "state": "UPLOADING",
  "fileName": "episode-01.mp4",
  "title": "Los Angeles 1947",
  "description": "A noir mystery set in Los Angeles in 1947.",
  "sceneCount": 9,
  "keywords": [
    "Los Angeles",
    "1947",
    "mystery"
  ],
  "durationSeconds": 719.02,
  "sizeBytes": 734003200,
  "error": {
    "message": "The encoding failed."
  },
  "clips": {
    "reason": "UNSUPPORTED_FILE_TYPE"
  }
}
```

#### Headers

- `Location` string, format: uri-reference: Status resource for this analysis, also returned on an idempotent accepted start.

  ##### Example

  ```plaintext
  /api/v1/vod-analysis/747eab8d-d788-4abd-ae9e-144b930df539
  ```

### 401

Missing, invalid or expired credentials (`UNAUTHENTICATED`).

Media type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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

### 403

The credentials are valid but this action is not allowed (`FORBIDDEN`), or a confirmed email is required to create or start an analysis (`EMAIL_NOT_VERIFIED`).

Media type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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

### 404

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

Media type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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

### 409

Not startable. `UPLOAD_INCOMPLETE`: no object was found in storage yet; the analysis stays `UPLOADING`, and a start after the upload has finished can succeed. `INVALID_STATE`: the resource is in a terminal state, or its upload window has passed.

Media type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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

### 429

A limit was hit (`QUOTA_EXCEEDED`). `details[].field` can name your analysis slots (`jobs`), file size (`sizeBytes`), your plan’s storage for source videos (`storage`, when creating an analysis), your plan’s analysed minutes (`minutes`, when starting an analysis) or daily starts (`dailyStarts`).

- `jobs`: delete an analysis you no longer need to free a slot.
- `sizeBytes`: use a smaller file; retrying the same oversized upload does not help.
- `storage`: the file’s size does not fit into what your source videos (`storage.sourceBytes` in `getUsage`) leave of `storage.limitBytes`. Clips do not count. Delete analyses you no longer need; a successful delete frees their storage at once.
- `minutes`: no analysed minutes are left in this period (`minutes` in `getUsage`). They start again from 0 at `period.end`; deleting an analysis does not give them back.
- `dailyStarts`: wait until the next UTC day. Stopping or deleting an analysis does not refund a daily start.

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 type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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

### default

Unexpected error

Media type: application/json

object

- `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`.

  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` string, 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.

- `details` Array\<object>: Optional field-level or limit-level detail.

  object

  - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit.
  - `message` string, required

#### Example

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