GET
/
v1
/
policies
/
{policy_name}
Get a policy by name
curl --request GET \
  --url https://api.app.chainloop.dev/v1/policies/{policy_name} \
  --header 'Authorization: Bearer <token>'
{
  "version_references": [
    {
      "digest": "digest",
      "created_at": "2000-01-23T04:56:07.000Z"
    },
    {
      "digest": "digest",
      "created_at": "2000-01-23T04:56:07.000Z"
    }
  ],
  "inputs_json_schema": "inputs_json_schema",
  "data": {
    "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"
    }
  },
  "builtin": true,
  "organization_id": "organization_id",
  "digest": "digest",
  "raw": {
    "format": "FORMAT_UNSPECIFIED",
    "body": "body"
  },
  "organization_name": "organization_name",
  "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"
    }
  },
  "latest": true
}

Authorizations

Authorization
string
header
required

Bearer token for authentication

Path Parameters

policy_name
string
required

The name of the policy to retrieve

Query Parameters

digest
string

if set, it will return the policy with the given digest otherwise it will return the latest version

If set, returns the policy with the given digest; otherwise returns the latest version

organization_name
string

Organization owning this policy (empty for best effort fallback)

Organization owning this policy (empty for best effort fallback)

Response

A successful response.

Response containing a policy and its metadata

data
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"
}
}
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"
}
}
digest
string

The digest of the policy

raw
object
Example:
{
"format": "FORMAT_UNSPECIFIED",
"body": "body"
}
latest
boolean

Whether this is the latest version of the policy

builtin
boolean

Whether this policy is builtin or custom

organization_id
string

ID of the organization owning this policy (empty for builtin policies)

organization_name
string

Name of the organization owning this policy

version_references
PolicyVersionReference represents the reference to a policy version · object[]

References to all versions of this policy

inputs_json_schema
string

JSON schema of the inputs required by the policy