> 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.

# Detect watermark

POST https://app.resemble.ai/api/v2/watermark/detect
Content-Type: application/json

Detect a watermark in an audio, image, or video file. Audio runs Perth v1 and Perth v2 concurrently; image/video is publicly reported as Perth v2. Processing is asynchronous unless the `Prefer: wait` header is supplied.

Reference: https://docs.resemble.ai/api-reference/watermark/detect-watermark

## Authentication

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

## Request

### Headers

- `Prefer` (enum, optional) — When set to "wait", the API processes synchronously and returns the completed result with metrics.
  - Allowed values: `wait`

### Body (application/json)

This endpoint expects a WatermarkDetectRequest.

- `url` (string, required) — Public HTTPS URL to the audio, image, or video source.
- `custom_message` (string, optional, default: resembleai) — Message used when applying the image/video watermark. Ignored for audio.

## Response

### 200

Detection job created

- `success` (boolean, required)
- `item` (WatermarkDetectItem, required)

## Types

### WatermarkDetectItem

- `uuid` (string, required)
- `media_type` (enum, required)
  - Allowed values: `audio`, `image`, `video`
- `operation_type` (enum, required)
  - Allowed values: `detect`
- `status` (enum, required)
  - Allowed values: `pending`, `processing`, `completed`, `failed`
- `source_media_url` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `model_version` (enum, optional) — Present for image/video. Audio versions are reported in metrics.model_results.
  - Allowed values: `perth_v2`
- `metrics` (WatermarkDetectItemMetrics, optional, nullable) — Null while processing. New results use the media-specific versioned schema; historical audio results can use a flat shape.
- `watermarked_media` (string, optional, nullable) — Detection does not produce output media.

### WatermarkDetectItemMetrics

Null while processing. New results use the media-specific versioned schema; historical audio results can use a flat shape.

### 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.

### 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)

## Examples

**Request**

```json
{
  "url": "string"
}
```

**Response**

```json
{
  "success": true,
  "item": {
    "uuid": "string",
    "media_type": "audio",
    "operation_type": "detect",
    "status": "pending",
    "source_media_url": "string",
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z",
    "model_version": "perth_v2",
    "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
    },
    "watermarked_media": "string"
  }
}
```

**SDK Code**

```python
import requests

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

payload = { "url": "string" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.resemble.ai/api/v2/watermark/detect';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"url":"string"}'
};

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/watermark/detect"

	payload := strings.NewReader("{\n  \"url\": \"string\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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/watermark/detect")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"string\"\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/watermark/detect")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://app.resemble.ai/api/v2/watermark/detect', [
  'body' => '{
  "url": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.resemble.ai/api/v2/watermark/detect");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["url": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.resemble.ai/api/v2/watermark/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()
```