> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iacrea.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Regenerate Sequence API

> Regenerate a specific sequence of a video

# Regenerate Sequence API

Regenerates a specific sequence of an existing video. Useful to fix a failed sequence or change the animation of a particular sequence.

<ParamField path="POST /api/video-editor/generate/sequence/{id}" />

## Authentication

All requests must include the header:

* `x-api-key: YOUR_API_KEY`

## Headers

<ParamField header="x-api-key" type="string" required>
  Your IACrea API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

## URL Parameters

<ParamField path="id" type="string" required>
  Unique video identifier (returned by `POST
      /api/video-editor/generate/video`)
</ParamField>

## Request Body

<ParamField body="sequenceId" type="string" required>
  Identifier of the sequence to regenerate (found in `generatedContent` of
  the response from `GET /api/video-editor/generate/video/{id}`)
</ParamField>

<ParamField body="sequence" type="object">
  Optional parameters for the new generation
</ParamField>

<ParamField body="sequence.url" type="string">
  New image URL to use (if different from original). Optional.
</ParamField>

<ParamField body="sequence.effect" type="string">
  New animation type to use. Optional.
</ParamField>

## Responses

### 200 — Regeneration started

<ResponseField name="status" type="string">
  Status: `"START_GENERATION"`
</ResponseField>

<ResponseField name="generationId" type="string">
  Identifier of the new generation for this sequence
</ResponseField>

<ResponseField name="creditsTotal" type="number">
  Remaining video credits
</ResponseField>

<ResponseField name="creditsUsed" type="number">
  Credits used
</ResponseField>

### 400 — Validation error

Returned if the video `id` or `sequenceId` is invalid.

### 401 — Unauthorized

Returned if `x-api-key` is missing or invalid.

### 404 — Not Found

Returned if the video or sequence does not exist.

### 500 — Server Error

Internal server error.

## Request Example

```bash theme={null}
curl --request POST \
  --url 'https://iacrea.com/api/video-editor/generate/sequence/550e8400-e29b-41d4-a716-446655440000' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "sequenceId": "660e8400-e29b-41d4-a716-446655440001",
    "sequence": {
      "url": "https://example.com/new-image.jpg",
      "effect": "CAMERA_PUSH_OUT"
    }
  }'
```

## Response Example

```json theme={null}
{
  "status": "START_GENERATION",
  "generationId": "770e8400-e29b-41d4-a716-446655440003",
  "creditsTotal": 47,
  "creditsUsed": 3
}
```

## Important Notes

* Regenerating a sequence resets the video status to `"pending"` and cancels the final render if it was in progress
* You must use `GET /api/video-editor/generate/video/{id}` to track the progress of the new generation
* If you do not provide `sequence.url` or `sequence.effect`, the original values will be reused
* Regeneration consumes additional video credits
