Fortinet FortiGate

App · 25 actions

Manage a FortiGate firewall: block and unblock IP addresses, keep address groups and policies up to date, check interfaces, VPN tunnels, routes, DHCP leases, firmware and logs, back up the configuration, and start workflows on security events, sign-in failures, configuration changes and links or tunnels going down.

Actions

ActionWhat it does
Add to address groupAdd firewall addresses to an address group, such as a block list a deny policy uses.
Back up configurationGet the FortiGate's configuration as text, as its own backup saves it, to store or compare.
Ban IP addressesBan (quarantine) IP addresses, so the FortiGate drops all their traffic, for a while or until removed.
Create firewall addressCreate a firewall address for an IP address, subnet, range, domain name or country, to use in policies and address groups.
Create firewall policyCreate an IPv4 firewall policy that accepts or denies traffic.
Delete firewall addressDelete a firewall address.
Delete firewall policyDelete a firewall policy.
Get firewall addressGet one firewall address by its name.
Get firewall policyGet one firewall policy by its ID.
Get firmwareGet the FortiOS version the FortiGate runs and the newer versions FortiGuard offers it.
Get resource usageGet the FortiGate's current CPU, memory and disk use and its number of sessions.
Get system statusGet the FortiGate's host name, model, serial number and FortiOS version.
List address groupsList the FortiGate's address groups and the addresses in each.
List banned IP addressesList the IP addresses the FortiGate has banned (quarantined), by its intrusion prevention, DoS policies or an administrator, and when each ban ends.
List DHCP leasesList the addresses the FortiGate's DHCP servers have handed out, with each device's MAC address and host name.
List event logsList the FortiGate's newest event log entries of one kind, such as system events or VPN events.
List firewall addressesList the FortiGate's firewall addresses, the named hosts, subnets, ranges and domains its policies match.
List firewall policiesList the FortiGate's IPv4 firewall policies in the order they are checked, with what each matches and does.
List interfacesList the FortiGate's interfaces with their link status, address and traffic counts.
List IPsec VPN tunnelsList the FortiGate's IPsec VPN tunnels, whether each is up, and its traffic.
List routesList the routes in the FortiGate's IPv4 routing table.
Remove from address groupRemove firewall addresses from an address group.
Set firewall policy statusEnable or disable a firewall policy.
Unban IP addressesLift the FortiGate's ban on IP addresses.
Update firewall addressChange a firewall address's value, comment, interface or name.

Add to address group

Add firewall addresses to an address group, such as a block list a deny policy uses. Addresses already in it are left as they are.

Inputs

Address groupgrouptextRequired
The address group. Pick one, or give its name.
AddressesaddresseslistRequired
The addresses or groups to add.

Outputs

addedlist
The addresses added
already_memberslist
The addresses that were already in it
grouptext
The group
memberslist
Everything in the group now
Example output
{
  "added": [
    "Blocked - 203.0.113.7"
  ],
  "already_members": [],
  "group": "Blocked hosts",
  "members": [
    "Blocked - 198.51.100.23",
    "Blocked - 203.0.113.7"
  ]
}

Back up configuration

Get the FortiGate's configuration as text, as its own backup saves it, to store or compare. Passwords in it stay encrypted. Backing up the whole FortiGate needs an administrator profile with global access.

Inputs

Scopescopetext
Back up the whole FortiGate, or only the VDOM given when Fortinet FortiGate was connected.One of: global (Whole FortiGate (default)), vdom (Only the VDOM given when connecting). Default: global.

Outputs

configurationtext
The configuration file's text
headertext
Its first line, naming the model, version and build
scopetext
global or vdom
size_bytesnumber
Its size in bytes
Example output
{
  "configuration": "#config-version=FGT60F-7.4.4-FW-build2662-240514:opmode=0:vdom=0:user=lodol\n#conf_file_ver=1\n#buildno=2662\nconfig system global\n    set hostname \"HQ-FW01\"\nend\n",
  "header": "#config-version=FGT60F-7.4.4-FW-build2662-240514:opmode=0:vdom=0:user=lodol",
  "scope": "global",
  "size_bytes": 131
}

Ban IP addresses

Ban (quarantine) IP addresses, so the FortiGate drops all their traffic, for a while or until removed.

Inputs

IP addressesip_addresseslistRequired
One or more IPv4 or IPv6 addresses, such as 203.0.113.7.
For how longdurationtext
How long the ban lasts.One of: 3600 (1 hour), 86400 (1 day (default)), 604800 (1 week), 2592000 (30 days), 0 (Until removed). Default: 86400.

Outputs

bannedlist
The addresses banned
countnumber
How many were returned
duration_secondsnumber
How long the ban lasts in seconds, 0 when permanent
permanenttrue/false
Whether the ban lasts until removed
Example output
{
  "banned": [
    "203.0.113.7"
  ],
  "count": 1,
  "duration_seconds": 86400,
  "permanent": false
}

Create firewall address

Create a firewall address for an IP address, subnet, range, domain name or country, to use in policies and address groups.

Inputs

NamenametextRequired
The new address's name, unique on the FortiGate, such as Blocked - 203.0.113.7.
Typeaddress_typetext
What the address matches.One of: ipmask (IP address or subnet), iprange (IP range), fqdn (Domain name (FQDN)), geography (Country). Default: ipmask.
Subnetsubnettext
An IP address or subnet, such as 203.0.113.7, 10.1.0.0/16 or 10.1.0.0 255.255.0.0.Only when Type is IP address or subnet.
First IPstart_iptext
The first address of the range, such as 10.0.0.10.Only when Type is IP range.
Last IPend_iptext
The last address of the range, such as 10.0.0.50.Only when Type is IP range.
Domain namefqdntext
A domain name, such as updates.example.com.Only when Type is Domain name (FQDN).
Countrycountrytext
The two-letter country code, such as US or FR.Only when Type is Country.
Interfaceinterfacetext
Tie the address to one interface. Leave empty for any.
Commentcommenttext
A comment shown in FortiGate.

Outputs

addressobject
The address, as it is now
createdtrue/false
Always true once created
Example output
{
  "address": {
    "cidr": "203.0.113.7/32",
    "comment": "Added by a Lodol workflow",
    "country": "",
    "end_ip": "",
    "fqdn": "",
    "interface": "",
    "name": "Blocked - 203.0.113.7",
    "start_ip": "",
    "subnet": "203.0.113.7 255.255.255.255",
    "type": "ipmask",
    "uuid": "6f3c2a1e-8a43-51ee-1c2a-7c9d0b1e4f2a"
  },
  "created": true
}

Create firewall policy

Create an IPv4 firewall policy that accepts or denies traffic. It goes to the end of the list unless you place it above another policy.

Inputs

NamenametextRequired
The policy's name, up to 35 characters.
Incoming interfacesincoming_interfaceslistRequired
Where the traffic comes in, such as wan1.
Outgoing interfacesoutgoing_interfaceslistRequired
Where the traffic goes out, such as internal.
SourcessourceslistRequired
The source addresses or groups. Choose all for any address.
DestinationsdestinationslistRequired
The destination addresses or groups. Choose all for any address.
ServicesserviceslistRequired
The services it matches. Choose ALL for every service.
Actionpolicy_actiontext
Accept or deny the traffic.One of: accept, deny. Default: accept.
Schedulescheduletext
When the policy applies. Leave empty for always.
NATnattrue/false
Translate the source address to the outgoing interface's, as for internet access.Only when Action is Accept.
Logginglog_traffictext
Which of its sessions to log.One of: utm (Security events only (default)), all (All sessions), disable (No logging). Default: utm.
Enabledenabledtrue/false
Turn the policy on now. Defaults to on.Default: true.
Commentscommentstext
A comment shown in FortiGate.
Place aboveplace_beforetext
Put the new policy just above this one, so it is checked first. Leave empty to add it at the end.

Outputs

createdtrue/false
Always true once created
movedtrue/false
Whether it was placed above another policy
policyobject
The policy, as it is now
policy_idnumber
The new policy's ID
Example output
{
  "created": true,
  "moved": true,
  "policy": {
    "action": "deny",
    "comments": "Drops traffic from hosts on the block list",
    "dstaddr": [
      "all"
    ],
    "dstintf": [
      "internal"
    ],
    "enabled": true,
    "logtraffic": "all",
    "name": "Block bad hosts",
    "nat": false,
    "policy_id": 12,
    "schedule": "always",
    "service": [
      "ALL"
    ],
    "srcaddr": [
      "Blocked hosts"
    ],
    "srcintf": [
      "wan1"
    ],
    "status": "enable",
    "uuid": "9a8b7c6d-8a43-51ee-1c2a-7c9d0b1e4f2a"
  },
  "policy_id": 12
}

Delete firewall address

Delete a firewall address. FortiGate refuses while a policy or address group still uses it.

Inputs

AddressnametextRequired
The firewall address. Pick one, or give its name.

Outputs

deletedtrue/false
Always true once deleted
nametext
The deleted address
Example output
{
  "deleted": true,
  "name": "Blocked - 203.0.113.7"
}

Delete firewall policy

Delete a firewall policy.

Inputs

Policypolicy_idtextRequired
The firewall policy. Pick one, or give its ID number.

Outputs

deletedtrue/false
Always true once deleted
policy_idnumber
The deleted policy's ID
Example output
{
  "deleted": true,
  "policy_id": 12
}

Get firewall address

Get one firewall address by its name.

Inputs

AddressnametextRequired
The firewall address. Pick one, or give its name.

Outputs

addressobject
The address
Example output
{
  "address": {
    "cidr": "203.0.113.7/32",
    "comment": "Added by a Lodol workflow",
    "country": "",
    "end_ip": "",
    "fqdn": "",
    "interface": "",
    "name": "Blocked - 203.0.113.7",
    "start_ip": "",
    "subnet": "203.0.113.7 255.255.255.255",
    "type": "ipmask",
    "uuid": "6f3c2a1e-8a43-51ee-1c2a-7c9d0b1e4f2a"
  }
}

Get firewall policy

Get one firewall policy by its ID.

Inputs

Policypolicy_idtextRequired
The firewall policy. Pick one, or give its ID number.

Outputs

policyobject
The policy
Example output
{
  "policy": {
    "action": "deny",
    "comments": "Drops traffic from hosts on the block list",
    "dstaddr": [
      "all"
    ],
    "dstintf": [
      "internal"
    ],
    "enabled": true,
    "logtraffic": "all",
    "name": "Block bad hosts",
    "nat": false,
    "policy_id": 12,
    "schedule": "always",
    "service": [
      "ALL"
    ],
    "srcaddr": [
      "Blocked hosts"
    ],
    "srcintf": [
      "wan1"
    ],
    "status": "enable",
    "uuid": "9a8b7c6d-8a43-51ee-1c2a-7c9d0b1e4f2a"
  }
}

Get firmware

Get the FortiOS version the FortiGate runs and the newer versions FortiGuard offers it.

Inputs

None.

Outputs

availablelist
Every version FortiGuard offers it
currentobject
The version it runs
latest_versiontext
The newest version offered, or the one it runs
newerlist
The offered versions newer than it runs, newest first
update_availabletrue/false
Whether a newer version is offered
Example output
{
  "available": [
    {
      "build": 2702,
      "major": 7,
      "minor": 4,
      "patch": 5,
      "version": "v7.4.5"
    }
  ],
  "current": {
    "build": 2662,
    "major": 7,
    "minor": 4,
    "patch": 4,
    "version": "v7.4.4"
  },
  "latest_version": "v7.4.5",
  "newer": [
    {
      "build": 2702,
      "major": 7,
      "minor": 4,
      "patch": 5,
      "version": "v7.4.5"
    }
  ],
  "update_available": true
}

Get resource usage

Get the FortiGate's current CPU, memory and disk use and its number of sessions.

Inputs

None.

Outputs

cpu_percentnumber
CPU in use, in percent
disk_percentnumber
Log disk in use, in percent
memory_percentnumber
Memory in use, in percent
session_setup_ratenumber
New sessions a second
sessionsnumber
Sessions open now
Example output
{
  "cpu_percent": 4,
  "disk_percent": 12,
  "memory_percent": 46,
  "session_setup_rate": 38,
  "sessions": 1532
}

Get system status

Get the FortiGate's host name, model, serial number and FortiOS version.

Inputs

None.

Outputs

buildnumber
Its FortiOS build number
hostnametext
The FortiGate's host name
log_disk_statustext
Whether it has a log disk, such as available
modeltext
Its model code, such as FGT60F
model_nametext
Its product name, such as FortiGate
model_numbertext
Its model number, such as 60F
serialtext
Its serial number
vdomtext
The VDOM Lodol works in
versiontext
Its FortiOS version, such as v7.4.4
Example output
{
  "build": 2662,
  "hostname": "HQ-FW01",
  "log_disk_status": "available",
  "model": "FGT60F",
  "model_name": "FortiGate",
  "model_number": "60F",
  "serial": "FGT60FTK21000001",
  "vdom": "root",
  "version": "v7.4.4"
}

List address groups

List the FortiGate's address groups and the addresses in each.

Inputs

Name containsname_containstext
Only those whose name or comment contains this text.

Outputs

countnumber
How many were returned
groupslist
The groups
Example output
{
  "count": 1,
  "groups": [
    {
      "comment": "Hosts the block policy denies",
      "members": [
        "Blocked - 203.0.113.7",
        "Blocked - 198.51.100.23"
      ],
      "name": "Blocked hosts",
      "uuid": "1d2e3f4a-8a43-51ee-1c2a-7c9d0b1e4f2a"
    }
  ]
}

List banned IP addresses

List the IP addresses the FortiGate has banned (quarantined), by its intrusion prevention, DoS policies or an administrator, and when each ban ends.

Inputs

None.

Outputs

bannedlist
The banned addresses
countnumber
How many were returned
Example output
{
  "banned": [
    {
      "created": "2026-11-17T09:30:12Z",
      "expires": "2026-11-18T09:30:12Z",
      "ip_address": "203.0.113.7",
      "ipv6": false,
      "permanent": false,
      "source": "ips"
    }
  ],
  "count": 1
}

List DHCP leases

List the addresses the FortiGate's DHCP servers have handed out, with each device's MAC address and host name.

Inputs

Interfaceinterfacetext
Only leases on this interface. Leave empty for every interface.

Outputs

countnumber
How many were returned
leaseslist
The leases
Example output
{
  "count": 1,
  "leases": [
    {
      "expires": "2026-11-18T09:41:52Z",
      "hostname": "frontdesk-pc",
      "interface": "internal",
      "ip": "192.168.1.110",
      "mac": "a4:83:e7:12:34:56",
      "reserved": false,
      "status": "leased",
      "vendor_class": "MSFT 5.0"
    }
  ]
}

List event logs

List the FortiGate's newest event log entries of one kind, such as system events or VPN events.

Inputs

Loglog_typetext
Which event log to read.One of: system (System (default)), user (User authentication), vpn, router (Routing), ha (High availability), wireless, endpoint (Endpoint control), security-rating (Security rating). Default: system.
Kept insourcetext
Where the FortiGate keeps its logs. Models with a log disk keep them on disk.One of: memory (Memory (default)), disk. Default: memory.
How manylimitnumber
How many entries to return, 1 to 1,000. Defaults to 100.From 1 to 1000.
Offsetoffsetnumber
How many of the newest entries to skip. Use 'next_offset' from an earlier step to read on.At least 0.

Outputs

countnumber
How many were returned
log_typetext
The log read
logslist
The entries, newest first
next_offsetnumber
The offset of the entry after these
sourcetext
memory or disk
total_linesnumber
How many entries the log holds
Example output
{
  "count": 1,
  "log_type": "system",
  "logs": [
    {
      "action": "login",
      "date": "2026-11-17",
      "details": {
        "method": "https",
        "ui": "https(203.0.113.10)",
        "vd": "root"
      },
      "dstip": "198.51.100.2",
      "eventtime": "1763372512123456789",
      "level": "information",
      "logdesc": "Admin login successful",
      "logid": "0100032001",
      "msg": "Administrator admin logged in successfully from https(203.0.113.10)",
      "srcip": "203.0.113.10",
      "status": "success",
      "subtype": "system",
      "time": "09:41:52",
      "type": "event",
      "user": "admin"
    }
  ],
  "next_offset": 1,
  "source": "memory",
  "total_lines": 1
}

List firewall addresses

List the FortiGate's firewall addresses, the named hosts, subnets, ranges and domains its policies match.

Inputs

Name containsname_containstext
Only those whose name or comment contains this text.
Typeaddress_typetext
Only addresses of this type. Leave empty for every type.One of: ipmask (IP address or subnet), iprange (IP range), fqdn (Domain name (FQDN)), geography (Country).

Outputs

addresseslist
The addresses
countnumber
How many were returned
Example output
{
  "addresses": [
    {
      "cidr": "203.0.113.7/32",
      "comment": "Added by a Lodol workflow",
      "country": "",
      "end_ip": "",
      "fqdn": "",
      "interface": "",
      "name": "Blocked - 203.0.113.7",
      "start_ip": "",
      "subnet": "203.0.113.7 255.255.255.255",
      "type": "ipmask",
      "uuid": "6f3c2a1e-8a43-51ee-1c2a-7c9d0b1e4f2a"
    }
  ],
  "count": 1
}

List firewall policies

List the FortiGate's IPv4 firewall policies in the order they are checked, with what each matches and does.

Inputs

Name containsname_containstext
Only those whose name or comment contains this text.
Uses addressaddresstext
Only policies whose sources or destinations include this address or group.

Outputs

countnumber
How many were returned
policieslist
The policies, in order
Example output
{
  "count": 1,
  "policies": [
    {
      "action": "deny",
      "comments": "Drops traffic from hosts on the block list",
      "dstaddr": [
        "all"
      ],
      "dstintf": [
        "internal"
      ],
      "enabled": true,
      "logtraffic": "all",
      "name": "Block bad hosts",
      "nat": false,
      "policy_id": 12,
      "schedule": "always",
      "service": [
        "ALL"
      ],
      "srcaddr": [
        "Blocked hosts"
      ],
      "srcintf": [
        "wan1"
      ],
      "status": "enable",
      "uuid": "9a8b7c6d-8a43-51ee-1c2a-7c9d0b1e4f2a"
    }
  ]
}

List interfaces

List the FortiGate's interfaces with their link status, address and traffic counts.

Inputs

Interfaceinterface_nametext
Only this interface. Leave empty for every interface.

Outputs

countnumber
How many were returned
down_countnumber
How many have their link down
interfaceslist
The interfaces, by name
Example output
{
  "count": 1,
  "down_count": 0,
  "interfaces": [
    {
      "alias": "Internet",
      "ip": "198.51.100.2",
      "link_up": true,
      "mac": "00:09:0f:09:00:01",
      "mask": 24,
      "name": "wan1",
      "rx_bytes": 2919332001,
      "rx_errors": 0,
      "speed": 1000,
      "status": "up",
      "tx_bytes": 482193344,
      "tx_errors": 0
    }
  ]
}

List IPsec VPN tunnels

List the FortiGate's IPsec VPN tunnels, whether each is up, and its traffic.

Inputs

Tunneltunneltext
Only the tunnel with this name. Leave empty for every tunnel.

Outputs

countnumber
How many were returned
down_countnumber
How many are down
tunnelslist
The tunnels
Example output
{
  "count": 1,
  "down_count": 0,
  "tunnels": [
    {
      "comments": "VPN to the branch office",
      "incoming_bytes": 18233411,
      "is_up": true,
      "name": "branch-office",
      "outgoing_bytes": 9922311,
      "phase2": [
        {
          "incoming_bytes": 18233411,
          "name": "branch-office",
          "outgoing_bytes": 9922311,
          "status": "up"
        }
      ],
      "remote_gateway": "203.0.113.50",
      "status": "up"
    }
  ]
}

List routes

List the routes in the FortiGate's IPv4 routing table.

Inputs

Interfaceinterfacetext
Only routes out of this interface. Leave empty for every route.
Destination containsdestination_containstext
Only routes whose destination contains this text, such as 10.1.

Outputs

countnumber
How many were returned
routeslist
The routes
Example output
{
  "count": 1,
  "routes": [
    {
      "destination": "0.0.0.0/0",
      "distance": 10,
      "gateway": "198.51.100.1",
      "interface": "wan1",
      "is_tunnel_route": false,
      "metric": 0,
      "priority": 1,
      "type": "static"
    }
  ]
}

Remove from address group

Remove firewall addresses from an address group. A group can't be left empty.

Inputs

Address groupgrouptextRequired
The address group. Pick one, or give its name.
AddressesaddresseslistRequired
The addresses or groups to remove.

Outputs

grouptext
The group
memberslist
Everything in the group now
not_memberslist
The addresses that weren't in it
removedlist
The addresses removed
Example output
{
  "group": "Blocked hosts",
  "members": [
    "Blocked - 198.51.100.23"
  ],
  "not_members": [],
  "removed": [
    "Blocked - 203.0.113.7"
  ]
}

Set firewall policy status

Enable or disable a firewall policy.

Inputs

Policypolicy_idtextRequired
The firewall policy. Pick one, or give its ID number.
Enabledenabledtrue/falseRequired
On to enable the policy, off to disable it.

Outputs

enabledtrue/false
Whether it is now enabled
policyobject
The policy, as it is now
policy_idnumber
The policy's ID
Example output
{
  "enabled": true,
  "policy": {
    "action": "deny",
    "comments": "Drops traffic from hosts on the block list",
    "dstaddr": [
      "all"
    ],
    "dstintf": [
      "internal"
    ],
    "enabled": true,
    "logtraffic": "all",
    "name": "Block bad hosts",
    "nat": false,
    "policy_id": 12,
    "schedule": "always",
    "service": [
      "ALL"
    ],
    "srcaddr": [
      "Blocked hosts"
    ],
    "srcintf": [
      "wan1"
    ],
    "status": "enable",
    "uuid": "9a8b7c6d-8a43-51ee-1c2a-7c9d0b1e4f2a"
  },
  "policy_id": 12
}

Unban IP addresses

Lift the FortiGate's ban on IP addresses.

Inputs

IP addressesip_addresseslistRequired
One or more IPv4 or IPv6 addresses, such as 203.0.113.7.

Outputs

countnumber
How many were returned
unbannedlist
The addresses unbanned
Example output
{
  "count": 1,
  "unbanned": [
    "203.0.113.7"
  ]
}

Update firewall address

Change a firewall address's value, comment, interface or name. What you leave empty stays as it is.

Inputs

AddressnametextRequired
The firewall address. Pick one, or give its name.
New typeaddress_typetext
Change what the address matches. Leave empty to keep its type.One of: ipmask (IP address or subnet), iprange (IP range), fqdn (Domain name (FQDN)), geography (Country).
Subnetsubnettext
An IP address or subnet, such as 203.0.113.7, 10.1.0.0/16 or 10.1.0.0 255.255.0.0. Leave empty to keep it.
First IPstart_iptext
The first address of the range, such as 10.0.0.10. Leave empty to keep it.
Last IPend_iptext
The last address of the range, such as 10.0.0.50. Leave empty to keep it.
Domain namefqdntext
A domain name, such as updates.example.com. Leave empty to keep it.
Countrycountrytext
The two-letter country code, such as US or FR. Leave empty to keep it.
Interfaceinterfacetext
Tie the address to one interface. Leave empty for any. Leave empty to keep it.
Commentcommenttext
A comment shown in FortiGate. Leave empty to keep it.
New namenew_nametext
Rename the address. Leave empty to keep it.

Outputs

addressobject
The address, as it is now
changedlist
The fields that were changed
updatedtrue/false
Always true once updated
Example output
{
  "address": {
    "cidr": "203.0.113.7/32",
    "comment": "Added by a Lodol workflow",
    "country": "",
    "end_ip": "",
    "fqdn": "",
    "interface": "",
    "name": "Blocked - 203.0.113.7",
    "start_ip": "",
    "subnet": "203.0.113.7 255.255.255.255",
    "type": "ipmask",
    "uuid": "6f3c2a1e-8a43-51ee-1c2a-7c9d0b1e4f2a"
  },
  "changed": [
    "comment"
  ],
  "updated": true
}

On this page