Forum Discussion
F5 AWAF/ASM Fails to update OpenAPI file through REST-API
- Dec 03, 2025
I use this paylod for the POST request to /mgmt/tm/asm/tasks/import-open-api
$swagger_file is the previous uploaded swagger file
$waf_policy is /mgmt/tm/asm/policies/<policy hash>
{ apiType: "swagger", filename: $swagger_file, policyReference: { link: $waf_policy } }
Hi Nik,
the policy hash can be simply calculated locally: https://my.f5.com/manage/s/article/K40414407
printf "%s" "$POLICY" | openssl dgst -md5 -binary | base64 | cut -c-22 | sed 'y/+\//-_/'
You can let the F5 fetch the OpenAPI file from a webserver, but I personally prefer also uploading the OpenAPI file.
When F5 calls it ID and not a hash adds confusion. Outside of that this is helpful still I need to check it as I wanted to run things with a k8s job and I may need to create a container that has curl + openssl will see if busybox can do it.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com