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

# Delete Job File

> Delete a job file from S3 storage

## Overview

Permanently delete a job's downloaded file from S3 storage. The job record is kept in the database, but the `s3_key` field is cleared. Use this to free up storage space for completed downloads you no longer need.

## Header Parameters

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

## Path Parameters

<ParamField path="id" type="uuid" required>
  The job UUID
</ParamField>

## Response

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="job_id" type="string">
  The job ID
</ResponseField>

<ResponseField name="deleted_key" type="string">
  The S3 key that was deleted
</ResponseField>

## Examples

<CodeGroup>
  ```bash Delete a File theme={null}
  curl -X DELETE "https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/file" \
    -H "x-api-key: sk_your_api_key"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/file',
    {
      method: 'DELETE',
      headers: {
        'x-api-key': 'sk_your_api_key'
      }
    }
  );

  const data = await response.json();
  console.log(`Deleted: ${data.deleted_key}`);
  ```

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

  response = requests.delete(
      'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/file',
      headers={'x-api-key': 'sk_your_api_key'}
  )

  print(response.json())
  ```
</CodeGroup>

## Success Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "File deleted successfully",
    "job_id": "550e8400-e29b-41d4-a716-446655440000",
    "deleted_key": "videos/my-video.mp4"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "Job has no file to delete"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Missing x-api-key header"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Job not found"
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": "Failed to delete file: AccessDenied"
  }
  ```
</ResponseExample>

## Notes

* This permanently deletes the file from S3 storage
* The job record is kept in the database for reference
* You cannot recover deleted files
* Only works for jobs with status `Completed`
* Jobs without an `s3_key` (failed or pending) cannot have files deleted
