Skip to content

Preview Artifact Metadata

POST
/api/firmware/preview-artifact
curl --request POST \
--url https://example.com/api/firmware/preview-artifact \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file

Preview metadata from an OTA-Pulse artifact without saving it.

This endpoint reads the artifact metadata (artifact_name, device_types) from an artifact file and returns it to help auto-fill upload forms.

The file is saved temporarily and deleted after reading.

GC-BE-10: the body is parsed with streaming_multipart straight from request.stream() (like the two upload routes) instead of a file: UploadFile = File(...) parameter. FastAPI resolves that parameter by parsing the WHOLE multipart body — before the auth dependency, before any size check — into a spooled temp file, so an unauthenticated caller could make this process buffer an arbitrarily large body. Now authentication runs first (the body is untouched on a 401/403), an oversize Content-Length is refused before a byte is read, and the size cap is enforced as the bytes stream in (the partial temp file is unlinked on every failure path).

Media type multipart/form-data
Body
object
file
required
File
string format: binary

Successful Response

Media type application/json
Example generated
example