Skip to main content
Gerhardt7
New Member
Jun 26, 2025 2:24 PM UTC
Question

Adding device mapping to dynamic adres object Fortimanager with a python api/json script

Hello Fortinet Community,

I’m currently working on automating firewall address object updates in FortiManager via the JSON RPC API. My goal is to programmatically add entries to the dynamic_mapping array of a firewall address object.

Here is the structure of the dynamic_mapping entry I am trying to add (simplified example):

{
"_scope": [
{
"name": "DeviceName",
"vdom": "root"
}
],
"allow-routing": 0,
"associated-interface": "any",
"clearpass-spt": 0,
"color": 0,
"dirty": 1,
"fabric-object": 0,
"node-ip-only": 0,
"obj-type": 9,
"route-tag": 0,
"subnet": [
"10.164.110.0",
"255.255.255.0"
],
"type": 0
}

Error i get:

{'code': -10, 'message': 'The data is invalid for selected url'}

 

Could anyone please advise what might be missing or incorrect in the payload format for dynamic_mapping? Are there any known quirks or additional required fields? Any examples of a working dynamic_mapping update via API would be greatly appreciated.

Thanks in advance for your help!

Its part of a script what checks automatic interfaces on fortigates and when a dynamic adress not exist he must add it to the object. 

 

 

1 reply

Gerhardt7
Gerhardt7Author
New Member
Jun 26, 2025 4:27 PM UTC

The solution was to use “add” instead of “update” when adding dynamic mappings to the address object via the API.

Translate
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024