Skip to content

Media Drive

Media Drive is a GraphQL-based API for managing files, folders, and media assets. It supports queries (read operations) and mutations (create, update, delete operations).

Operation TypeDescription
QueryRetrieve or list existing media items
MutationCreate, update, move, rename, or delete items

For a full working sample project, see the Media Drive samples on GitHub.

All GraphQL operations are sent as POST requests to:

https://mediadrive-api.unleashlive.com/graphql

Every request must include a valid JWT token in the authorization header. See the Authentication page for details on how to obtain a token.

authorization: <ID_TOKEN>

The primary resource returned by queries and mutations.

FieldTypeDescription
idString!Item ID
teamIdString!Team the resource belongs to
parentIdString!Parent item ID, typically a folder ID
tagsStringTags assigned to the item
typeStringItem type (see Item Type values)
locationStringHierarchy path where the item is placed, separated by #
deviceIdStringID of the device used to create the item (if any)
nameStringName of the item
createdAtAWSTimestamp!UTC timestamp of item creation
updatedAtAWSTimestampUTC timestamp of last update
uploadedAtAWSTimestampUTC timestamp of when upload completed
ownerIdString!ID of the author/owner
s3PathStringStorage path of the file associated with the item
metadataObjectFile metadata (see Metadata)
mimeTypeString!MIME type (see Custom MimeTypes)
annotationsAWSJSONJSON annotations (see Annotations)
isApprovedBooleanWhether the item has been reviewed/approved

Fields marked with ! are required.

KeyDescription
IImage
VVideo
MModel
RReport
FLFlight log
DGeneral document
UUndefined type
FieldTypeDescription
sizeLongFile size in bytes
childItemsNumberIntNumber of child items
addonIdStringAdd-on identifier
deviceIdStringDevice identifier
droneSerialNumberStringDrone serial number
pilotIdStringPilot identifier
pilotNameStringPilot name
annotationCountIntNumber of annotations
makeStringCamera make
modelStringCamera model
orientationIntImage orientation
softwareStringSoftware used
camaperturevalueFloatCamera aperture value
camfnumberFloatCamera f-number
camfocallengthFloatCamera focal length
camfocallengthin35mmformatIntFocal length in 35 mm equivalent
camisoIntCamera ISO
camShutterSpeedStringCamera shutter speed
camExposureBiasValueFloatExposure bias value
digitalZoomFloatDigital zoom level
gpsaltFloatGPS altitude
gpsaltrefIntGPS altitude reference
gpslatFloatGPS latitude
gpslatrefStringGPS latitude reference (N/S)
gpslngFloatGPS longitude
gpslngrefStringGPS longitude reference (E/W)
baseAltitudeFloatBase altitude
exifimagewidthIntEXIF image width
exifimageheightIntEXIF image height
gimbalpitchdegreeFloatGimbal pitch degree
gimbalyawdegreeFloatGimbal yaw degree
gimbalrolldegreeFloatGimbal roll degree
isAutoflyBooleanWhether captured via Autofly
automationidStringAutomation identifier
createdateAWSTimestampFile creation date
modifydateAWSTimestampFile modification date
lastmodifiedAWSTimestampLast modified timestamp
typeStringFile type
widthIntWidth in pixels
heightIntHeight in pixels
bounds[[Float]]Geo-bounds array of [lat, lng] pairs
is360BooleanWhether the media is 360°
durationFloatDuration in seconds (video)
isPanoramicBooleanWhether the media is panoramic
thermalDataObjectThermal imaging data (see Thermal Data)
additionalPropertiesStringAdditional custom properties (JSON)
FieldTypeDescription
isThermalBooleanWhether the file is thermal
hasRadiometricDataBooleanWhether radiometric data exists
minTemperatureFloatMinimum temperature detected
maxTemperatureFloatMaximum temperature detected
calibrationObjectCalibration settings (see Thermal Calibration)
tmapS3PathStringS3 path to the thermal map
FieldTypeDescription
emissivityFloatEmissivity value
reflectedTemperatureFloatReflected temperature
atmosphericTemperatureFloatAtmospheric temperature
humidityFloatHumidity
distanceFloatDistance to subject
transmissivityFloatTransmissivity value
ValueDescription
application/vnd.unleashlive.folderFolder
application/vnd.unleashlive.folderAggregateArchiveAggregate archive folder
application/vnd.unleashlive.folderAggregateResultsAggregate results folder
application/vnd.unleashlive.modelModel wrapper
application/vnd.unleashlive.model.2d2D model
application/vnd.unleashlive.model.3d3D model
application/vnd.unleashlive.model.vrVR model
application/vnd.unleashlive.model.pcPoint Cloud model

The annotations field is a stringified JSON object keyed by add-on ID.

KeyValue
{addonId}Annotation object (see below)
FieldTypeDescription
addonIdStringrequired Add-on identifier
labelsObjectLabel annotations (see Image Labels)
sessionInfoObjectSession information (see Session Info)

A map of label objects keyed by label ID.

KeyValue
{id}Label object (see below)
FieldTypeDescription
shapeTypeStringrequired Shape type: POLYGON, RECTANGLE, or POINT
categoryStringrequired Label category
severityNumberSeverity level
commentStringComment text
colorStringDisplay colour
updatedAtTimestamprequired Last updated timestamp
bboxNumber[]Bounding box coordinates
areaNumberLabelled area
distanceNumberDistance measurement
isAIBooleanWhether generated by AI
isAcceptedBooleanWhether accepted by a reviewer
isModifiedBooleanWhether modified after creation
FieldTypeDescription
titleStringDisplay title
valueString or String[]required Session value
orderStringDisplay order
placeholderStringPlaceholder text

Fetch a single media item by its ID.

query GetLibraryItem {
get(item: { id: "<ITEM_ID>" }) {
id
teamId
location
type
tags
createdAt
deviceId
name
parentId
s3Path
updatedAt
mimeType
annotations
metadata {
size
childItemsNumber
make
model
width
height
gpslat
gpslng
isPanoramic
duration
}
}
}
ParameterTypeDescription
item{id: String}required Object containing the item ID
{
"data": {
"get": {
"id": "ItemId1",
"teamId": "teamId1",
"location": "teamId1",
"type": "F",
"tags": "aiResultsNum:1",
"createdAt": 1678802206809,
"deviceId": null,
"name": "Sample folder",
"parentId": "teamId1",
"s3Path": "12345/78910.mp4",
"updatedAt": 1678976523362,
"mimeType": "application/vnd.unleashlive.folder",
"annotations": null,
"metadata": {
"size": 0,
"childItemsNumber": 13,
"make": null,
"model": null,
"width": null,
"height": null,
"gpslat": null,
"gpslng": null,
"isPanoramic": null,
"duration": null
}
}
}
}

For a full working example, see get.js.


Fetch all child items of a known parent folder. The location parameter is the hierarchy path of the parent, constructed by joining the parent’s location and id with /.

query list {
list(sort: desc, location: "<TEAM_ID>/<FOLDER_ID>", limit: 48) {
items {
teamId
location
type
tags
createdAt
deviceId
id
name
parentId
s3Path
updatedAt
mimeType
metadata {
isPanoramic
duration
}
}
nextToken {
pk
sk
locationCreatedAt
teamId
teamIdType
createdAt
searchNameCreatedAt
searchName
deviceId
type
}
}
}
ParameterTypeDescription
locationStringHierarchy path of the parent (e.g. teamId1/folderId1)
parentIdStringFilter by parent folder ID
deviceIdStringFilter by device ID
nameStringFilter by item name
tagsStringFilter by tags
typeStringFilter by item type (e.g. I, V, M)
dateFromStringReturn items created at or after this date
dateToStringReturn items created at or before this date
sortEnumSort order — asc or desc
limitIntMaximum number of items to return
nextTokenLastEvaluatedKeyInputPagination token from a previous response

If there are more items than the specified limit, the response includes a nextToken object. Pass this token to the next request to fetch the following page.

{
"data": {
"list": {
"items": [
{
"teamId": "teamId1",
"location": "teamId1/folderId1",
"type": "D",
"tags": null,
"createdAt": 1678976522491,
"deviceId": "deviceId1",
"id": "1",
"name": "testDocument.json",
"parentId": "folderId1",
"s3Path": "1234/2b0d6d59-d221-4dc1-9cf4-78677a002127.json",
"updatedAt": 1678976539957,
"mimeType": "application/json",
"metadata": {
"isPanoramic": null,
"duration": null
}
},
{
"teamId": "teamId1",
"location": "teamId1/folderId1",
"type": "V",
"tags": null,
"createdAt": 1678976459317,
"deviceId": "deviceId1",
"id": "2",
"name": "testClip.mp4",
"parentId": "folderId1",
"s3Path": "1234/2453702b-8764-4f55-bd81-487f58ec556a.mp4",
"updatedAt": 1678976491797,
"mimeType": "video/mp4",
"metadata": {
"isPanoramic": null,
"duration": 1202.003
}
}
],
"nextToken": null
}
}
}

For a full working example, see list.js.


Move one or more items (including all sub-items) to a new parent folder.

mutation MoveItems {
move(
moveItems: [{ id: "<ITEM_ID>" }]
to: { id: "<DESTINATION_FOLDER_ID>" }
) {
id
parentId
location
}
}
ParameterTypeDescription
moveItems[{id: String}]required Array of objects with item IDs to move
to{id: String}required Destination folder object
{
"data": {
"move": [
{
"id": "itemId1",
"parentId": "itemId11",
"location": "teamId1/itemId11"
}
]
}
}

For a full working example, see move.js.


Rename a single media item.

mutation RenameItems {
rename(item: { id: "<ITEM_ID>" }, newName: "New name") {
id
}
}
ParameterTypeDescription
item{id: String}required Object containing the item ID
newNameStringrequired The new name for the item
{
"data": {
"rename": {
"id": "itemId1"
}
}
}

For a full working example, see rename.js.


Delete one or more items, including all sub-items.

mutation DeleteItems {
delete(deleteItems: [{ id: "<ITEM_ID_1>" }, { id: "<ITEM_ID_2>" }]) {
deleteItems {
id
}
ownerId
}
}
ParameterTypeDescription
deleteItems[{id: String}]required Array of objects with item IDs to delete
{
"data": {
"delete": {
"deleteItems": [{ "id": "itemId1" }, { "id": "itemId2" }],
"ownerId": "userId1"
}
}
}

For a full working example, see delete.js.


File uploads use the AWS S3 SDK directly, not the GraphQL endpoint. The file is uploaded to the S3 upload bucket with metadata that links it to a Media Drive location.

KeyDescription
locationHierarchy path for the upload (e.g. teamId1/folderId1)
parentIdParent folder ID (deprecated — use location)
nameDisplay name for the media item
deviceidDevice ID to associate with the item

For a full working upload example, see upload.js.


Files are downloaded from the Media Drive CDN using the item’s s3Path.

CDN Base URL: https://library.unleashlive.com

Construct the download URL by appending the s3Path to the CDN base URL:

https://library.unleashlive.com/<s3Path>
  1. Query or list items to obtain the s3Path of the desired file.
  2. Construct the full URL: https://library.unleashlive.com/{s3Path}.
  3. Perform an HTTPS GET request to download the file.

For a full working download example, see download.js.