Annotations
Retrieve annotations attached to Media Drive items. An annotation is a shape with a category and derived measurements, produced by an AI App or drawn by a reviewer. Every annotation belongs to an annotation set, identified by its labelGroupId. Endpoints return Annotation, Annotation Set or Annotation Summary Row objects.
Base URL
https://api.unleashlive.comAuthentication
Section titled “Authentication”All endpoints require a Bearer token in the Authorization header. We recommend using a Personal Access Token (PAT). See the Authentication section for how to create one.
Authorization: Bearer <YOUR_PAT>The team is resolved from the token.
Endpoints
Section titled “Endpoints”Get Annotations for Media Drive Items
Section titled “Get Annotations for Media Drive Items”POST /v1/library/annotationsReturns all annotations for the given Media Drive items, with decoded shape geometry. The response is an array of arrays: each inner array corresponds to the item at the same index in libraryItemIds, and is empty when that item has no annotations. Response is not paginated.
Request Body
Section titled “Request Body”| Parameter | Type | Description |
|---|---|---|
libraryItemIds | String[] | Required. Media Drive item IDs, as returned by the Media Drive API |
Example Request
Section titled “Example Request”{ "libraryItemIds": [ "MTc0NTg4NDIwMTAwMCM4N2UyZjllOS03Mjk2LTQ1NDktYThkMy1lMjA0OWUxN2E3MWU", "MTc0NTg4NDIwMjAwMCMyNWJhYTA3Ny02YTRlLTQyNjQtYjg0Ni04ZjM0ZmJiMmFiYWE" ]}Example Response
Section titled “Example Response”Get Annotation
Section titled “Get Annotation”GET /v1/library/annotation/{libraryItemId}/{labelGroupId}/{labelId}Returns a single Annotation with decoded shape geometry. Each path segment must be URL-encoded: a labelGroupId normally contains a #, which otherwise truncates the request at the fragment marker.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
libraryItemId | String | Media Drive item ID |
labelGroupId | String | Annotation set ID, as returned on the annotation |
labelId | String | Annotation ID, the id field of the annotation |
Example Request
Section titled “Example Request”GET /v1/library/annotation/MTc0NTg4NDIwMTAwMCM4N2UyZjllOS03Mjk2LTQ1NDktYThkMy1lMjA0OWUxN2E3MWU/a3f21c40-9d17-4b8e-b2c1-77e0a94d3f12%231745884213000/7c3f5d81-2b64-4e0a-9f1d-3a8e5c2d7b40Example Response
Section titled “Example Response”Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
404 | No annotation matches the given libraryItemId / labelGroupId / labelId. |
List Annotation Sets
Section titled “List Annotation Sets”POST /v1/annotation/set/{id}Returns a paginated list of Annotation Set objects for one AI App or one project. Ordering is not guaranteed.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
id | String | AI App (add-on) ID when type is ai-app, or project ID when type is project |
Request Body
Section titled “Request Body”| Parameter | Type | Description |
|---|---|---|
type | String | Required. ai-app or project. Determines how id is resolved |
libraryItemIds | String[] | Optional scope filter. Applied only when type is ai-app |
limit | String | Maximum number of sets per page |
nextToken | String | Pagination token from a previous response |
libraryItemIds matches by folder, not by file: a folder ID matches its whole subtree, and a file ID matches every set anchored in that file’s folder.
Example Request
Section titled “Example Request”{ "type": "ai-app", "libraryItemIds": [ "MTc0NTg4NDIwMDAwMCNiZGQ5NDM2YS0zZmQ0LTQ0YjQtOGZjYS03M2FmNmJlM2EyNDU" ], "limit": "50"}Example Response
Section titled “Example Response”Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
422 | type is missing or not one of ai-app / project. |
404 | A supplied libraryItemIds entry does not exist. |
List Annotation Summary Rows
Section titled “List Annotation Summary Rows”POST /v1/library/annotation/summaryReturns a paginated list of Annotation Summary Row objects: one row per annotation, joined with the Media Drive item it belongs to. Rows do not include shape or bbox.
Request Body
Section titled “Request Body”| Parameter | Type | Description |
|---|---|---|
libraryItemIdArr | String[] | Required. Media Drive item IDs to summarise. Duplicates are ignored |
limit | Integer | Maximum number of source items per page. Defaults to 500, capped at 1000 |
nextToken | String | Pagination token from a previous response |
Example Request
Section titled “Example Request”{ "libraryItemIdArr": [ "MTc0NTg4NDIwMTAwMCM4N2UyZjllOS03Mjk2LTQ1NDktYThkMy1lMjA0OWUxN2E3MWU", "MTc0NTg4NDIwMjAwMCMyNWJhYTA3Ny02YTRlLTQyNjQtYjg0Ni04ZjM0ZmJiMmFiYWE" ], "limit": 500}Example Response
Section titled “Example Response”Pagination
Section titled “Pagination”limit counts source items, not rows. A response that contains a nextToken string has a further page: pass the token to the next request, together with the same libraryItemIdArr. A response with no nextToken is the last page.
Reference
Section titled “Reference”Annotation
Section titled “Annotation”Responses may include additional fields that are not part of the API contract.
Annotation Shape
Section titled “Annotation Shape”Coordinates are source-image pixels with the origin at the top-left corner, rounded to two decimal places. They are not normalised and not geographic. The variant is determined by shapeType.
To draw an overlay, scale each axis by the ratio of the rendered size to the source size. Take the source dimensions from the Media Drive item’s metadata.width and metadata.height:
const scaleX = renderedWidth / item.metadata.width;const scaleY = renderedHeight / item.metadata.height;// point: [shape.x * scaleX, shape.y * scaleY]// rectangle: also scale shape.width by scaleX and shape.height by scaleYshapeType | shape fields |
|---|---|
POINT | x, y, and optional angle in degrees |
RECTANGLE | x, y (top-left corner), width, height |
POLYGON | vertices, an ordered array of { x, y }. The ring is closed implicitly |
Annotation Set
Section titled “Annotation Set”| Field | Type | Description |
|---|---|---|
id | String | Annotation set ID. Appears as labelGroupId on its annotations |
name | String | Display name of the set |
classes | Object[] | Label classes used by the set, as { id, name } |
annotationCount | Integer | Number of annotations in the set |
createdAt | Integer | UNIX timestamp in ms |
updatedAt | Integer | UNIX timestamp in ms |
Annotation Summary Row
Section titled “Annotation Summary Row”| Field | Type | Description |
|---|---|---|
libraryItemId | String | Media Drive item the annotation belongs to |
fileName | String | Name of the file |
breadcrumbs | String | Folder path of the item |
tags | String | Tags on the Media Drive item |
isApproved | Boolean | Whether the item has been reviewed and approved |
addonId | String | AI App that produced the annotation. Empty string for hand-drawn annotations |
labelGroupId | String | Annotation set ID |
annotation | Object | id, name (the category), color, isAI, and any of severity, comment, area, distance, width, height, frameId, frameTimestamp that are set |
Returned for every non-2xx response.
| Field | Type | Description |
|---|---|---|
message | String | Human-readable error message |
name | String | Error class name, for example ItemNotFoundException (404) or MissingParamsError (422) |