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

# Export Project

> Trigger the rendering/export process for a completed project to generate the final video

# Export Project

Triggers the rendering/export process for a completed project. This starts the video generation process asynchronously with customizable output parameters.

> [!NOTE]
>
> This endpoint requires authentication and has enhanced rate limits for
> API-generated projects. The export process is asynchronous - use webhooks or
> polling to track completion.

## Authentication

**x-api-key** `string` *required*

Your Submagic API key starting with `sk-`

## Path Parameters

**id** `string` *required*

The unique identifier (UUID) of the project to export

## Request Body (Optional)

All parameters are optional. If not provided, the system uses optimal defaults based on the project's original video metadata.

**fps** `number`

Frames per second for the exported video (1-60). Defaults to project's
original fps or 30.

**width** `number`

Video width in pixels (100-4000). Defaults to project's original width or
1080\.

**height** `number`

Video height in pixels (100-4000). Defaults to project's original height or
1920\.

**webhookUrl** `string`

URL to receive notification when export is complete. Must be a valid URL
format.

## Prerequisites

Before exporting a project, ensure:

* **Project is transcribed**: Must have words data available
* **Project is not uploading**: Cannot be in "uploading" status
* **Project ownership**: Must belong to the authenticated user
* **API-generated project**: Must be created via API

## Response

**message** `string`

Success message confirming the export has started

**projectId** `string`

The unique identifier of the project being exported

**status** `string`

Current status of the project after export trigger

## Error Responses

**error** `string`

Error code: `NOT_FOUND`, `BAD_REQUEST`, or `INTERNAL_SERVER_ERROR`

**message** `string`

Detailed error message explaining the issue

> [!NOTE]
>
> A project Iris edited renders Iris's latest version (see [Message
> Iris](https://docs.submagic.co/api-reference/iris-message.md)). Its `200` response is `{ "message",
>     "success", "irisVersion" }`, with the version being rendered.

## Webhook Notifications

If you provide a `webhookUrl`, the system will send a POST request to your URL when export completes,
including export details and download URL in the notification.

## Export Status Tracking

After triggering an export:

1. **Monitor Progress**: Call `GET /v1/projects/{id}` to check export progress
2. **Check Download URL**: The `downloadUrl` and `directUrl` fields will be populated once rendering is complete

```bash cURL - Basic Export theme={null}
curl -X POST "https://api.submagic.co/v1/projects/550e8400-e29b-41d4-a716-446655440000/export" \
  -H "x-api-key: sk-your-api-key-here" \
  -H "Content-Type: application/json"
```

```bash cURL - Custom Parameters theme={null}
curl -X POST "https://api.submagic.co/v1/projects/550e8400-e29b-41d4-a716-446655440000/export" \
  -H "x-api-key: sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "fps": 30,
    "width": 1920,
    "height": 1080,
    "webhookUrl": "https://yoursite.com/webhook/export-complete"
  }'
```

```javascript JavaScript - Basic Export theme={null}
const exportProject = async (projectId) => {
  const response = await fetch(
    `https://api.submagic.co/v1/projects/${projectId}/export`,
    {
      method: "POST",
      headers: {
        "x-api-key": "sk-your-api-key-here",
        "Content-Type": "application/json",
      },
    }
  );

  const result = await response.json();
  console.log("Export started:", result.message);
  return result;
};

// Usage
const result = await exportProject("550e8400-e29b-41d4-a716-446655440000");
```

```javascript JavaScript - With Custom Parameters theme={null}
const exportProjectWithOptions = async (projectId, options = {}) => {
  const response = await fetch(
    `https://api.submagic.co/v1/projects/${projectId}/export`,
    {
      method: "POST",
      headers: {
        "x-api-key": "sk-your-api-key-here",
        "Content-Type": "application/json",
      },
      body: JSON.stringify(options),
    }
  );

  const result = await response.json();
  console.log("Export started:", result.message);
  return result;
};

// Usage with options
const exportOptions = {
  fps: 30,
  width: 1920,
  height: 1080,
  webhookUrl: "https://yoursite.com/webhook/export-complete",
};

const result = await exportProjectWithOptions(
  "550e8400-e29b-41d4-a716-446655440000",
  exportOptions
);
```

```python Python - Basic Export theme={null}
import requests

def export_project(project_id):
    url = f'https://api.submagic.co/v1/projects/{project_id}/export'
    headers = {
        'x-api-key': 'sk-your-api-key-here',
        'Content-Type': 'application/json'
    }

    response = requests.post(url, headers=headers)
    result = response.json()

    print(f"Export started: {result.get('message')}")
    return result

# Usage
result = export_project('550e8400-e29b-41d4-a716-446655440000')
```

```python Python - With Custom Parameters theme={null}
import requests
import json

def export_project_with_options(project_id, options=None):
    url = f'https://api.submagic.co/v1/projects/{project_id}/export'
    headers = {
        'x-api-key': 'sk-your-api-key-here',
        'Content-Type': 'application/json'
    }

    response = requests.post(url, headers=headers, json=options)
    result = response.json()

    print(f"Export started: {result.get('message')}")
    return result

# Usage with options
export_options = {
    'fps': 30,
    'width': 1920,
    'height': 1080,
    'webhookUrl': 'https://yoursite.com/webhook/export-complete'
}

result = export_project_with_options(
    '550e8400-e29b-41d4-a716-446655440000',
    export_options
)
```

```json 200 OK - Export Started theme={null}
{
  "message": "Export started successfully",
  "projectId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "exporting"
}
```

```json 404 NOT_FOUND - Project Not Found theme={null}
{
  "error": "NOT_FOUND",
  "message": "Project doesn't exist or doesn't belong to user"
}
```

```json 400 BAD_REQUEST - Project Not Ready theme={null}
{
  "error": "BAD_REQUEST",
  "message": "Project not ready for export"
}
```

```json 400 BAD_REQUEST - Invalid Parameters theme={null}
{
  "error": "BAD_REQUEST",
  "message": "Invalid fps value. Must be between 1 and 60"
}
```

```json 500 INTERNAL_SERVER_ERROR - Export Failed theme={null}
{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "Export failed to start"
}
```

> [!NOTE]
>
> **Tip**: After triggering an export, use the [Get
> Project](https://docs.submagic.co/api-reference/get-project.md) endpoint to monitor the export progress.
> The `downloadUrl` and `directUrl` fields will be populated once the rendering
> is complete.

> [!WARNING]
>
> **Important**: The export process is asynchronous. The API will return
> immediately after starting the export, but the actual video rendering happens
> in the background. Use webhooks or polling to track completion status.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.