PUT
/
v1
/
policies
Update an existing policy
curl --request PUT \
  --url https://api.app.chainloop.dev/v1/policies \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "policy": {
    "metadata": {
      "name": "name",
      "description": "description",
      "annotations": {
        "key": "annotations"
      },
      "display_name": "display_name"
    },
    "kind": "kind",
    "api_version": "api_version",
    "spec": {
      "path": "path",
      "auto_match": {
        "path": "path",
        "embedded": "embedded"
      },
      "inputs": [
        {
          "default": "default",
          "name": "name",
          "description": "description",
          "required": true
        },
        {
          "default": "default",
          "name": "name",
          "description": "description",
          "required": true
        }
      ],
      "policies": [
        {
          "path": "path",
          "kind": "kind",
          "embedded": "embedded"
        },
        {
          "path": "path",
          "kind": "kind",
          "embedded": "embedded"
        }
      ],
      "type": "type",
      "embedded": "embedded"
    }
  },
  "raw_schema": "<string>"
}'
{}

Authorizations

Authorization
string
header
required

Bearer token for authentication

Body

application/json

Request to update an existing policy

policy
object

A policy that can be applied to materials in Chainloop to validate compliance with specific requirements

Example:
{
"metadata": {
"name": "name",
"description": "description",
"annotations": { "key": "annotations" },
"display_name": "display_name"
},
"kind": "kind",
"api_version": "api_version",
"spec": {
"path": "path",
"auto_match": { "path": "path", "embedded": "embedded" },
"inputs": [
{
"default": "default",
"name": "name",
"description": "description",
"required": true
},
{
"default": "default",
"name": "name",
"description": "description",
"required": true
}
],
"policies": [
{
"path": "path",
"kind": "kind",
"embedded": "embedded"
},
{
"path": "path",
"kind": "kind",
"embedded": "embedded"
}
],
"type": "type",
"embedded": "embedded"
}
}
raw_schema
string

Base64 raw representation of the policy schema in JSON, YAML, or CUE format

Response

A successful response.

Response for the policy update request