Skip to main content
yitoo_FTNT
Staff
Staff
May 1, 2026

Technical Tip: How to upload and assign a certificate to a policy using the REST API

  • May 1, 2026
  • 0 replies
  • 34 views

Description


This article describes how to assign an uploaded certificate to a policy using the API.


Scope


FortiWeb and FortiWeb VM.

Solution


Upload the certificate by following the steps outlined in Technical Tip: How to upload the local certificate to FortiWeb using the REST API.


c9eef8af.jpg


Apply it to the Policy using the REST API.


Use the following curl command:


curl --location --request PUT 'https://10.109.19.90/api/v2.0/cmdb/server-policy/policy?mkey=api-certificate' \
--header 'Authorization: xxx' \
--header 'Content-Type: application/json' \
--data '{"data":{"certificate":"server"}}'


eff483bf.jpg


In the above, mkey is the parameter, and api-certificate is the policy name.