> For the complete documentation index, see [llms.txt](https://docs.blynk.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blynk.io/en/blynk.cloud/platform-https-api/uploads.md).

# Uploads

Firmware file upload endpoints

## Upload firmware

> Upload a firmware binary file to the server. This is the first step when\
> creating an OTA shipment: the response gives you the values required by\
> \[\`POST /api/v1/organization/shipment/create\`]\(#operation/createShipment).\
> \
> The file type is determined by the \`type\` form field:\
> \
> \- \`FIRMWARE\` — OTA firmware binary (\`.bin\`, \`.zip\`, \`.tar\`, \`.gz\`, \`.hs\`, \`.xz\`, \`.bz2\`, \`.tar.gz\`, \`.ota.bin.gz\`, \`.bin.gz\`, \`.bin.hs\`, \`.yml\`, \`.yaml\`)\
> \
> The maximum file size is 10 MB.\
> \
> On success the server stores the file and returns a JSON object with:\
> \
> \- \`path\` — the server path to the stored firmware. Pass it as \`pathToFirmware\`\
> &#x20; when creating the shipment.\
> \- \`firmwareInfo\` — metadata parsed from the binary (version, board type,\
> &#x20; hashes, size, …). Pass it as \`firmwareInfo\` when creating the shipment.\
> &#x20; It may be \`null\` if the file could not be parsed.\
> \
> \*\*Authentication:\*\* Use an OAuth2 Bearer token in the \`Authorization\` header.<br>

```json
{"openapi":"3.0.3","info":{"title":"Blynk Platform API","version":"1.0.0"},"tags":[{"name":"Uploads","description":"Firmware file upload endpoints"}],"servers":[{"url":"https://{server_address}","description":"Blynk Server","variables":{"server_address":{"default":"blynk.cloud","description":"Your Blynk server domain"}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 Bearer token obtained from authentication endpoint"}},"schemas":{"FirmwareUploadResponse":{"type":"object","description":"Response returned by `POST /api/upload` when uploading a firmware file (`type=FIRMWARE`). Feed `path` into `pathToFirmware` and `firmwareInfo` into `firmwareInfo` of the create shipment request.","properties":{"path":{"type":"string","description":"Server path to the stored firmware file. Pass this value as `pathToFirmware` when creating a shipment."},"firmwareInfo":{"allOf":[{"$ref":"#/components/schemas/FirmwareInfo"}],"description":"Firmware metadata parsed from the uploaded file. Pass this object as `firmwareInfo` when creating a shipment. May be null if the file could not be parsed.","nullable":true}}},"FirmwareInfo":{"type":"object","properties":{"version":{"type":"string","description":"Firmware version"},"blynkVersion":{"type":"string","description":"Blynk firmware version"},"fwType":{"type":"string","description":"Firmware type (product name)"},"boardType":{"type":"string","description":"Board type"},"buildDate":{"type":"string","description":"Firmware build date"},"md5Hash":{"type":"string","description":"MD5 hash of the firmware file"},"sha256Hash":{"type":"string","description":"SHA-256 hash of the firmware file"},"type":{"type":"string","enum":["NCP","MCU"],"description":"Firmware type"},"fileSize":{"type":"integer","format":"int32","description":"Firmware file size in bytes"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"}},"required":["message"]}},"required":["error"]}}},"paths":{"/api/upload":{"post":{"tags":["Uploads"],"summary":"Upload firmware","description":"Upload a firmware binary file to the server. This is the first step when\ncreating an OTA shipment: the response gives you the values required by\n[`POST /api/v1/organization/shipment/create`](#operation/createShipment).\n\nThe file type is determined by the `type` form field:\n\n- `FIRMWARE` — OTA firmware binary (`.bin`, `.zip`, `.tar`, `.gz`, `.hs`, `.xz`, `.bz2`, `.tar.gz`, `.ota.bin.gz`, `.bin.gz`, `.bin.hs`, `.yml`, `.yaml`)\n\nThe maximum file size is 10 MB.\n\nOn success the server stores the file and returns a JSON object with:\n\n- `path` — the server path to the stored firmware. Pass it as `pathToFirmware`\n  when creating the shipment.\n- `firmwareInfo` — metadata parsed from the binary (version, board type,\n  hashes, size, …). Pass it as `firmwareInfo` when creating the shipment.\n  It may be `null` if the file could not be parsed.\n\n**Authentication:** Use an OAuth2 Bearer token in the `Authorization` header.\n","operationId":"uploadFile","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"upfile":{"type":"string","format":"binary","description":"The firmware file to upload"},"type":{"type":"string","enum":["FIRMWARE"],"description":"Upload file type. Must be `FIRMWARE`. Required — without it the server rejects firmware file extensions and does not return the firmware metadata."}},"required":["upfile","type"]}}}},"responses":{"200":{"description":"File uploaded successfully. Returns the server path to the stored firmware and the parsed firmware metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirmwareUploadResponse"}}}},"400":{"description":"Bad request — invalid or missing file data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden — authentication failed, plan does not support uploads, or upload limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.blynk.io/en/blynk.cloud/platform-https-api/uploads.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
