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

# Analyze File

> Submit a file for deepfake and AI-generation detection

```
POST /v1/deepfake-detection/analyze
```

Submits a file for asynchronous deepfake and AI-generation analysis. Supports documents, images, audio, and video files. Returns an analysis ID for polling or use a callback URL for webhook notification.

## Request

### Headers

| Header         | Required | Description           |
| -------------- | -------- | --------------------- |
| `x-api-key`    | Yes      | Your API key          |
| `Content-Type` | Yes      | `multipart/form-data` |

### Body parameters

| Parameter      | Type   | Required | Description                                                            |
| -------------- | ------ | -------- | ---------------------------------------------------------------------- |
| `file`         | file   | Yes      | The file to analyze. Max size: 50MB                                    |
| `file_type`    | string | No       | Override auto-detection. Values: `document`, `image`, `audio`, `video` |
| `callback_url` | string | No       | HTTPS URL for webhook delivery of results when analysis completes      |
| `external_id`  | string | No       | Your internal reference ID for this analysis                           |

### Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.deepidv.com/v1/deepfake-detection/analyze \
    -H "x-api-key: YOUR_API_KEY" \
    -F "file=@passport_scan.pdf" \
    -F "file_type=document" \
    -F "callback_url=https://yourapp.com/webhooks/deepfake" \
    -F "external_id=doc-review-789"
  ```

  ```javascript Node.js theme={null}
  const formData = new FormData();
  formData.append("file", fs.createReadStream("passport_scan.pdf"));
  formData.append("file_type", "document");
  formData.append("callback_url", "https://yourapp.com/webhooks/deepfake");
  formData.append("external_id", "doc-review-789");

  const response = await fetch(
    "https://api.deepidv.com/v1/deepfake-detection/analyze",
    {
      method: "POST",
      headers: {
        "x-api-key": "YOUR_API_KEY",
      },
      body: formData,
    }
  );

  const data = await response.json();
  ```

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

  response = requests.post(
      "https://api.deepidv.com/v1/deepfake-detection/analyze",
      headers={"x-api-key": "YOUR_API_KEY"},
      files={"file": open("passport_scan.pdf", "rb")},
      data={
          "file_type": "document",
          "callback_url": "https://yourapp.com/webhooks/deepfake",
          "external_id": "doc-review-789",
      },
  )
  ```
</CodeGroup>

## Response

### 202 — Accepted

| Field                          | Type   | Description                          |
| ------------------------------ | ------ | ------------------------------------ |
| `id`                           | string | Unique analysis identifier           |
| `status`                       | string | Always `processing` on creation      |
| `file_name`                    | string | Original filename                    |
| `file_type`                    | string | Detected or specified file type      |
| `external_id`                  | string | Your external ID (if provided)       |
| `created_at`                   | string | ISO 8601 timestamp                   |
| `estimated_completion_seconds` | number | Estimated processing time in seconds |

### Error responses

| Status                       | Description                        |
| ---------------------------- | ---------------------------------- |
| `400 Bad Request`            | Missing file or invalid parameters |
| `401 Unauthorized`           | Missing or invalid API key         |
| `413 Payload Too Large`      | File exceeds 50MB limit            |
| `415 Unsupported Media Type` | File type not supported            |
| `429 Too Many Requests`      | Rate limit exceeded                |

<ResponseExample>
  ```json 202 theme={null}
  {
    "id": "da_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "processing",
    "file_name": "passport_scan.pdf",
    "file_type": "document",
    "external_id": "doc-review-789",
    "created_at": "2025-01-15T10:30:00.000Z",
    "estimated_completion_seconds": 15
  }
  ```
</ResponseExample>
