Mint robot media upload (beta)
const url = 'https://api.example.yas/v1/robots/raw/media';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"partnerId":"partner","schemaVersion":"2026-11","sourceSystem":"partner-export","robotId":"rbt_example","recordedAt":"2026-10-15T10:00:00.000Z","timezone":"Asia/Hong_Kong","contentType":"text/csv","byteLength":1048576}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.yas/v1/robots/raw/media \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "recordedAt": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "contentType": "text/csv", "byteLength": 1048576 }'Beta. Mint a URL for one media file with the server key. Send partnerId, schemaVersion, sourceSystem, robotId, recordedAt, timezone, contentType, and byteLength. The robot must already exist for this partner. Allowed content types are video/mp4, image/jpeg, image/png, application/json, application/x-ndjson, text/csv, text/plain and application/gzip. PUT with the declared Content-Type. application/octet-stream is not accepted for media. byteLength is 1 to 52428800 (50 MiB), or the lower configured Storage limit. Each mint returns a new mediaId and does not replace an earlier file.
Upload credentials last two hours; expiresAt is the credential deadline in ISO-8601 UTC. Complete within 24 hours of minting. The bytes enter private Storage on upload and become ready only after complete verifies their length and type. Storage does not bind the signed URL to byteLength; a mismatched file may be stored temporarily but cannot become ready. Uploads cannot overwrite an object. Mint a new upload after invalid content. Each partner may have at most 10 outstanding upload reservations totaling at most 1 GiB across maps and media. Each reservation uses the effective bucket limit, including abandoned uploads until safe cleanup. Revoking Robots access immediately blocks mint and complete, but an issued Storage credential may remain usable until it expires. Uncompleted objects are cleaned after upload credentials and sessions expire; ready media and the current live map are retained.
contentBase64 is not accepted and returns 400 invalid_body. Send byteLength, upload the bytes to the signed URL, then call complete.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Partner id. It must match the server key.
Schema version of this body. Example: 2026-11.
Name of the system that sent this body. Example: partner-export.
Robot id. The robot must already exist.
When the file was recorded, as ISO-8601.
IANA timezone. Example: Asia/Hong_Kong.
Media type. Allowed values are video/mp4, image/jpeg, image/png, application/json, application/x-ndjson, text/csv, text/plain, and application/gzip.
Exact uploaded size from 1 to 52428800 bytes, subject to the lower configured Storage limit. Verified at complete.
Example
{ "partnerId": "partner", "schemaVersion": "2026-11", "sourceSystem": "partner-export", "robotId": "rbt_example", "recordedAt": "2026-10-15T10:00:00.000Z", "timezone": "Asia/Hong_Kong", "contentType": "text/csv", "byteLength": 1048576}Responses
Section titled “Responses”Signed upload URL minted. The signed URL lasts two hours; complete within 24 hours of minting.
object
Id for this file. It is the mediaId in the complete path. A second mint returns a new id.
PUT raw bytes here before expiresAt. The private object becomes ready only after complete. Do not share or log this credential.
Assigned by YAS. Send the bytes to uploadUrl. Do not set this value yourself.
Upload credential expiry in ISO-8601 UTC, two hours after minting. Complete has a separate 24-hour deadline.
Declared byteLength. Complete rejects an object whose actual size differs.
Example
{ "mediaId": "62bc5e66-8e11-4940-a70d-22efc1979674", "uploadUrl": "https://upload.example.yas/media/62bc5e66-8e11-4940-a70d-22efc1979674", "objectKey": "partners/partner/62bc5e66-8e11-4940-a70d-22efc1979674", "expiresAt": "2026-10-15T12:00:00.000Z", "byteLength": 1048576}400A required field is missing or invalid, the content type is unsupported, or contentBase64 was sent. No upload is created.
object
Stable error code. No stack trace.
Example
{ "error": "invalid_body"}401The server key is missing or wrong.
object
Stable error code. No stack trace.
Example
{ "error": "invalid_credentials"}403A server key may be limited to vehicles, robots, or both. A call outside that limit is 403 `forbidden` and stores nothing. `identity_mismatch` means `partnerId` does not match the server key.
object
Stable error code. No stack trace.
Example
{ "error": "forbidden"}404Unknown `robotId`. Nothing in this call is stored.
object
Stable error code. No stack trace.
Example
{ "error": "not_found"}413The declared size exceeds the effective Storage limit (at most 52428800 bytes).
object
Stable error code. No stack trace.
Example
{ "error": "payload_too_large"}429Outstanding upload reservations reached the partner limit. Retry after cleanup releases capacity.
object
Stable error code. No stack trace.
Example
{ "error": "upload_quota_exceeded"}503Storage or its required configuration is unavailable. Retry after the Retry-After interval.
object
Stable error code. No stack trace.
Example
{ "error": "unavailable"}