Skip to main content
aelkadi
Staff
Staff
May 6, 2026

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

  • May 6, 2026
  • 0 replies
  • 35 views

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