FortiOS 5.6 REST API
FortiOS 5.6 REST API
VERSION 5.6.0
FORTINET DOCUMENT LIBRARY
http://docs.fortinet.com
FORTINET BLOG
https://blog.fortinet.com
FORTIGATE COOKBOOK
http://cookbook.fortinet.com
FORTIGUARD CENTER
http://www.fortiguard.com
FEEDBACK
Email: techdocs@fortinet.com
01-560-414177-20170331
TABLE OF CONTENTS
Change Log 6
Introduction 7
What's New in the REST API 7
Authentication 7
Authentication Cookie 7
CSRF Tokens 8
Admin profile permission 8
Setting Up an Authenticated Session 8
Logging out of an Authenticated Session 8
Supported HTTP methods 9
Response codes 9
Debugging 10
CMDB API 11
URL path 11
URL parameters 11
Generic parameters 12
Specific parameters 12
Body data 13
Limitation 13
Filter with multiple key/value pairs 14
Filter Syntax 14
Filter Operators 14
Combining Filters 15
Reserved Characters 15
List of Methods 15
collection 16
resource 17
Examples 19
Retrieve table 19
Retrieve table schema 20
Retrieve table default 20
Purge table 20
Retrieve object 21
Create object 21
Edit object 21
Delete object 21
Clone object 22
Move object 22
Append child object 22
Edit child object 22
Delete child object 22
Purge child table 23
Retrieve complex table 23
Edit complex table 23
Global requests (apply to all accessible vdoms) 23
Monitor API 24
URL path 24
URL parameters 24
Generic parameters 24
Specific parameters 24
Body data 25
File upload 25
File upload via JSON data 25
File upload via multi-part file 25
File download 26
File download via browser 26
File download via script 26
List of Methods 26
endpoint-control 37
firewall 43
fortiview 52
geoip 53
ips 53
license 54
log 55
router 60
system 63
switch-controller 78
extender-controller 96
user 97
utm 103
virtual-wan 104
webfilter 105
vpn 108
wanopt 111
webproxy 113
webcache 113
wifi 114
coverage 120
Examples 120
Change Log
Change Log
This document provides the REST API information supported in FortiOS 5.6.0. This document covers a reference
of the REST API supported by the FortiOS GUI.
l CMDB API
l Retrieve object meta data (default, schema)
l Retrieve object/table (with filter, format, start, count, other flags)
l Create object
l Modify object
l Delete object
l Clone object
l Move object
l Monitor API
l Retrieve/Reset endpoint stats (with filter, start, count)
l Perform endpoint operations
l Upload/Download file
l Restore/Backup config
l Upgrade/Downgrade firmware
l Restart/Shutdown FGT
Authentication
Authentication Cookie
Authentication cookie (APSCOOKIE) is provided by the API after a successful login request. All subsequent
requests must include this cookie to be authorized by the API. Any request without the cookie or with mismatched
cookie will be denied access to the API (HTTP 401 error code).
CSRF Tokens
Cross-Site Request Forgery (CSRF) Tokens are alphanumeric values that are passed back-and-forth between
client and server to ensure that a user's form submission does not originate from an offsite document.
The CSRF token is available in the session ccsrftoken cookie, which must be included in the request header
under X-CSRFTOKEN. See test script sample for how to handle CSRF token.
Admin with read-only permission to the resource can only send read requests (HTTP GET) to the resource.
Admin with write permission to the resource can send read/write requests (HTTP GET/POST/PUT/DELETE) to
the resource. Admin with no permission to the resource cannot access the resource.
To log out, a POST request to the /logout URL will remove the current session.
For any action other than GET, a CSRF token must be provided to the API. If the
request is submitted using HTTP POST, the HTTP method can also be overridden
using the X-HTTP-Method-Override HTTP header.
Response codes
FortiOS APIs use well-defined HTTP status codes to indicate query results to the API.
The following table shows how some of the HTTP status codes are used in the context of FortiOS REST APIs.
403 - Forbidden Request is missing CSRF token or administrator is missing access profile
permissions.
405 - Method Not Allowed Specified HTTP method is not allowed for this resource.
413 - Request Entity Too Request cannot be processed due to large entity.
Large
424 - Failed Dependency Fail dependency can be duplicate resource, missing required parameter,
missing required attribute, invalid attribute value
500 - Internal Server Error Internal error when processing the request.
Debugging
Verbose debug output can be enabled in the FortiGate CLI with the following commands:
diagnose debug enable
diagnose debug application httpsd -1
This will produce the following output when the REST API for IPv4 policy statistics is queried:
[httpsd 228 - 1418751787] http_config.c[558] ap_invoke_handler -- new request
(handler='api_monitor_v2-handler', uri='/api/v2/monitor/firewall/policy',
method='GET')
[httpsd 228 - 1418751787] http_config.c[562] ap_invoke_handler -- User-Agent: Mozilla/5.0
(Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/39.0.2171.71 Safari/537.36
[httpsd 228 - 1418751787] http_config.c[565] ap_invoke_handler -- Source:
192.168.1.100:56256 Destination: 192.168.1.99:443
[httpsd 228 - 1418751787] api_monitor.c[1427] api_monitor_v2_handler -- received api_
monitor_v2_request from '192.168.1.100'
[httpsd 228 - 1418751787] aps_access.c[3652] aps_chk_rolebased_perm -- truncated URI
(/api/v2/monitor/firewall/policy) to (/api/v2/monitor) for permission check
[httpsd 228 - 1418751787] api_monitor.c[1265] handle_req_v2_vdom -- attempting to change
from vdom "root" to vdom "root"
[httpsd 228 - 1418751787] api_monitor.c[1280] handle_req_v2_vdom -- new API request
(action='select',path='firewall',name='policy',vdom='root',user='admin')
[httpsd 228 - 1418751787] api_monitor.c[1286] handle_req_v2_vdom -- returning to original
vdom "root"
[httpsd 228 - 1418751787] http_config.c[581] ap_invoke_handler -- request completed
(handler='api_monitor_v2-handler' result==0)
This debug will also include all requests to/from the FortiOS web interface, in addition
to REST API requests.
CMDB API is used to retrieve and modify CLI configurations. For example, create/edit/delete firewall policy.
URL path
All CMDB requests start with '/api/v2/cmdb/'. Below is the format of CMDB URL path.
/api/v2/cmdb/<path>/<name>/<mkey>(optional)/<child_name>(optional)/<child_mkey>
(optional)/
CMDB URL path follows CLI commands syntax with an exception of vdom configuration.
For operations on the entire table, mkey is not needed. For instance, add new entry, get all entries, purge table.
For operations on a specific resource, mkey is required. For example, edit/delete/clone/move a firewall policy.
For operations on the child table, child_name is required. For example, retrieve child table, purge child table, add
new entry to child table.
For operations on the child table entry, child_mkey is required. For example, delete/move child object.
URL parameters
In addition to the URL path, user can specify URL parameters which are appended to the URL path.
Generic parameters
The following URL parameters are generic to all CMDB requests.
Specific parameters
Each CMDB method may require extra URL parameters which are unique to the method. Those extra parameters
are documented in the "Extra Parameters" section of each CMDB method.
Body data
Beside URL parameters, some POST/PUT requests also require body data, which must be included in the HTTP
body. For example, to create/edit firewall address object, user needs to specify the new/edit data.
POST /api/v2/cmdb/firewall {'name':"address1", 'type': "ipmask", create new firewall address with
/address?vdom=root 'subnet': "1.1.1.0 255.255.255.0"} the specified data
PUT /api/v2/cmdb/firewall {'subnet': "2.2.2.0 255.255.255.0"} edit firewall address with the
/address/address1?vdom=root specified data
Limitation
If the body data has the same name as some reserved URL parameters, such as name, path, or action, the
request would fail due to the conflict. For example, firewall policy has 'name' and 'action' attribute which conflict
with the reserved URL parameter 'name' and 'action'. POST/PUT with normal method would fail with 405 error. A
workaround is to enclosed all object data in a 'json' keyword so the API can correctly identify object data. For
example:
POST /api/v2/cmdb {'name':"test_policy", 'srcintf': [{"name":"port1"}], 'dstintf': This would fail with
/firewall/policy? [{"name":"port2"}],'srcaddr': [{"name":"all"}],'dstaddr': 405 error
vdom=root [{"name":"all"}],'action':"accept",'status':"enable",
'schedule':"always",'service':[{'name':"ALL"}],'nat':"disable"}
Filtering multiple key/value pairs are also supported for all CMDB retrieval requests via 'filter' URL parameter.
Filter Syntax
Filters are defined in the following syntax: key operator pattern
Filter Operators
Operator Description
Combining Filters
Filters can be combined to create complex queries.
Logical OR Separate filters using commas ",". The following GET /api/v2/cmdb/firewall
example returns all policies using the always /policy?filter=schedule==
schedule or the once schedule. always,schedule==once
Logical AND Filter strings can be combined to create logical AND GET /api/v2/cmdb/firewall
queries by including multiple filters in the request. /policy/?filter=schedule==
This example includes all policies using schedule always&filter=action==accept
always AND action accept.
Combining You can combine AND and OR filters together to GET /api/v2/cmdb/firewall
AND and OR create more complex filters. This example includes /policy/?filter=schedule==
all policies using schedule always AND action accept always&filter=action==accept,
OR action deny. action==deny
Reserved Characters
The following characters need to be escaped if they are part of a filter pattern.
, \,
\ \\
List of Methods
resource GET default Return the CLI default values for this object type.
resource GET default Return the CLI default values for entire CLI tree.
resource GET schema Return the CLI schema for this object type.
collection
GET
Extra parameters
with_meta boolean Enable to include meta information about each object (type id, No
references, etc).
skip boolean Enable to call CLI skip operator to hide skipped properties. No
filter string Comma separated list of key value pairs to filter on. Filters will No
be logically OR'd together.
key string If present, objects will be filtered on property with this name. No
pattern string If present, objects will be filtered on property with this value. No
resource
GET: default
Summary Return the CLI default values for this object type.
GET: default
Summary Return the CLI default values for entire CLI tree.
GET: schema
GET: schema
DELETE
POST
GET
Extra parameters
with_meta boolean Enable to include meta information about each object (type id, No
references, etc).
skip boolean Enable to call CLI skip operator to hide skipped properties. No
PUT
PUT: move
Extra parameters
before string The ID of the resource that this resource will be moved before. No
after string The ID of the resource that this resource will be moved after. No
POST: clone
Extra parameters
DELETE
GET
Examples
Retrieve table
Purge table
Retrieve object
Create object
Edit object
Delete object
Clone object
Move object
Monitor API is used to perform specific actions on endpoint resources. For example, retrieve/close firewall
sessions, restart/shutdown FGT, backup/restore config file.
URL path
All Monitor API requests start with '/api/v2/monitor/'. Below is the format of Monitor URL path.
/api/v2/monitor/<uri>/
Each Monitor endpoint has a specific URI, which are provided by the URI field of each endpoint.
URL parameters
In addition to the URL path, user can specify URL parameters which are appended to the URL path.
Generic parameters
The following URL parameters are generic to all Monitor requests.
Specific parameters
Each Monitor endpoint may require extra URL parameters which are unique to the endpoint. Those extra
parameters are documented in the "Extra Parameters" section of each endpoint.
Body data
Beside URL parameters, some POST requests also require body data, which must be included in the HTTP body.
The extra body data are documented in "Extra Parameters" section of each endpoint.
POST /api/v2/monitor/firewall/ {'pro': "udp", 'saddr': Close the specific ipv4 firewall
session/close?vdom=root "192.168.100.110", 'daddr': sessions
"96.45.33.73", 'sport': 55933, 'dport':
8888}
File upload
File upload is supported for some endpoints. For example, upload VM license, restore config file. The upload file
must be stored in the HTTP body. There are two different methods to do so: via JSON data or multi-part file.
For instance, below is how you can upload/restore config file via JSON data using Python Requests module.
self.session.post(url='/api/v2/monitor/system/config/restore',
params={"vdom": "vdom1"},
data={"source": "upload",
"scope": "vdom",
"file_content": b64encode(open("vd1.conf.txt", "r").read())})
For instance, below is how you can upload/restore config file via multi-part file using Python Requests module.
self.session.post(url='/api/v2/monitor/system/config/restore',
params={"vdom": "vdom1"},
data={"source": "upload",
"scope": "vdom"},
files=[('random_name',
('random_conf.conf', open("vd1.conf.txt", "r"), 'text/plain'))])
File download
File download is also supported in some endpoints. For example, download CA certificate, backup config file.
The downloaded file is stored in the response's raw content, not JSON data.
For example, here is the request to download global certificate name Fortinet_Factory, type local, scope
global:
GET /api/v2/monitor/system/certificate/download?mkey=Fortinet_
Factory&type=local&scope=global
List of Methods
firewall/acl/clear_counters/ POST Reset counters for one or more IPv4 ACLs by policy ID.
firewall/acl6/clear_counters/ POST Reset counters for one or more IPv6 ACLs by policy ID.
firewall/policy/clear_counters/ POST Reset traffic statistics for one or more IPv4 policies by
policy ID.
firewall/policy6/clear_counters/ POST Reset traffic statistics for one or more IPv6 policies by
policy ID.
firewall/proxy-policy/select/ GET List traffic statistics for all explicit proxy policies.
firewall/proxy-policy/clear_coun- POST Reset traffic statistics for one or more explicit proxy
ters/ policies by policy ID.
firewall/session/clear_all/ POST Immediately clear all active IPv4 and IPv6 sessions.
firewall/address-fqdns/select/ GET List of FQDN address objects and the IPs they resolved
to.
license/forticare-resellers/select/ GET Get current FortiCare resellers for the requested coun-
try.
log/current-disk-usage/select/ GET Return current used, free and total disk bytes.
log/stats/select/ GET Return number of logs sent by category per day for a
specific log device.
system/dhcp/select/ GET Returns a list of all DHCP IPv4 and IPv6 DHCP leases.
system/fsck/start/ POST Reboot the device and immediately start file system
check utility.
system/resource/usage/ GET Retreive current and historical usage data for a provided
resource.
system/available-inter- GET Retrieve a list of all interfaces along with some meta
faces/select/ information regarding their availability.
system/available-interfaces/ha/ GET Retrieve a list of all interfaces along with some meta
information regarding their availability. Includes extra
meta information useful when dealing with interfaces
related to HA configuration. Interfaces that are used by
an HA cluster as management interfaces are also
included in this view
system/acquired-dns/select/ GET Retrieve a list of interfaces and their acquired DNS serv-
ers.
system/usb-log/start/ POST Start backup of logs from current VDOM to USB drive.
system/botnet/select/ GET List all known IP-based botnet entries in FortiGuard bot-
net database.
system/object/usage/ GET Retrieve all objects that are currently using as well as
objects that can use the given object.
user/banned/add_users/ POST Immediately add one or more users to the banned list.
user/fsso/refresh-server/ POST Refresh remote agent group list for all fsso agents.
webfilter/override/select/ GET List all administrative and user initiated webfilter over-
rides.
wifi/interfering_ap/select/ GET Retrieve a list of interfering APs for one FortiAP radio.
endpoint-control
profile: xml
URI endpoint-control/profile/xml/
Action xml
Extra parameters
registration-password: check
URI endpoint-control/registration-password/check/
Action check
Extra parameters
record-list: select
URI endpoint-control/record-list/select/
Action select
Extra parameters
intf_name string Filter: Name of interface where the endpoint was detected. No
registration: summary
URI endpoint-control/registration/summary/
Action summary
registration: quarantine
URI endpoint-control/registration/quarantine/
Action quarantine
Extra parameters
registration: unquarantine
URI endpoint-control/registration/unquarantine/
Action unquarantine
Extra parameters
registration: block
URI endpoint-control/registration/block/
Action block
Extra parameters
registration: unblock
URI endpoint-control/registration/unblock/
Action unblock
Extra parameters
registration: deregister
URI endpoint-control/registration/deregister/
Action deregister
Extra parameters
installer: select
URI endpoint-control/installer/select/
Action select
Extra parameters
min_version string Filter: Minimum installer version. (String of the format n[.n No
[.n]]).
installer: download
URI endpoint-control/installer/download/
Action download
Extra parameters
avatar: download
URI endpoint-control/avatar/download/
Action download
Extra parameters
alias string Alias of the device. Used to lookup device avatar when end- No
point avatar is not available.
firewall
health: select
URI firewall/health/select/
Action select
local-in: select
URI firewall/local-in/select/
Action select
acl: select
URI firewall/acl/select/
Action select
acl: clear_counters
Summary Reset counters for one or more IPv4 ACLs by policy ID.
URI firewall/acl/clear_counters/
Action clear_counters
Extra parameters
acl6: select
URI firewall/acl6/select/
Action select
acl6: clear_counters
Summary Reset counters for one or more IPv6 ACLs by policy ID.
URI firewall/acl6/clear_counters/
Action clear_counters
Extra parameters
policy: select
URI firewall/policy/select/
Action select
policy: reset
URI firewall/policy/reset/
Action reset
policy: clear_counters
Summary Reset traffic statistics for one or more IPv4 policies by policy ID.
URI firewall/policy/clear_counters/
Action clear_counters
Extra parameters
policy6: select
URI firewall/policy6/select/
Action select
policy6: reset
URI firewall/policy6/reset/
Action reset
policy6: clear_counters
Summary Reset traffic statistics for one or more IPv6 policies by policy ID.
URI firewall/policy6/clear_counters/
Action clear_counters
Extra parameters
proxy-policy: select
URI firewall/proxy-policy/select/
Action select
proxy-policy: clear_counters
Summary Reset traffic statistics for one or more explicit proxy policies by policy ID.
URI firewall/proxy-policy/clear_counters/
Action clear_counters
Extra parameters
policy-lookup: select
Summary Performs a policy lookup by creating a dummy packet and asking the kernel
which policy would be hit.
URI firewall/policy-lookup/select/
Action select
Extra parameters
session: select
URI firewall/session/select/
Action select
Extra parameters
session: clear_all
URI firewall/session/clear_all/
Action clear_all
session: close
Summary Close a specific firewall session that matches all provided criteria.
URI firewall/session/close/
Action close
Extra parameters
session-top: select
URI firewall/session-top/select/
Action select
Extra parameters
filter object A map of filter keys to string values. The key(s) may be srcintf, No
source, dstintf, destination, policyid, application, web_cat-
egory_id, web_domain, country.
shaper: select
URI firewall/shaper/select/
Action select
shaper: reset
URI firewall/shaper/reset/
Action reset
load-balance: select
URI firewall/load-balance/select/
Action select
Extra parameters
address-fqdns: select
Summary List of FQDN address objects and the IPs they resolved to.
URI firewall/address-fqdns/select/
Action select
fortiview
statistics: select
Summary Retrieve drill-down and summary data for FortiView (both realtime and his-
torical).
URI fortiview/statistics/select/
Action select
Extra parameters
sandbox-file-details: select
URI fortiview/sandbox-file-details/select/
Action select
Extra parameters
checksum string Checksum of a specific file that has been analyzed by the con- Yes
nected FortiSandbox.
geoip
geoip-query: select
Summary Retrieve location details for IPs queried against FortiGuard's geoip service.
URI geoip/geoip-query/select/
Action select
Extra parameters
ip_addresses string One or more IP address strings to query for location details. Yes
ips
rate-based: select
URI ips/rate-based/select/
Action select
license
status: select
URI license/status/select/
Action select
database: upgrade
URI license/database/upgrade/
Action upgrade
Extra parameters
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
forticare-resellers: select
URI license/forticare-resellers/select/
Action select
Extra parameters
forticare-org-list: select
URI license/forticare-org-list/select/
Action select
log
current-disk-usage: select
URI log/current-disk-usage/select/
Action select
device: state
URI log/device/state/
Action state
forticloud: select
URI log/forticloud/select/
Action select
fortianalyzer: select
URI log/fortianalyzer/select/
Action select
Extra parameters
fortianalyzer-queue: select
URI log/fortianalyzer-queue/select/
Action select
Extra parameters
hourly-disk-usage: select
URI log/hourly-disk-usage/select/
Action select
historic-daily-remote-logs: select
Summary Returns the amount of logs in bytes sent daily to a remote logging service
(FortiCloud or FortiAnalyzer).
URI log/historic-daily-remote-logs/select/
Action select
stats: select
Summary Return number of logs sent by category per day for a specific log device.
URI log/stats/select/
Action select
Extra parameters
stats: reset
URI log/stats/reset/
Action reset
forticloud-report: download
URI log/forticloud-report/download/
Action download
Extra parameters
ips-archive: download
Summary Download IPS/application control packet capture files. Uses configured log
display device.
URI log/ips-archive/download/
Action download
Extra parameters
pcap_no int Packet capture roll number (required when log device is 'disk') No
pcap_cat- int Packet capture category (required when log device is 'disk') No
egory
policy-archive: download
URI log/policy-archive/download/
Action download
Extra parameters
av-archive: download
URI log/av-archive/download/
Action download
Extra parameters
router
ipv4: select
URI router/ipv4/select/
Action select
Extra parameters
count int Maximum number of entries to return (Default for all routes). No
ipv6: select
URI router/ipv6/select/
Action select
Extra parameters
count int Maximum number of entries to return (Default for all routes). No
statistics: select
URI router/statistics/select/
Action select
Extra parameters
ip_version int IP version (4|6). If not present, IPv4 and IPv6 will be returned. No
lookup: select
URI router/lookup/select/
Action select
Extra parameters
system
admin: toggle-vdom-mode
Summary Toggles VDOM mode on/off. Enables or disables VDOM mode if it is dis-
abled or enabled respectively.
URI system/admin/toggle-vdom-mode/
Action toggle-vdom-mode
config-revision: select
URI system/config-revision/select/
Action select
config-revision: update-comments
URI system/config-revision/update-comments/
Action update-comments
Extra parameters
config-revision: delete
URI system/config-revision/delete/
Action delete
Extra parameters
config-revision: file
URI system/config-revision/file/
Action file
Extra parameters
config-revision: info
URI system/config-revision/info/
Action info
Extra parameters
config-revision: save
URI system/config-revision/save/
Action save
Extra parameters
current-admins: select
URI system/current-admins/select/
Action select
disconnect-admins: select
URI system/disconnect-admins/select/
Action select
Extra parameters
id int Admin ID No
time: set
URI system/time/set/
Action set
Extra parameters
year int Specifies the year for setting/updating time manually. Yes
month int Specifies the month (0 - 11) for setting/updating time manually. Yes
day int Specifies the day for setting/updating time manually. Yes
hour int Specifies the hour (0 - 23) for setting/updating time manually. Yes
minute int Specifies the minute (0 - 59) for setting/updating time manu- Yes
ally.
second int Specifies the second (0 - 59) for setting/updating time manu- Yes
ally.
time: select
URI system/time/select/
Action select
os: reboot
URI system/os/reboot/
Action reboot
Extra parameters
os: shutdown
URI system/os/shutdown/
Action shutdown
Extra parameters
vdom-resource: select
Summary Retrieve VDOM resource information, including CPU and memory usage.
URI system/vdom-resource/select/
Action select
dhcp: select
Summary Returns a list of all DHCP IPv4 and IPv6 DHCP leases.
URI system/dhcp/select/
Action select
Extra parameters
dhcp: revoke
URI system/dhcp/revoke/
Action revoke
Extra parameters
dhcp6: revoke
URI system/dhcp6/revoke/
Action revoke
Extra parameters
firmware: select
Summary Retrieve a list of firmware images available to use for upgrade on this
device.
URI system/firmware/select/
Action select
firmware: upgrade
URI system/firmware/upgrade/
Action upgrade
Extra parameters
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
fsck: start
Summary Reboot the device and immediately start file system check utility.
URI system/fsck/start/
Action start
storage: select
URI system/storage/select/
Action select
change-password: select
URI system/change-password/select/
Action select
password-policy-conform: select
URI system/password-policy-conform/select/
Action select
csf: select
URI system/csf/select/
Action select
modem: select
URI system/modem/select/
Action select
modem: reset
URI system/modem/reset/
Action reset
modem: connect
URI system/modem/connect/
Action connect
modem: disconnect
URI system/modem/disconnect/
Action disconnect
3g-modem: select
URI system/3g-modem/select/
Action select
resource: usage
Summary Retreive current and historical usage data for a provided resource.
URI system/resource/usage/
Action usage
Extra parameters
sniffer: select
URI system/sniffer/select/
Action select
sniffer: restart
URI system/sniffer/restart/
Action restart
Extra parameters
sniffer: start
URI system/sniffer/start/
Action start
Extra parameters
sniffer: stop
URI system/sniffer/stop/
Action stop
Extra parameters
sniffer: download
URI system/sniffer/download/
Action download
Extra parameters
fsw: select
URI system/fsw/select/
Action select
Extra parameters
fsw: update
URI system/fsw/update/
Action update
Extra parameters
fsw: restart
URI system/fsw/restart/
Action restart
Extra parameters
fsw: upgrade
Summary Upgrade firmware image on the given FortiSwitch using uploaded file.
URI system/fsw/upgrade/
Action upgrade
Extra parameters
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
fsw-firmware: select
URI system/fsw-firmware/select/
Action select
Extra parameters
switch-controller
managed-switch: faceplate-xml
URI switch-controller/managed-switch/faceplate-xml/
Action faceplate-xml
Extra parameters
interface: select
URI system/interface/select/
Action select
Extra parameters
available-interfaces: select
Summary Retrieve a list of all interfaces along with some meta information regarding
their availability.
URI system/available-interfaces/select/
Action select
available-interfaces: ha
Summary Retrieve a list of all interfaces along with some meta information regarding
their availability. Includes extra meta information useful when dealing with
interfaces related to HA configuration. Interfaces that are used by an HA
cluster as management interfaces are also included in this view
URI system/available-interfaces/ha/
Action ha
interface-bandwidth: select
URI system/interface-bandwidth/select/
Action select
acquired-dns: select
URI system/acquired-dns/select/
Action select
resolve-fqdn: select
URI system/resolve-fqdn/select/
Action select
Extra parameters
usb-log: select
Summary Retrieve information about connected USB drives, including estimated log
sizes.
URI system/usb-log/select/
Action select
usb-log: start
URI system/usb-log/start/
Action start
usb-log: stop
URI system/usb-log/stop/
Action stop
ipconf: select
URI system/ipconf/select/
Action select
Extra parameters
fortiguard: update
URI system/fortiguard/update/
Action update
fortiguard: clear-cache
URI system/fortiguard/clear-cache/
Action clear-cache
fortiguard: test-availability
URI system/fortiguard/test-availability/
Action test-availability
fortiguard: server-info
URI system/fortiguard/server-info/
Action server-info
fortimanager: status
URI system/fortimanager/status/
Action status
fortimanager: config
URI system/fortimanager/config/
Action config
Extra parameters
available-certificates: select
URI system/available-certificates/select/
Action select
Extra parameters
certificate: download
URI system/certificate/download/
Action download
Extra parameters
debug: select
URI system/debug/select/
Action select
Extra parameters
debug: download
URI system/debug/download/
Action download
com-log: dump
URI system/com-log/dump/
Action dump
com-log: update
URI system/com-log/update/
Action update
com-log: download
URI system/com-log/download/
Action download
botnet: stat
URI system/botnet/stat/
Action stat
botnet: select
Summary List all known IP-based botnet entries in FortiGuard botnet database.
URI system/botnet/select/
Action select
Extra parameters
botnet-domains: select
Summary List all known domain-based botnet entries in FortiGuard botnet database.
URI system/botnet-domains/select/
Action select
Extra parameters
botnet-domains: stat
URI system/botnet-domains/stat/
Action stat
ha-statistics: select
URI system/ha-statistics/select/
Action select
ha-checksums: select
URI system/ha-checksums/select/
Action select
ha-peer: select
URI system/ha-peer/select/
Action select
Extra parameters
serial_no string Serial number of the HA member. If not specified, fetch inform- No
ation for all HA members
vcluster_id int Virtual cluster number. If not specified, fetch information for all No
active vclusters
ha-peer: update
URI system/ha-peer/update/
Action update
Extra parameters
ha-peer: disconnect
URI system/ha-peer/disconnect/
Action disconnect
Extra parameters
interface string Name of the interface which should be assigned for man- Yes
agement.
mask string Full network mask to assign to the selected interface. Yes
link-monitor: select
URI system/link-monitor/select/
Action select
Extra parameters
compliance: run
URI system/compliance/run/
Action run
config: restore
URI system/config/restore/
Action restore
Extra parameters
source string Configuration file data source [upload | usb | revision]. Yes
usb_filename string When using 'usb' source: the filename to restore from the con- No
nected USB device.
scope string Specify global or VDOM only restore [global | vdom]. Yes
vdom string If 'vdom' scope specified, the name of the VDOM to restore con- No
figuration.
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
config: backup
URI system/config/backup/
Action backup
Extra parameters
usb_filename string When using 'usb' destination: the filename to save to on the No
connected USB device
scope string Specify global or VDOM only backup [global | vdom]. Yes
vdom string If 'vdom' scope specified, the name of the VDOM to backup con- No
figuration.
config: usb-filelist
URI system/config/usb-filelist/
Action usb-filelist
sandbox: status
URI system/sandbox/status/
Action status
sandbox: stats
URI system/sandbox/stats/
Action stats
object: usage
Summary Retrieve all objects that are currently using as well as objects that can use
the given object.
URI system/object/usage/
Action usage
Extra parameters
timezone: select
URI system/timezone/select/
Action select
vmlicense: upload
URI system/vmlicense/upload/
Action upload
Extra parameters
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
sensor-info: select
URI system/sensor-info/select/
Action select
audit: select
URI system/audit/select/
Action select
fortiguard-blacklist: select
URI system/fortiguard-blacklist/select/
Action select
Extra parameters
extender-controller
extender: select
URI extender-controller/extender/select/
Action select
Extra parameters
extender: reset
URI extender-controller/extender/reset/
Action reset
Extra parameters
user
firewall: select
URI user/firewall/select/
Action select
Extra parameters
firewall: deauth
URI user/firewall/deauth/
Action deauth
Extra parameters
user_type string User type [proxy|firewall]. Required for both proxy and firewall No
users.
id int User ID. Required for both proxy and firewall users. No
ip string User IP address. Required for both proxy and firewall users. No
all boolean Set to true to deauthenticate all users. Other parameters will No
be ignored.
banned: select
URI user/banned/select/
Action select
banned: clear_users
URI user/banned/clear_users/
Action clear_users
Extra parameters
ip_addresses array List of banned user IPs to clear. IPv4 and IPv6 addresses are Yes
allowed.
banned: add_users
URI user/banned/add_users/
Action add_users
Extra parameters
ip_addresses array List of IP Addresses to ban. IPv4 and IPv6 addresses are Yes
allowed.
banned: clear_all
URI user/banned/clear_all/
Action clear_all
fortitoken: select
URI user/fortitoken/select/
Action select
fortitoken: activate
URI user/fortitoken/activate/
Action activate
Extra parameters
device: select
URI user/device/select/
Action select
Extra parameters
fortilink_vis- boolean Add port and switch info for devices behind a managed No
ibility FortiSwitch.
intf_name string Filter: Name of interface where the device was detected. Only No
available when compliance_visibility is true.
fortitoken: refresh
URI user/fortitoken/refresh/
Action refresh
Extra parameters
fortitoken: provision
URI user/fortitoken/provision/
Action provision
Extra parameters
fortitoken: send-activation
URI user/fortitoken/send-activation/
Action send-activation
Extra parameters
sms_phone string User's SMS phone number (required if using 'sms' method). No
fsso: refresh-server
Summary Refresh remote agent group list for all fsso agents.
URI user/fsso/refresh-server/
Action refresh-server
fsso: select
URI user/fsso/select/
Action select
utm
rating-lookup: select
URI utm/rating-lookup/select/
Action select
Extra parameters
app-lookup: select
URI utm/app-lookup/select/
Action select
Extra parameters
application-categories: select
URI utm/application-categories/select/
Action select
antivirus: stats
URI utm/antivirus/stats/
Action stats
virtual-wan
health-check: select
URI virtual-wan/health-check/select/
Action select
webfilter
override: select
URI webfilter/override/select/
Action select
override: delete
URI webfilter/override/delete/
Action delete
Extra parameters
malicious-urls: select
URI webfilter/malicious-urls/select/
Action select
malicious-urls: stat
URI webfilter/malicious-urls/stat/
Action stat
category-quota: select
URI webfilter/category-quota/select/
Action select
Extra parameters
category-quota: reset
URI webfilter/category-quota/reset/
Action reset
Extra parameters
fortiguard-categories: select
URI webfilter/fortiguard-categories/select/
Action select
Extra parameters
trusted-urls: select
URI webfilter/trusted-urls/select/
Action select
vpn
ipsec: select
URI vpn/ipsec/select/
Action select
Extra parameters
ipsec: tunnel_up
URI vpn/ipsec/tunnel_up/
Action tunnel_up
Extra parameters
ipsec: tunnel_down
URI vpn/ipsec/tunnel_down/
Action tunnel_down
Extra parameters
ipsec: tunnel_reset_stats
URI vpn/ipsec/tunnel_reset_stats/
Action tunnel_reset_stats
Extra parameters
ssl: select
URI vpn/ssl/select/
Action select
ssl: clear_tunnel
URI vpn/ssl/clear_tunnel/
Action clear_tunnel
ssl: delete
URI vpn/ssl/delete/
Action delete
Extra parameters
ssl: stats
URI vpn/ssl/stats/
Action stats
wanopt
history: select
URI wanopt/history/select/
Action select
Extra parameters
history: reset
URI wanopt/history/reset/
Action reset
webcache: select
URI wanopt/webcache/select/
Action select
Extra parameters
webcache: reset
URI wanopt/webcache/reset/
Action reset
peer_stats: select
URI wanopt/peer_stats/select/
Action select
peer_stats: reset
URI wanopt/peer_stats/reset/
Action reset
webproxy
pacfile: download
URI webproxy/pacfile/download/
Action download
webcache
stats: select
URI webcache/stats/select/
Action select
Extra parameters
stats: reset
URI webcache/stats/reset/
Action reset
wifi
client: select
URI wifi/client/select/
Action select
Extra parameters
managed_ap: select
URI wifi/managed_ap/select/
Action select
Extra parameters
incl_local boolean Enable to include the local FortiWiFi device in the results. No
managed_ap: set_status
Summary Update administrative state for a given FortiAP (enable or disable author-
ization).
URI wifi/managed_ap/set_status/
Action set_status
Extra parameters
firmware: select
Summary Retrieve a list of current and recommended firmware for FortiAPs in use.
URI wifi/firmware/select/
Action select
Extra parameters
managed_ap: restart
URI wifi/managed_ap/restart/
Action restart
Extra parameters
managed_ap: upgrade
Summary Upgrade firmware image on the given FortiAP using uploaded file.
URI wifi/managed_ap/upgrade/
Action upgrade
Extra parameters
file_content string Provided when uploading a file: base64 encoded file data. No
Must not contain whitespace or other invalid base64 char-
acters. Must be included in HTTP body.
ap_status: select
URI wifi/ap_status/select/
Action select
interfering_ap: select
URI wifi/interfering_ap/select/
Action select
Extra parameters
euclid: select
URI wifi/euclid/select/
Action select
euclid: reset
URI wifi/euclid/reset/
Action reset
rogue_ap: select
URI wifi/rogue_ap/select/
Action select
Extra parameters
rogue_ap: clear_all
URI wifi/rogue_ap/clear_all/
Action clear_all
rogue_ap: set_status
URI wifi/rogue_ap/set_status/
Action set_status
Extra parameters
spectrum: select
URI wifi/spectrum/select/
Action select
Extra parameters
coverage
download: select
URI coverage/download/select/
Action select
Examples
POST /api/v2/monitor/ ?vdom=root {'policy': 1,} fwgrp.policy Reset traffic statistics for
firewall/policy6/ single IPv4 policy, vdom root
clear_counters
POST /api/v2/monitor/ ?vdom=root {'policy': [1, 2]} fwgrp.policy Reset traffic statistics for
firewall/policy6/ multiple IPv4 policies, vdom
clear_counters root
POST /api/v2/monitor/ ?vdom=root {'pro': "udp", 'saddr': sysgrp Immediately close specific
firewall/session/ "192.168.100.110", session matched with the
close 'daddr': "96.45.33. filter, vdom root
73", 'sport': 55933,
'dport': 8888}