Skip to main content
mrashid
Staff
Staff
Jun 17, 2026 6:06 PM UTC

Technical Tip: Install policy package from policy folder using JSON API

Description

This article describes how to install policy package from a policy folder using JSON API.

Scope

FortiManager.

Solution

In FortiManager, policy package folders are used to organize policy packages. When installing a policy package through API, the folder is not provided as a separate field. Instead, the policy package name must include the folder path.

Example API syntax to install policy package from folder:

{
    "session": "{{session}}",
    "id": 1,
    "method": "exec",
    "params": [
        {
            "url": "/securityconsole/install/package",
            "data": [
                {
                    "adom": "{{adom}}",
                    "pkg": "<policy folder name>/<package name>",
                    "scope": [
                        {
                            "name": "FortiGate",
                            "vdom": "root"
                        }
                    ],
                    "flags": "none"
                }
            ]
        }
    ]
}


For policy package inside nested folders, the package name should include all folders in the hierarchy as shown below:

“pkg”: “Parent folder/child-folder/package name”


Troubleshooting:

The following commands can be used on the FortiManager CLI to debug the API calls:

diagnose debug service httpd 255
diagnose debug service main 255
diagnose debug enable


Related document:

Fortinet Development Network (FNDN)

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT