Get Media by Content ID
GET/v1/api/storage/media/:contentId
Generic media fetch by content ID. Streams images directly and range-streams
video content (supports the Range header for seeking).
This route is preferred over the legacy per-feature filename-based image
routes (e.g. shipment/label/incident/user image routes) wherever a
content_id is already available — most list/detail queries expose
media.content.image.id or media.content.video.id via the shared
mediaJoin SQL helper, so no extra query is needed to resolve it.
The older filename-based routes are not deprecated; they remain in
active use for cases where only a filename is available (e.g. raw
detection_data entries) or where feature-specific logic is required
(e.g. incident bounding-box/zone overlays, which additionally require an
incident_id to disambiguate images shared across multiple incidents —
see GET /safety/incidents/image/content/{contentId}).
Auth Required — no additional permission check is applied; access is gated purely by a valid session or API key, matching the read-only, non-sensitive nature of already-referenced media content.
Request
Responses
- 200
- 206
- 400
- 401
- 404
- 500
Media retrieved successfully
Partial content (video range request)
Bad Request. The request was invalid or cannot be otherwise served.
Unauthorized. User is not authenticated or session is invalid.
Resource not found
Internal Server Error