Skip to main content

Save New Policy

POST 

/code/api/v1/policies

deprecated

This endpoint has been deprecated and may be replaced or removed in future versions of the API.

Prisma Cloud Application Security supports policy-as-code capabilities using YAML-based policy definition files to enable attribute and connection checks (composite checks).

For information on defining YAML-based policies, see the Prisma Cloud documentation about the Code Editor and Custom Build Policy Examples. If you are upgraded to Darwin, see Code Editor and Custom Build Policy Examples.

To use the API request, add your token to the header. API supports both YAML and JSON configuration of Prisma Cloud Application Security custom policy schema.

This API creates a new Prisma Cloud Application Security custom policy.

The input will be a code-based policy definition file. The output will be a new policy id. In case of invalid code - output will include definition errors. Use the given examples as a reference for configuring the API request body for saving new policies.

info

Use the CSPM endpoint Add Policy in place of this endpoint.

Request

Body

required

    object

Responses

Save a new policy data

Response Headers
  • Access-Control-Allow-Headers string
  • Access-Control-Allow-Methods string
  • Access-Control-Allow-Origin string
Schema
    anyOf
    message stringrequired
Loading...