Save New Policy
POST/code/api/v1/policies
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.
Use the CSPM endpoint Add Policy in place of this endpoint.
Request
- application/json
Body
required
object
Responses
- 200
- 202
- 400
- 403
- 422
- 500
Save a new policy data
Response Headers
Access-Control-Allow-Headers string
Access-Control-Allow-Methods string
Access-Control-Allow-Origin string
- application/json
- Schema
- Example (from schema)
Schema
- ErrorMessage
- PolicyRes
{}
Operation Accepted
Response Headers
Access-Control-Allow-Headers string
Access-Control-Allow-Methods string
Access-Control-Allow-Origin string
Policy Validation Error
Payment required
Request arguments validation error
Failed to create new policy