Skip to content

Mint robot media upload (beta)

Beta
POST
/v1/robots/raw/media
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.

Media typeapplication/json
object
partnerId
required

Partner id. It must match the server key.

string
schemaVersion
required

Schema version of this body. Example: 2026-11.

string
sourceSystem
required

Name of the system that sent this body. Example: partner-export.

string
robotId
required

Robot id. The robot must already exist.

string
recordedAt
required

When the file was recorded, as ISO-8601.

string format: date-time
timezone
required

IANA timezone. Example: Asia/Hong_Kong.

string
contentType
required

Media type. Allowed values are video/mp4, image/jpeg, image/png, application/json, application/x-ndjson, text/csv, text/plain, and application/gzip.

string
Allowed values: video/mp4 image/jpeg image/png application/json application/x-ndjson text/csv text/plain application/gzip
byteLength
required

Exact uploaded size from 1 to 52428800 bytes, subject to the lower configured Storage limit. Verified at complete.

integer
>= 1 <= 52428800

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
}

Signed upload URL minted. The signed URL lasts two hours; complete within 24 hours of minting.

Media typeapplication/json
object
mediaId
required

Id for this file. It is the mediaId in the complete path. A second mint returns a new id.

string
uploadUrl
required

PUT raw bytes here before expiresAt. The private object becomes ready only after complete. Do not share or log this credential.

string format: uri
objectKey
required

Assigned by YAS. Send the bytes to uploadUrl. Do not set this value yourself.

string
expiresAt
required

Upload credential expiry in ISO-8601 UTC, two hours after minting. Complete has a separate 24-hour deadline.

string format: date-time
byteLength
required

Declared byteLength. Complete rejects an object whose actual size differs.

integer

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.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "invalid_body"
}
401The server key is missing or wrong.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

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.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "forbidden"
}
404Unknown `robotId`. Nothing in this call is stored.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "not_found"
}
413The declared size exceeds the effective Storage limit (at most 52428800 bytes).
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "payload_too_large"
}
429Outstanding upload reservations reached the partner limit. Retry after cleanup releases capacity.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "upload_quota_exceeded"
}
503Storage or its required configuration is unavailable. Retry after the Retry-After interval.
Media typeapplication/json
object
error
required

Stable error code. No stack trace.

string

Example

{
"error": "unavailable"
}