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

Response

OK
idstringformat: "uuid"
labelstring
mask_urlstring or nullOptional
widthinteger or nullOptional
heightinteger or nullOptional
is_human_vettedbooleanOptionalDefaults to false
foreground_fractiondouble 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