Technical Tip: How to create Firmware Template using FortiManager API
Description
This article describes how to create Firmware Template(s) using FortiManager JSON API.
Scope
FortiManager.
Solution
To create a Firmware Template:
{ "method": "add", "params": [ { "data": { "name": "Test_Firmware_Template", // Template Name "type": "fwmprof", "description": "Firmware Template", "fwmprof setting": { "image-source": null, "schedule-day": null, "schedule-type": "none", "enforced version": [ { "flags": 104, "product": "fgt", "platform": "FortiGate-31G", // "platform": "FGT-Default" for all FGTs. "version": "7.4.10-b2867", "upgrade-path": "auto" }, // Can add multiple entries to separte product/version/platform. // For FSW, FAP, FEX flags will be 0. { "flags": 0, "platform": "FSW-Default", "product": "fsw", "upgrade-path": "auto", "version": "7.6.6-b1137" }, { "flags": 0, "platform": "FAP-Default", "product": "fap", "upgrade-path": "auto", "version": "7.6.4-b1078" }, { "flags": 0, "platform": "FXT-Default", "product": "fex", // "product": "fem" --> for FortiExtender-Modem. "upgrade-path": "auto", "version": "7.6.4-b0478" } ] } }, "url": "pm/fwmprof/adom/{{ADOM}}" } ], "id": "1", "session": "{{session}}" }
- The 'flags' key is used to set Upgrade Options.
- The default 'flags' value is set to 104, meaning 'Only upgrade FortiGate Clusters with all members up', 'Skip FortiGate Disk Check', and 'Skip FortiGate Auto Scan Disk' are enabled.
- It is not required for FortiSwitch, FortiAP, and FortiExtender firmware template entries.
- The bitmap values for flags are as follows:
- Boot from alternate partition after upgrade = 1.
- Only upgrade FortiGate Clusters with all members up = 8.
- Skip FortiGate Disk Check = 32.
- Skip FortiGate Auto Scan Disk = 64.
-
To enable 'Let Device Download Firmware From FortiGuard' set:
"image-source": "fds"
- To skip intermediate steps in the upgrade path (not recommended), set:
"upgrade-path": "skip"​
- To schedule the Firmware template:
- For schedule once:
"schedule-day": null, "schedule-end-time": "2026-03-19 14:08", "schedule-start-time": "2026-03-19 14:08", "schedule-type": "once"​
- Daily Schedule:
"schedule-day": null, "schedule-end-time": "14:08", "schedule-start-time": "14:08", "schedule-type": "daily"​
- Weekly Schedule:
"schedule-day": [ "sunday", "monday", "tuesday", "wednesday" ], "schedule-end-time": "14:08", "schedule-start-time": "14:08", "schedule-type": "weekly"
Related documents:
Technical Tip: Using FortiManager API
Fortinet Development Network (FNDN) - FortiManager
Technical Tip: How to create IPsec Template and assign to a device using JSON API
Technical Tip: How to create a CLI Template and Pre-Run CLI Template using JSON API
Technical Tip: How to create SD-WAN Template and assign to a device using JSON API
Technical Tip: How to create and delete SD-WAN Overlay Template using FortiManager API