FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
Kush_Patel
Staff
Staff
Article Id 417350
Description

This article describes the steps to resolve the '405 Method Not Allowed' error when using the API to generate a system backup on FortiGate. The error occurs when the API request is made using the GET method, which is no longer supported in newer FortiGate versions for the '/api/v2/monitor/system/config/backup' API call

Scope FortiGate 7.4.0+ and 7.6.0+
Solution

On occasion,  changes to specific API calls are made in newer versions of FortiOS. Technical details regarding each REST API call on different FortiOS versions are found on the FortiNet Devellopper Network, which requires authorization to access. The '405 Method Not Allowed' error indicates that the HTTP method used is not supported by the specific API call in question. 

 

Starting from FortiOS 7.6.0, the '/api/v2/monitor/system/config/backup' API call was updated to use the POST method instead of GET.

 

Modify the API request to use the POST method instead .

 

POST https://<FortiGate_IP>/api/v2/monitor/system/config/backup?scope=global

Example using curl:


curl -k -X POST "https://<FortiGate_IP>/api/v2/monitor/system/config/backup?scope=global" \
-H "Authorization: Bearer <API_TOKEN>" \
-o backup.conf

 

Verification:

 

  1. Ensure the API administrator account has the 'super_admin' profile.
    2. Confirm API access is enabled and reachable.
    3. Execute the POST request and verify that a configuration backup file is returned.
    4. Check logs under 'Log & Report → System Events' if the issue persists.

 

Additional Information:

  • This change affects only the '/system/config/backup' monitor API. Other monitor or configuration API calls may continue using their existing methods.
  • For version-specific API documentation, refer to the 'Fortinet Developer Network (FNDN)'.
  • Customers using automated API scripts should review API changes after firmware upgrades to avoid compatibility issues.