> For the complete documentation index, see [llms.txt](https://docs.ruuvi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ruuvi.com/ruuvi-gateway-firmware/examples/firmware-update-via-api.md).

# Firmware update via API

You can run a firmware update from a specified URL programmatically, using bearer authentication.

On the "Access Settings" page, enable full access using bearer authentication and set the API-key:

<figure><img src="https://1423309131-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LsPjfnhNj3v37AZtF-d%2Fuploads%2Fgit-blob-5e86acb5475cb225d716e1e2e104e9f496ed7f58%2FScreenshot%20from%202023-12-13%2010-20-48.png?alt=media" alt=""><figcaption></figcaption></figure>

Example of a command to run a firmware update from the URL: "<https://my\\_server.com:7000/gw\\_firmware/>"

```shell
    curl -v http://<RUUVI_GW_IP>/fw_update.json 
      -H "Authorization: Bearer 1SDrQH1FkH+pON0GsSjt2gYeMSP02uYqfuu7LWdaBvY=" 
      -H 'Content-Type: application/json' 
      -d '{"url":"https://my_server.com:7000/gw_firmware/"}'
```
