> ## 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.

# Get Video API

> Retrieve the status and URL of a video being generated

# Get Video API

Retrieves the status of a video being generated and automatically triggers the next steps (clip generation, final render). This endpoint is **idempotent** and can be called regularly to track progress.

<ParamField path="GET /api/video-editor/generate/video/{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>

## URL Parameters

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

## Responses

This endpoint returns different statuses depending on the generation progress:

### 200 — `status: "GENERATING_VIDEO"`

Video clips (sequences) are being generated.

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

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

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

<ResponseField name="generatedContent" type="array">
  List of generated content with their current status (`"pending" | "success" |
      "error"`)
</ResponseField>

### 200 — `status: "START_RENDERING_VIDEO"`

All sequences are ready and the final video render is starting.

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

<ResponseField name="progress" type="number">
  Render progress (0 at start)
</ResponseField>

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

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

<ResponseField name="generatedContent" type="array">
  List of generated content
</ResponseField>

### 200 — `status: "RENDERING_VIDEO"`

The final video render is in progress.

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

<ResponseField name="progress" type="number">
  Render progress (number between 0 and 1, or 0-100 depending on implementation)
</ResponseField>

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

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

### 200 — `status: "DONE"`

The final video is ready and available.

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

<ResponseField name="url" type="string">
  URL of the generated final video
</ResponseField>

<ResponseField name="id" type="string">
  Video identifier
</ResponseField>

<ResponseField name="generatedContent" type="array">
  List of generated content with their final status
</ResponseField>

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

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

### 200 — `status: "PENDING"`

Transitional state. May be returned when a sequence has an error and regeneration is automatically restarted on the server.

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

<ResponseField name="error" type="string">
  Optional error message (e.g. `"Re-generating video in error"`)
</ResponseField>

### 401 — Unauthorized

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

### 404 — Not Found

Returned if the video `id` does not exist.

### 500 — Server Error

Internal server error.

## Request Example

```bash theme={null}
curl --request GET \
  --url 'https://iacrea.com/api/video-editor/generate/video/550e8400-e29b-41d4-a716-446655440000' \
  --header 'x-api-key: YOUR_API_KEY'
```

## Response Examples

### Generation in progress

```json theme={null}
{
  "status": "GENERATING_VIDEO",
  "creditsTotal": 48,
  "creditsUsed": 2,
  "generatedContent": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "url": "https://example.com/image1.jpg",
      "effect": "CAMERA_PUSH_IN",
      "format": "landscape",
      "status": "success"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440002",
      "url": "https://example.com/image2.jpg",
      "effect": "CAMERA_PUSH_OUT",
      "format": "landscape",
      "status": "pending"
    }
  ]
}
```

### Render in progress

```json theme={null}
{
  "status": "RENDERING_VIDEO",
  "progress": 0.65,
  "creditsTotal": 48,
  "creditsUsed": 2
}
```

### Video complete

```json theme={null}
{
  "status": "DONE",
  "url": "https://storage.iacrea.com/videos/550e8400-e29b-41d4-a716-446655440000.mp4",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "generatedContent": [
    {
      "id": "660e8400-e29b-41d4-a716-446655440001",
      "url": "https://example.com/image1.jpg",
      "effect": "CAMERA_PUSH_IN",
      "format": "landscape",
      "status": "success"
    },
    {
      "id": "660e8400-e29b-41d4-a716-446655440002",
      "url": "https://example.com/image2.jpg",
      "effect": "CAMERA_PUSH_OUT",
      "format": "landscape",
      "status": "success"
    }
  ],
  "creditsTotal": 48,
  "creditsUsed": 2
}
```

## Integration Recommendations

* **Polling**: Call this endpoint every **2-5 seconds** until you get status `"DONE"` or `"ERROR"`
* **Timeout**: Plan for a client-side timeout (e.g. 10-20 minutes) depending on render duration
* **Resilience**: If you receive `"PENDING"` after already seeing `"GENERATING_VIDEO"`, keep polling: the server may automatically restart failed sequences
* **Webhook**: If you provided a `webhookUrl` when creating the video, you will also receive a notification when the video is ready
