> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.resemble.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.resemble.ai/_mcp/server.

# Create deepfake detection

POST https://app.resemble.ai/api/v2/detect
Content-Type: multipart/form-data

Analyze audio, image, and video for deepfake detection.

Supply media via one of three intake methods:

- **Direct file upload** — `multipart/form-data` with the file attached as `file`. Files must be 150 MB or smaller and use one of the supported audio/video/image extensions. For larger files, use the secure upload flow.
- **Public URL** — `application/json` with a `url` field. The API fetches the URL itself.
- **Secure upload token** — `application/json` with a `media_token` field obtained from `POST /secure_uploads`.

Exactly one of `file`, `url`, or `media_token` must be provided per request.

Set `detect_watermark=true` to run Resemble watermark detection and SynthID alongside the deepfake
analysis. This option supports single audio, image, and video requests only. It adds one Watermark
detection charge, applies a 200 MB source limit for audio, image, and video, and causes
`Prefer: wait` and callbacks to wait for the watermark analysis to reach a terminal state. A watermark
failure is returned in the nested `watermark` object and does not change the deepfake verdict.


Reference: https://docs.resemble.ai/api-reference/deepfake-detection/create-detection

## Authentication

- `Authorization` header (bearer token, required) — API key from https://app.resemble.ai/hub/api

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required) — The media file to analyze (audio, video, or image). Must be 150 MB or smaller.
- `callback_url` (string, optional) — POST destination for the detection result.
- `wait_for_intelligence` (boolean, optional) — Controls callback timing when callback_url and intelligence=true are provided. True waits without a forced timeout until Detect and Intelligence are both finished. False sends after Detect finishes without waiting for Intelligence. When omitted, the callback waits up to 10 minutes for Intelligence before sending the result state available at that time.
- `visualize` (boolean, optional) — Generate visualization artifacts
- `frame_length` (integer, optional) — Window size in seconds (audio/video). We recommend 4 for audio.
- `start_region` (double, optional) — Start of segment to analyze (seconds)
- `end_region` (double, optional) — End of segment to analyze (seconds)
- `max_video_secs` (double, optional) — Cap processed duration
- `modality` (enum, optional) — Video only. Selects which detection components run for a video file: `audio` (audio track only), `video` (visual frames only), or `all` (both — the default). Ignored for audio and image inputs. Invalid values are rejected with HTTP 400.
- `face_only` (boolean, optional) — Focus visual video detection on faces by masking non-face regions. Effective only for video inputs with `modality=all` or `modality=video`. Audio, image, and `modality=audio` video requests are accepted but use an effective value of `false`.
- `intelligence` (boolean, optional) — Run multimodal intelligence analysis on the media
- `detect_watermark` (boolean, optional) — Run Resemble watermark detection and SynthID. Supported for single audio, image, and video requests. Adds the Watermark detection charge and applies a source limit of 200 MB for audio, image, and video.
- `infer_from_intelligence` (boolean, optional) — Opt in to let a strong intelligence finding escalate an otherwise non-fake verdict to "Likely Fake". Has no effect unless `intelligence` is also true.
- `audio_source_tracing` (boolean, optional) — Enable audio source tracing to identify synthetic audio origin
- `signal` (boolean, optional) — Run Signal content analysis after detection completes, classifying the media against fraud and abuse categories. Requires Signal access on your plan and cannot be combined with zero_retention_mode. Not supported for batch detections.
- `use_reverse_search` (boolean, optional) — Enable reverse image search to improve detection accuracy for image files. Only applies to image detections.
- `use_ood_detector` (boolean, optional) — Enable out-of-distribution detection
- `zero_retention_mode` (boolean, optional) — Enable Zero Retention Mode to automatically delete submitted media after detection completes.

## Response

### 200

Detection job created

- `success` (boolean, optional)
- `item` (DetectPostResponsesContentApplicationJsonSchemaItem, optional)

## Errors

### 400 Bad Request Error

Invalid request, including a malformed `detect_watermark` boolean or a known source that exceeds the Watermark decoder limit.

- `success` (boolean, optional)
- `error` (string, optional)
- `errors` (map from string to list of string, optional)
- `message` (string, optional)

### 402 Payment Required Error

Insufficient balance for the combined Detect request. When watermark analysis was requested, details include `watermark_cost_cents`.

- `success` (boolean, optional)
- `error_code` (string, optional)
- `error` (string, optional)
- `message` (string, optional)
- `details` (DetectPostResponsesContentApplicationJsonSchemaDetails, optional)

### 403 Forbidden Error

The API key does not have access to Watermark detection or another requested product.

- `success` (boolean, optional)
- `error` (string, optional)
- `errors` (map from string to list of string, optional)
- `message` (string, optional)

## Types

### DetectPostResponsesContentApplicationJsonSchemaItem

- `uuid` (string, optional)
- `status` (enum, optional) — Processing state for the requested Detect work. For an otherwise successful Detect with watermark analysis, this remains processing until the linked analysis completes or fails. A core detection failure still reports failed.
  - Allowed values: `processing`, `completed`, `failed`
- `zero_retention_mode` (boolean, optional) — Whether Zero Retention Mode is enabled for this detect
- `file_deleted_at` (datetime, optional, nullable) — ISO 8601 timestamp of when the file was purged, or null if not yet deleted
- `url` (string, optional, nullable) — URL to the media file. Null when Zero Retention Mode is enabled.
- `audio_url` (string, optional, nullable) — Alias of url. Null when Zero Retention Mode is enabled.
- `filename` (string, optional) — Original filename, or tokenized (redacted\_\<token>.\<ext>) when Zero Retention Mode is enabled
- `modality` (enum, optional) — Which detection modality was requested. `all` when not specified. For a single-modality video detect, the skipped component's metrics are absent (`metrics` for audio-only-skipped, `video_metrics` for video-only-skipped), and the detect still reaches `completed` once the requested modality(ies) finish.
  - Allowed values: `audio`, `video`, `all`
- `face_only` (boolean, optional) — Effective face-only setting. `true` only for video inputs that include visual analysis; `false` for audio, image, and audio-only video detects.
- `watermark` (DetectWatermarkAnalysis, optional) — Conditional watermark analysis requested with `detect_watermark=true`. The object is omitted when watermark analysis was not requested. Resemble watermark metrics and the optional SynthID verdict are independent of the deepfake verdict.
- `intelligence` (DetectPostResponsesContentApplicationJsonSchemaItemIntelligence, optional, nullable) — Default Intelligence result when requested
- `c2pa_manifest` (DetectC2paManifest, optional) — Content Credentials (C2PA) verification result for audio, image, and video media. Returned when verification has completed. A fallback verification failure returns `validation_state: Unavailable` and does not fail the detection.

### DetectPostResponsesContentApplicationJsonSchemaDetails

- `estimated_cost_cents` (double, optional)
- `detect_cost_cents` (double, optional)
- `watermark_cost_cents` (double, optional) — Present only when `detect_watermark=true` was requested.

### DetectWatermarkAnalysis

Conditional watermark analysis requested with `detect_watermark=true`. The object is omitted when watermark analysis was not requested. Resemble watermark metrics and the optional SynthID verdict are independent of the deepfake verdict.

- `status` (enum, required) — Lifecycle state of the linked watermark analysis.
  - Allowed values: `pending`, `processing`, `completed`, `failed`
- `metrics` (DetectWatermarkAnalysisMetrics, optional) — Present when watermark analysis completes. Audio uses Perth v1/v2 metrics; image and video use the Resemble image/video detector metrics. `synthid`, when present, is the boolean verdict returned by SynthID. Its omission means the provider result was unavailable, not that no watermark was found.
- `error_message` (string, optional) — Safe error message when the watermark analysis failed. A child failure does not fail an otherwise successful deepfake detection.

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligence

Default Intelligence result when requested

- `uuid` (string, optional)
- `status` (enum, optional)
  - Allowed values: `processing`, `completed`, `failed`
- `error_message` (string, optional, nullable)
- `description` (DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescription, optional)
- `created_at` (datetime, optional)
- `detect_uuid` (string, optional)

### DetectC2paManifest

Content Credentials (C2PA) verification result for audio, image, and video media. Returned when verification has completed. A fallback verification failure returns `validation_state: Unavailable` and does not fail the detection.

- `validation_state` (enum, optional) — Verification state. `NotPresent` means no embedded Content Credentials were found; `Unavailable` means verification could not complete.
  - Allowed values: `Valid`, `NotPresent`, `Unavailable`
- `active_manifest` (string, optional, nullable) — Active C2PA manifest identifier when credentials are present
- `manifests` (map from string to any, optional, nullable) — Raw manifest details returned by C2PA tooling
- `validation_results` (map from string to any, optional, nullable) — Detailed validation results returned by C2PA tooling
- `message` (string, optional, nullable) — Generic message when verification is unavailable

### DetectWatermarkAnalysisMetrics

Present when watermark analysis completes. Audio uses Perth v1/v2 metrics; image and video use the Resemble image/video detector metrics. `synthid`, when present, is the boolean verdict returned by SynthID. Its omission means the provider result was unavailable, not that no watermark was found.

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescription

### WatermarkAudioDetectionMetrics

- `overall_status` (enum, required)
  - Allowed values: `present`, `absent`, `inconclusive`
- `detected_model_versions` (list of enum, required) — Only model versions that positively detected a watermark.
  - Allowed values: `perth_v1`, `perth_v2`
- `coverage_complete` (boolean, required) — True only when both audio detectors completed successfully.
- `has_watermark` (map from string to boolean, required) — Per-channel aggregate across successful audio detectors.
- `model_results` (list of WatermarkAudioModelResult, required)
- `confidence` (double, optional, nullable)
- `synthid` (boolean, optional) — Optional auxiliary SynthID verdict for audio. Omitted when SynthID is unavailable.

### WatermarkVisionDetectionMetrics

- `overall_status` (enum, required)
  - Allowed values: `present`, `degraded`, `absent`, `inconclusive`
- `detected_model_versions` (list of enum, required) — Contains perth_v2 only when watermark signal is detected.
  - Allowed values: `perth_v2`
- `has_watermark` (boolean, required)
- `detection_score` (double, required, nullable)
- `model_results` (list of WatermarkVisionModelResult, required)
- `verdict` (enum, optional, nullable) — Backward-compatible image/video verdict.
  - Allowed values: `verified`, `degraded`, `not_watermarked`
- `synthid` (boolean, optional) — Optional auxiliary SynthID verdict for image or video. Omitted when SynthID is unavailable.

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescription1

- `speaker_info` (string, optional)
- `language` (string, optional)
- `dialect` (string, optional)
- `emotion` (string, optional)
- `speaking_style` (string, optional)
- `context` (string, optional)
- `message` (string, optional)
- `abnormalities` (string, optional)
- `transcription` (string, optional)
- `translation` (string, optional, nullable)
- `misinformation` (string, optional)
- `fraud` (DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1Fraud, optional)
- `liveness` (DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1Liveness, optional)
- `digitally_altered` (DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1DigitallyAltered, optional)

### WatermarkAudioModelResult

- `model_version` (enum, required)
  - Allowed values: `perth_v1`, `perth_v2`
- `status` (enum, required)
  - Allowed values: `succeeded`, `failed`
- `detected` (boolean, required, nullable) — Null when this detector was unavailable.
- `has_watermark` (map from string to boolean, optional) — Successful per-channel detection results.
- `confidence` (double, optional, nullable)
- `error` (string, optional) — Safe error message when status is failed.

### WatermarkVisionModelResult

- `model_version` (enum, required)
  - Allowed values: `perth_v2`
- `status` (enum, required)
  - Allowed values: `succeeded`
- `detected` (boolean, required)
- `confidence` (double, optional, nullable)

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1Fraud

- `type` (enum, optional)
  - Allowed values: `none`, `vishing`, `impersonation`, `romance_scam`, `tech_support_scam`, `financial_fraud`, `extortion`, `political_manipulation`, `synthetic_media_fraud`, `insurance_fraud`, `employment_fraud`, `other`
- `confidence` (double, optional)
- `reasoning` (string, optional)

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1Liveness

- `assessment` (enum, optional)
  - Allowed values: `real_person`, `not_real_person`, `inconclusive`
- `confidence` (double, optional)
- `indicators` (string, optional)

### DetectPostResponsesContentApplicationJsonSchemaItemIntelligenceDescriptionOneOf1DigitallyAltered

- `detected` (boolean, optional)
- `confidence` (double, optional)
- `alterations` (string, optional)

## Examples

**Request**

```json
{
  "file": "<file: string>"
}
```

**Response**

```json
{
  "success": true,
  "item": {
    "uuid": "string",
    "status": "processing",
    "zero_retention_mode": true,
    "file_deleted_at": "2024-01-15T09:30:00Z",
    "url": "string",
    "audio_url": "string",
    "filename": "string",
    "modality": "audio",
    "face_only": true,
    "watermark": {
      "status": "pending",
      "metrics": {
        "overall_status": "present",
        "detected_model_versions": [
          "perth_v1"
        ],
        "coverage_complete": true,
        "has_watermark": {},
        "confidence": 1.1,
        "model_results": [
          {
            "model_version": "perth_v1",
            "status": "succeeded",
            "detected": true,
            "has_watermark": {},
            "confidence": 1.1,
            "error": "string"
          }
        ],
        "synthid": true
      },
      "error_message": "string"
    },
    "intelligence": {
      "uuid": "string",
      "status": "processing",
      "error_message": "string",
      "description": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "detect_uuid": "string"
    },
    "c2pa_manifest": {
      "validation_state": "Valid",
      "active_manifest": "string",
      "manifests": {},
      "validation_results": {},
      "message": "string"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://app.resemble.ai/api/v2/detect"

files = { "file": "open('string', 'rb')" }
payload = {
    "callback_url": ,
    "wait_for_intelligence": ,
    "visualize": ,
    "frame_length": ,
    "start_region": ,
    "end_region": ,
    "max_video_secs": ,
    "modality": ,
    "face_only": ,
    "intelligence": ,
    "detect_watermark": ,
    "infer_from_intelligence": ,
    "audio_source_tracing": ,
    "signal": ,
    "use_reverse_search": ,
    "use_ood_detector": ,
    "zero_retention_mode": 
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.resemble.ai/api/v2/detect';
const form = new FormData();
form.append('file', 'string');
form.append('callback_url', '');
form.append('wait_for_intelligence', '');
form.append('visualize', '');
form.append('frame_length', '');
form.append('start_region', '');
form.append('end_region', '');
form.append('max_video_secs', '');
form.append('modality', '');
form.append('face_only', '');
form.append('intelligence', '');
form.append('detect_watermark', '');
form.append('infer_from_intelligence', '');
form.append('audio_source_tracing', '');
form.append('signal', '');
form.append('use_reverse_search', '');
form.append('use_ood_detector', '');
form.append('zero_retention_mode', '');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.resemble.ai/api/v2/detect"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"wait_for_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"visualize\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"frame_length\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_video_secs\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"modality\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"face_only\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"detect_watermark\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"infer_from_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_source_tracing\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"signal\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_reverse_search\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_ood_detector\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"zero_retention_mode\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.resemble.ai/api/v2/detect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"wait_for_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"visualize\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"frame_length\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_video_secs\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"modality\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"face_only\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"detect_watermark\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"infer_from_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_source_tracing\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"signal\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_reverse_search\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_ood_detector\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"zero_retention_mode\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://app.resemble.ai/api/v2/detect")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"wait_for_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"visualize\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"frame_length\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_video_secs\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"modality\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"face_only\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"detect_watermark\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"infer_from_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_source_tracing\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"signal\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_reverse_search\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_ood_detector\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"zero_retention_mode\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.resemble.ai/api/v2/detect', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.resemble.ai/api/v2/detect");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"callback_url\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"wait_for_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"visualize\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"frame_length\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"start_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"end_region\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_video_secs\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"modality\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"face_only\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"detect_watermark\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"infer_from_intelligence\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"audio_source_tracing\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"signal\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_reverse_search\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"use_ood_detector\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"zero_retention_mode\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ],
  [
    "name": "callback_url",
    "value": 
  ],
  [
    "name": "wait_for_intelligence",
    "value": 
  ],
  [
    "name": "visualize",
    "value": 
  ],
  [
    "name": "frame_length",
    "value": 
  ],
  [
    "name": "start_region",
    "value": 
  ],
  [
    "name": "end_region",
    "value": 
  ],
  [
    "name": "max_video_secs",
    "value": 
  ],
  [
    "name": "modality",
    "value": 
  ],
  [
    "name": "face_only",
    "value": 
  ],
  [
    "name": "intelligence",
    "value": 
  ],
  [
    "name": "detect_watermark",
    "value": 
  ],
  [
    "name": "infer_from_intelligence",
    "value": 
  ],
  [
    "name": "audio_source_tracing",
    "value": 
  ],
  [
    "name": "signal",
    "value": 
  ],
  [
    "name": "use_reverse_search",
    "value": 
  ],
  [
    "name": "use_ood_detector",
    "value": 
  ],
  [
    "name": "zero_retention_mode",
    "value": 
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://app.resemble.ai/api/v2/detect")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```