FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
WinterSnowYap
Article Id 401959
Description This article describes how FortiManager creates a Device Group via API.
Scope FortiManager.
Solution

Scenario:

  1. Go to System Settings -> Administrators, create an administrator account with Read and Write JSON API Access enabled:

 

202507_FMG_API_DeviceGroup_001.png

 

  1. At Postman, create an API script to get the session ID:

 

202507_FMG_API_DeviceGroup_002.png

 

  1. Use the session ID and create a Device Group and assign the FortiGate to the new Device Group:

 

202507_FMG_API_DeviceGroup_003.png

 

202507_FMG_API_DeviceGroup_004.png

Refer to 'API device group.zip' attached.