Skip to main content
shafiq23
Staff & Editor
Staff & Editor
Mar 27, 2026 10:12 AM UTC

Technical Tip: How to update server policy certificate via REST API

Description This article describes how to update the server policy certificate via the REST API. In the demonstration, curl is used to send an API call and update.
Scope FortiWeb.
Solution

REST API can be used to automate certificate updates in FortiWeb. This will help administrators save time for bulk certificate updates in FortiWeb.

 

  1. Request Method: GET/PUT.
  2. Host header.
  3. Authorization header.

Encode the string with BASE64 and use it as an Authorization token.

 

{“username”:”admin”,”password”:“a”,”vdom”:”root”}

 

  1. Content-Type: application/json header.

 

List the target server policy:


GET /api/v2.0/cmdb/server-policy/policy?mkey=DVWA

 

Note: 'DVWA' is the server policy name.

 

Sample request:


curl --location 'https://<FWB_Host>/api/v2.0/cmdb/server-policy/policy?mkey=DVWA \
--header 'Authorization: <BASE64-token>'

 

Sample response:


{
"results": {
"can_view": 0,
"q_ref": 0,
"can_clone": 1,
"q_type": 1,
"name": "DVWA",
"deployment-mode": "server-pool",
"deployment-mode_val": "4",
"protocol": "HTTP",
"protocol_val": "0",
"ssl": "enable",
"ssl_val": "1",
"implicit_ssl": "disable",
"implicit_ssl_val": "0",
"vserver": "DVWA_VS",
"vserver_val": "3174",
"v-zone": "",
"v-zone_val": "0",
"certificate": "",
"certificate-group": "",
"intermediate-certificate-group": "",
}
]
}

 

Update the server policy certificate.


PUT /api/v2.0/cmdb/server-policy/policy?mkey=DVWA

 

Sample request.


curl --location --request PUT 'https://<FWB_Host>/api/v2.0/cmdb/server-policy/policy?mkey=DVWA' \
--header 'Authorization: <BASE64-token>' \
--header 'Content-Type: application/json' \
--data '{"data":{"certificate":"ex-cert"}}'

Note: ‘ex-cert’ is the local certificate name.

 

Sample response.


{
"results": {
"can_view": 0,
"q_ref": 0,
"can_clone": 1,
"q_type": 1,
"name": "DVWA",
"deployment-mode": "server-pool",
"deployment-mode_val": "4",
"protocol": "HTTP",
"protocol_val": "0",
"ssl": "enable",
"ssl_val": "1",
"implicit_ssl": "disable",
"implicit_ssl_val": "0",
"vserver": "DVWA_VS",
"vserver_val": "3174",
"v-zone": "",
"v-zone_val": "0",
"certificate": "ex-cert",
"certificate-group": "",
"intermediate-certificate-group": "",
}
]
}

 

Related documents:
FortiWeb REST API reference
Technical Tip: How to upload the local certificate to FortiWeb using the REST API

    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