Submit Detection Job

POST https://app.resemble.ai/api/v2/detect

By default the request is asynchronous. The API responds immediately with a job UUID while analysis continues in the background. Include Prefer: wait to block until completion.

$curl --request POST 'https://app.resemble.ai/api/v2/detect' \
> -H 'Authorization: Bearer YOUR_API_TOKEN' \
> -H 'Prefer: wait' \
> -H 'Content-Type: application/json' \
> --data '{
> "url": "https://example.com/media.mp4",
> "callback_url": "https://example.com/webhooks/detect",
> "visualize": true,
> "frame_length": 2
> }'

Required Field

FieldDescription
urlPublic HTTPS URL to the media to analyze (wav, mp3, ogg, m4a, flac, mp4, mov, avi, wmv, jpg, jpeg, png, gif, webp).

Optional Parameters

FieldApplies ToDescription
callback_urlAllPOST destination when analysis completes. Payload matches the standard response.
visualizeAllGenerate visualization artifacts (images/treeview).
frame_lengthAudio & VideoWindow size in seconds (14, default 2).
start_region / end_regionAudio & VideoAnalyze a segment (seconds).
pipelineImage & VideoSequence of detectors (general, facial, object) separated by ->. Default general->facial->object.
max_video_fpsVideoDownsample high-frame-rate media.
max_video_secsVideoCap processed duration.
model_typesVideoimage or talking_head. Use talking_head for face-swaps.

Response

Asynchronous Response

By default, the API responds immediately while processing continues in the background:

1{
2 "success": true,
3 "item": {
4 "uuid": "DETECTION_UUID",
5 "metrics": {},
6 "created_at": "2024-01-15T10:30:00Z",
7 "updated_at": "2024-01-15T10:30:00Z",
8 "media_type": "audio"
9 }
10}

Use the UUID to check status via the Get Detection Result endpoint, or provide a callback_url to receive results automatically.

Synchronous Response (with Prefer: wait header)

When using the Prefer: wait header, the API returns complete results immediately:

Audio File Response

1{
2 "success": true,
3 "item": {
4 "uuid": "DETECTION_UUID",
5 "metrics": {
6 "image": "",
7 "label": "fake",
8 "score": ["0.9", "0.8", "0.7"],
9 "consistency": "0.85",
10 "aggregated_score": "0.80"
11 },
12 "created_at": "2024-01-15T10:30:00Z",
13 "updated_at": "2024-01-15T10:30:05Z",
14 "duration": "5.2",
15 "media_type": "audio"
16 }
17}

Image File Response

1{
2 "success": true,
3 "item": {
4 "uuid": "DETECTION_UUID",
5 "metrics": {},
6 "created_at": "2024-01-15T10:30:00Z",
7 "updated_at": "2024-01-15T10:30:02Z",
8 "url": "https://example.com/image.jpg",
9 "duration": "0",
10 "media_type": "image",
11 "image_metrics": {
12 "type": "facial",
13 "image": "https://...",
14 "label": "fake",
15 "score": 0.92,
16 "children": []
17 }
18 }
19}

Video File Response

1{
2 "success": true,
3 "item": {
4 "uuid": "DETECTION_UUID",
5 "metrics": {
6 "image": "https://...",
7 "label": "fake",
8 "score": ["0.9", "0.8", "0.7"],
9 "consistency": "0.85",
10 "aggregated_score": "0.80"
11 },
12 "created_at": "2024-01-15T10:30:00Z",
13 "updated_at": "2024-01-15T10:30:10Z",
14 "duration": "10.5",
15 "media_type": "video",
16 "video_metrics": {
17 "label": "Fake",
18 "score": 0.95,
19 "certainty": 0.93,
20 "treeview": "...",
21 "children": [
22 {
23 "type": "VideoResult",
24 "conclusion": "Fake",
25 "score": 0.99,
26 "certainty": 0.9,
27 "certainty (%)": "90.0",
28 "children": [
29 {
30 "type": "ImageResult",
31 "conclusion": "Fake",
32 "score": 0.9,
33 "certainty": 0.95,
34 "certainty (%)": "95.0",
35 "timestamp": 0.23,
36 "children": [
37 {
38 "type": "Segment",
39 "conclusion": "Fake",
40 "score": 0.9,
41 "certainty": 0.995,
42 "certainty (%)": "99.5"
43 }
44 ]
45 }
46 ]
47 }
48 ]
49 }
50 }
51}

Callback URL

If you provide a callback_url when submitting a media file, you will receive a POST request to that URL with the same payload structure as the synchronous response shown above.