The environment's protection policy.
GET
/api/v1/projects/{project}/environments/{environment}/policy
const url = 'https://example.com/api/v1/projects/example/environments/example/policy';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/projects/example/environments/example/policyParameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project
required
string
Project name
environment
required
string
Environment short name
Responses
Section titled “Responses”Media typeapplication/json
object
revision
required
0 when the environment has no policy of its own yet.
integer format: int64
requiredApprovals
required
integer format: int32
deployRole
required
string
approveRole
required
string
approvalTtlSecs
required
integer format: int32
scan
required
What vulnerability findings a deployment may carry.
object
mode
required
off, warn or block.
string
severity
required
Findings at or above this severity count: high or critical.
string
requireScan
An image without a fresh successful scan counts as a finding.
boolean
maxAgeSecs
A scan older than this no longer counts (1 hour – 90 days).
integer format: int32
updatedBy
string | null
updatedAt
integer | null format: int64
Example
{ "scan": { "mode": "block", "severity": "critical", "maxAgeSecs": 604800 }}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}