Skip to main content
farhanahmed
Staff
Staff
March 24, 2026

Technical Tip: How to create Firmware Template using FortiManager API

  • March 24, 2026
  • 1 reply
  • 276 views
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

1 reply

acasupport
New Member
May 1, 2026

Thank you very much for this example.

I am able to Create, Edit, Delete firmware templates now. Except, for Description

 

No matter what i do. Description never gets filled. When i manually edit the description in the GUI it works, and with developer tools i can see the payload is the same as well. 

I'm running FortiManager v7.4.10 build2778 (Mature)

When you create your template. Does description then get filled ?

 

This is my test body for editting description. (i get a 0 OK back also btw)

 

{
  "id": "8bba7e5d-aa7c-4464-a099-98c715308961",
  "params": [
    {
      "url": "pm/fwmprof/adom/root/Test_Destination",
      "data": {
        "description": "testting"
      }
    }
  ],
  "method": "update",
  "session": "redacted"
}

 


code : 0
message : OK

 

But description isn't editted ;(