Skip to navigation

Save annotations on an image

View as Markdown

Save masks on an image as annotations, one per entry.

Each entry is a binary mask PNG (white-on-transparent, base64-encoded) for a label; labels are created on first use. Saving is additive, so a label can accumulate several masks on the same image. The annotations a segmentation model returns from predict can be passed straight through; each names the file it was predicted for, and one for a different file rejects the request. Leave is_human_vetted false for automated saves: the mask editor flags unvetted masks for review, and only vetted masks feed training. The file must be a processed image. All-or-nothing: one bad entry rejects the whole request.

Masks saved with a job_execution_id are deleted when that execution is reverted. In a job script, saves default to the running job’s execution.

Requires an API key with the write scope.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

file_idstringRequired

Request

This endpoint expects an object.
annotationslist of objectsRequired
job_execution_idstring or nullOptionalformat: "uuid"
The job execution producing the masks, so reverting it deletes them. A job script's saves default to the running job's execution.

Response

OK
idstringformat: "uuid"
labelstring
mask_urlstring or nullOptional
widthinteger or nullOptional
heightinteger or nullOptional
is_human_vettedbooleanOptionalDefaults to false
foreground_fractiondouble or nullOptional
bboxobject or nullOptional
Bounding box of a mask's visible pixels, in mask pixel coordinates.
userobject or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error
502
Bad Gateway Error