Skip to main content

Delete a policy with the REST API

To delete a policy and assign the default policy to affected applications, send the following request:

Before you begin​

To authenticate with Veracode, ensure you have set up API authentication for HMAC or OAuth 2.0.

Delete a policy​

Veracode HMAC authentication​

http --auth-type=veracode_hmac DELETE """https://api.veracode.com/appsec/v1/policies/{policyGuid}?replacement_GUID={replacement_GUID}"""

OAuth 2.0 Client Credentials authentication​

http --auth-type=oauth2-client-credentials-flow `
--auth="$($env:VERACODE_CLIENT_ID):$($env:VERACODE_CLIENT_SECRET)" `
--token-endpoint="$($env:VERACODE_TOKEN_URL)" `
--token-request-type=basic DELETE """https://api.veracode.com/appsec/v1/policies/{policyGuid}?replacement_GUID={replacement_GUID}"""

Delete a policy and assign the default policy​

To delete a policy and assign the default policy to affected applications, send the following request:

Veracode HMAC authentication​

http --auth-type=veracode_hmac DELETE """https://api.veracode.com/appsec/v1/policies/{policyGuid}?replace_with_default_policy=true"""

OAuth 2.0 Client Credentials authentication​

http --auth-type=oauth2-client-credentials-flow `
--auth="$($env:VERACODE_CLIENT_ID):$($env:VERACODE_CLIENT_SECRET)" `
--token-endpoint="$($env:VERACODE_TOKEN_URL)" `
--token-request-type=basic DELETE """https://api.veracode.com/appsec/v1/policies/{policyGuid}?replace_with_default_policy=true"""