Skip to main content
aelkadi
Staff
Staff
May 6, 2026 4:14 PM UTC

Technical Tip: How to upload an OpenAPI file on FortiWeb using the REST API

Description


This article describes how to upload an OpenAPI File on FortiWeb using the REST API.


Scope


FortiWeb.


Solution


  1. Set Up Postman:

  • Open Postman and create a new request.

  • Select the POST method.

  1. Define API URL:

  1. Configure Request Body:

  • Use form-data to upload the OpenAPI file.

  • Key: file

  • Value: Select the exact OpenAPI file from the local machine.

  1. Send the Request:

  • Select Send to upload the file.


a4021d41.jpg


The result should look like this:


a4021d41.jpg


curl -k -X POST 'https://<fortiweb-ip>:<port>/api/v2.0/waf/openapi.openapischemafile' \ 
-H 'X-CSRFTOKEN: <csrf-token>' \ 
-H 'Origin: https://<fortiweb-ip>:<port>' \ 
-H 'Referer: https://<fortiweb-ip>:<port>/root/waf/openapi/schema-dialog' \ 
-H 'Cookie: <valid-session-cookie>' \ 
-F 'openapifile=@openapi.yaml' 


Follow the guide below to generate the CURL commands outlined above:

Technical Tip: How to use browsers to obtain curl commands for testing

    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