Skip to main content
shafiq23
Staff & Editor
Staff & Editor
March 27, 2026

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

  • March 27, 2026
  • 0 replies
  • 153 views
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