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

# Check Export Status

> Check the status of a video export job and get download URL

## Overview

This endpoint allows you to check the current status of a video export job. Use this to monitor export progress and retrieve the download URL when the export is complete.

## Authentication

<Info>
  This endpoint requires API key authentication. Include your API key in the `Authorization` header.
</Info>

## Path Parameters

<ParamField path="jobId" type="string" required>
  The export job ID returned from the `/export/start` endpoint.
</ParamField>

## Response

<ResponseField name="job_id" type="string">
  The unique identifier for the export job.
</ResponseField>

<ResponseField name="status" type="string">
  Current export status:

  * `pending`: Export is queued and waiting to start
  * `processing`: Export is in progress
  * `completed`: Export finished successfully
  * `failed`: Export failed
</ResponseField>

<ResponseField name="progress" type="number">
  Progress percentage (0-100).
</ResponseField>

<ResponseField name="current_step" type="string">
  Description of the current processing step.
</ResponseField>

<ResponseField name="result" type="object">
  Available when status is `completed`:

  <Expandable title="properties">
    <ResponseField name="video_url" type="string">
      Direct download URL for the exported MP4 file.
    </ResponseField>

    <ResponseField name="thumbnail_url" type="string">
      URL to the video thumbnail image.
    </ResponseField>

    <ResponseField name="cost" type="number">
      Actual credits consumed for export.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO timestamp when export completed.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="object">
  Available when status is `failed`:

  <Expandable title="properties">
    <ResponseField name="code" type="string">
      Error code describing the failure reason.
    </ResponseField>

    <ResponseField name="message" type="string">
      Human-readable error message.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://app.hoox.video/api/public/v1/export/status/export_abcd1234" \
    -H "Authorization: Bearer your_api_key"
  ```

  ```python Python theme={null}
  import requests

  job_id = "export_abcd1234"
  url = f"https://app.hoox.video/api/public/v1/export/status/{job_id}"
  headers = {
      "Authorization": "Bearer your_api_key"
  }

  response = requests.get(url, headers=headers)
  data = response.json()
  print(data)

  # Download the video when ready
  if data.get('status') == 'completed':
      video_url = data['result']['video_url']
      video_response = requests.get(video_url)
      with open('video.mp4', 'wb') as f:
          f.write(video_response.content)
  ```

  ```javascript JavaScript theme={null}
  const jobId = "export_abcd1234";
  const response = await fetch(`https://app.hoox.video/api/public/v1/export/status/${job_id}`, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer your_api_key'
    }
  });

  const data = await response.json();
  console.log(data);

  // Download the video when ready
  if (data.status === 'completed') {
    const videoUrl = data.result.video_url;
    const videoResponse = await fetch(videoUrl);
    const blob = await videoResponse.blob();
    
    // Create download link
    const url = window.URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.href = url;
    a.download = 'video.mp4';
    a.click();
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Pending theme={null}
  {
    "job_id": "export_abcd1234",
    "status": "pending",
    "progress": 0,
    "current_step": "render"
  }
  ```

  ```json Processing theme={null}
  {
    "job_id": "export_abcd1234",
    "status": "processing",
    "progress": 65,
    "current_step": "render-audio"
  }
  ```

  ```json Completed theme={null}
  {
    "job_id": "export_abcd1234",
    "status": "completed",
    "progress": 100,
    "current_step": "render",
    "result": {
      "video_url": "https://storage.hoox.video/exports/export_abcd1234.mp4",
      "thumbnail_url": "https://storage.hoox.video/thumbnails/vid_xyz789.jpg",
      "cost": 0,
      "created_at": "2024-01-15T10:35:00Z"
    }
  }
  ```

  ```json Failed theme={null}
  {
    "job_id": "export_abcd1234",
    "status": "failed",
    "progress": 30,
    "current_step": "avatar",
    "error": {
      "code": "ENCODING_FAILED",
      "message": "Failed to encode video in the requested format"
    }
  }
  ```

  ```json Error 404 - Job Not Found theme={null}
  {
    "error": "Export job not found",
    "code": "JOB_NOT_FOUND"
  }
  ```

  ```json Error 403 - Unauthorized Job theme={null}
  {
    "error": "Export job does not belong to your space",
    "code": "UNAUTHORIZED_JOB"
  }
  ```
</ResponseExample>

## Polling Best Practices

<Tip>
  **Recommended polling strategy for exports:**

  1. Start with 3-second intervals (exports are typically faster than generation)
  2. Increase to 5-second intervals after 30 seconds
  3. Increase to 10-second intervals after 2 minutes
  4. Use webhooks for more efficient status updates
</Tip>

## Export Steps

During processing, you'll see various `current_step` values:

* **"render-audio"**: Processing audio in for the avatar export step
* **"avatar"**: Processing avatar generation
* **"render"**: Rendering the final video file

## Download URL Details

<Warning>
  **Important notes about download URLs:**

  * URLs are valid for 7  from completion
  * Download the file to your own storage for permanent access
</Warning>

## Error Codes

Common error codes you might encounter:

* `JOB_NOT_FOUND`: Export job ID doesn't exist
* `UNAUTHORIZED_JOB`: Export job doesn't belong to your space
* `EXPORT_FAILED`: General export failure
* `ENCODING_FAILED`: Video encoding failed
* `FORMAT_CONVERSION_FAILED`: Failed to convert video format
* `STORAGE_FAILED`: Failed to upload to storage
