Skip to content

Watermark processing

Save source-version marks and retrieve detailed watermark analysis from asynchronous tasks.

Use the same quote → submit → poll → result flow as other tasks. The tool catalog includes watermark-find (find candidates), watermark-mask (track and preview a mask), and the removal tools available for the source kind. Read the catalog’s parameter choices before submitting. Candidate marks require review; saving them does not itself create a processing task.

  1. Run watermark-find on the chosen source version and read watermarkFind from its result.
  2. Review the suggested regions and save the confirmed marks on that version.
  3. Quote and submit watermark-mask with the confirmed regions to preview tracking.
  4. Inspect maskPreviewUrl and the analysis report, then submit the applicable removal tool with the same source version and confirmed parameters.

This replaces all marks on the specified version. Coordinates are normalized from 0 to 1 with the top-left as the origin; x + width and y + height must stay within 1. timeMs identifies a video frame in milliseconds; omit it for a fixed position over the whole clip. Marks with the same objectId describe the same watermark.

positive marks indicate a watermark; negative excludes an area; absent marks an interval without that object; suggested is an unconfirmed candidate and is not executed. Pass timeMs for negative/absent/suggested marks, and objectId for absent/suggested marks. endMs, when used, must be at least timeMs. Use at most 64 total marks and eight objects, with at most 32 positive regions for processing. Sending regions: [] clears all marks; omitting objects clears their names.

The example saves a confirmed rectangle for the first frame. This persists annotations only: pass your confirmed regions in the task’s params when requesting tracking or removal. It does not automatically start or configure a task.

PUT/api/v1/assets/{assetId}/versions/{versionId}/watermark-marks
Bearer API KeyScope: writeSuccess: 204
Path, query and headers
ParameterLocationType & constraints
assetId
required
pathstring

versionId
required
pathstring

Request body fields · application/json
objectsobject[]optional

maxItems: 8

Expand fields / variants
namestringrequired

minLength: 1 · maxLength: 24

objectIdinteger · int64required

minimum: 0 · maximum: 7

regionsobject[]required

maxItems: 64

Expand fields / variants
colorstringoptional

pattern: "^#[0-9a-fA-F]{6}$"

endMsinteger · int64optional

minimum: 0

heightnumber · doublerequired

minimum: 0 · maximum: 1

kind"positive" | "negative" | "absent" | "suggested"optional
objectIdinteger · int64optional

minimum: 0 · maximum: 7

strokesobject[]optional

maxItems: 64

Expand fields / variants
pointsnumber · double[][]required

minItems: 1 · maxItems: 4000

Expand fields / variants

number · double

radiusnumber · doublerequired

minimum: 0 · maximum: 0.25

timeMsinteger · int64optional

minimum: 0

widthnumber · doublerequired

minimum: 0 · maximum: 1

xnumber · doublerequired

minimum: 0 · maximum: 1

ynumber · doublerequired

minimum: 0 · maximum: 1

Request example

Terminal window
curl --include --fail-with-body --silent --show-error --max-time 60 \
--request PUT 'https://app.berserkapi.com/api/v1/assets/ASSET_ID/versions/VERSION_ID/watermark-marks' \
--header "Authorization: Bearer $GLACIER_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"regions": [
{
"x": 0.7,
"y": 0.05,
"width": 0.2,
"height": 0.1,
"timeMs": 0,
"objectId": 0,
"kind": "positive"
}
],
"objects": [
{
"id": 0,
"name": "Logo"
}
]
}'
Response fields · 204

No response body. Do not attempt to parse empty JSON.

Use the analysis task ID or the watermarkAnalysisUrl returned with a result. This is an authenticated JSON API request, not a signed file download. Reports include objects, time intervals and regions that may need review. Use them together with the mask preview before removal.

GET/api/v1/tasks/{taskId}/watermark-analysis
Bearer API KeyScope: readSuccess: 200
Path, query and headers
ParameterLocationType & constraints
taskId
required
pathstring

Request example

Terminal window
curl --include --fail-with-body --silent --show-error --max-time 60 \
--request GET 'https://app.berserkapi.com/api/v1/tasks/TASK_ID/watermark-analysis' \
--header "Authorization: Bearer $GLACIER_API_KEY"
Response fields · 200
detectionVersionstringrequired
framesinteger · int64required
heightinteger · int64required
marksHashstringrequired
objectsobject[]required
Expand fields / variants
colorobjectrequired
Expand fields / variants
alphanumber · doublerequired
rgbinteger · int64[]required

minItems: 3 · maxItems: 3

Expand fields / variants

integer · int64

samplesinteger · int64required
intervalsobject[]required
Expand fields / variants
endFrameinteger · int64required
endMsinteger · int64required
reasonsstring[]required
Expand fields / variants

string

sourcestringrequired
startFrameinteger · int64required
startMsinteger · int64required
state"present" | "bridge" | "manual" | "uncertain" | "absent"required
namestringrequired
objectIdinteger | null · int64required
poseobject[]required
Expand fields / variants
detailstringrequired
okbooleanrequired
reasonstringrequired
sourcestringrequired
shapeobjectrequired
Expand fields / variants
qualitystringrequired
reasonstringrequired
policystringrequired
ratenumber · doublerequired
reviewobject[]required
Expand fields / variants
boxobjectrequired
Expand fields / variants
heightnumber · doublerequired

minimum: 0 · maximum: 1

widthnumber · doublerequired

minimum: 0 · maximum: 1

xnumber · doublerequired

minimum: 0 · maximum: 1

ynumber · doublerequired

minimum: 0 · maximum: 1

endFrameinteger · int64required
endMsinteger · int64required
namestringrequired
objectIdinteger | null · int64required
reasonstringrequired
scorenumber | null · doublerequired
startFrameinteger · int64required
startMsinteger · int64required
staticobject[]required
Expand fields / variants
namestringrequired
objectIdinteger | null · int64required
reasonstringrequired
shapestringrequired
versioninteger · int64required
widthinteger · int64required