Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Policy Set

Policy sets, attachments and exemptions drive Policy Governance. They are JSON:API resources under an organization and are also available through the GraphQL endpoint. Creating or changing them requires the Manage Policies team permission.

Policy set (policy_set)

Path
Type
Description

data.attributes.name

string

Unique name within the organization

data.attributes.description

string

OPTIONAL

data.attributes.enforcementLevel

string

hard_mandatory, soft_mandatory or advisory

data.attributes.shadowEnforcementLevel

string

OPTIONAL. Counted and shown, never blocks

data.attributes.overrideTeam

string

Team allowed to override soft_mandatory violations

data.attributes.global

boolean

Apply to every workspace in the organization

data.attributes.repository / branch / folder

string

Git location of the Rego

data.attributes.opaVersion

string

OPTIONAL OPA version

data.relationships.vcs

object

VCS connection used to clone the repository

Policy attachment (policy_attachment)

Attaches a non-global policy set to exactly one of workspace, project or tag (relationships), plus policySet.

Policy exemption (policy_exemption)

Path
Type
Description

data.attributes.ruleId

string

Rule to waive

data.attributes.ticketReference

string

Reference for the audit trail

data.attributes.justification

string

Why the rule is waived

data.attributes.expiresAt

date

OPTIONAL expiry

data.relationships.policySet

object

Policy set the rule belongs to

data.relationships.workspace / project

object

OPTIONAL scope; omit both for an organization-wide exemption

Overrides of soft_mandatory violations are made from the run page. A run's evaluation results are available as policy_evaluation records.

Supported Operations

get

Returns the collection of type policy_set

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
filter[policy_set]stringOptional

Filters the collection of policy_set using a 'disjoint' RSQL expression

filterstringOptional

Filters the collection of policy_set using a 'joined' RSQL expression

page[number]integer · int32Optional

Number of pages to return. Can be used with page[size]

page[size]integer · int32Optional

Number of elements per page. Can be used with page[number]

page[offset]integer · int32Optional

Offset from 0 to start paginating. Can be used with page[limit]

page[limit]integer · int32Optional

Maximum number of items to return. Can be used with page[offset]

page[totals]stringOptional

For requesting total pages/records be included in the response page meta data

Responses
200

Successful response

application/vnd.api+json
get/policy_set
GET /api/v1/policy_set HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful response

{
  "data": [
    {
      "type": "text",
      "id": "text",
      "attributes": {
        "branch": null,
        "createdBy": null,
        "createdDate": null,
        "description": null,
        "enforcementLevel": null,
        "folder": null,
        "global": null,
        "name": null,
        "opaVersion": null,
        "overrideTeam": null,
        "repository": null,
        "shadowEnforcementLevel": null,
        "updatedBy": null,
        "updatedDate": null
      },
      "relationships": {
        "attachments": {
          "data": [
            null
          ]
        },
        "exemptions": {
          "data": [
            null
          ]
        },
        "notificationConfiguration": {
          "data": [
            null
          ]
        },
        "organization": {
          "data": [
            null
          ]
        },
        "parameters": {
          "data": [
            null
          ]
        },
        "vcs": {
          "data": [
            null
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
post

Creates an item of type policy_set

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
Responses
201

Successful response

application/vnd.api+json
post/policy_set
POST /api/v1/policy_set HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 585

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": null,
      "createdBy": null,
      "createdDate": null,
      "description": null,
      "enforcementLevel": null,
      "folder": null,
      "global": null,
      "name": null,
      "opaVersion": null,
      "overrideTeam": null,
      "repository": null,
      "shadowEnforcementLevel": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "attachments": {
        "data": [
          null
        ]
      },
      "exemptions": {
        "data": [
          null
        ]
      },
      "notificationConfiguration": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "parameters": {
        "data": [
          null
        ]
      },
      "vcs": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
201

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": null,
      "createdBy": null,
      "createdDate": null,
      "description": null,
      "enforcementLevel": null,
      "folder": null,
      "global": null,
      "name": null,
      "opaVersion": null,
      "overrideTeam": null,
      "repository": null,
      "shadowEnforcementLevel": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "attachments": {
        "data": [
          null
        ]
      },
      "exemptions": {
        "data": [
          null
        ]
      },
      "notificationConfiguration": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "parameters": {
        "data": [
          null
        ]
      },
      "vcs": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
get

Returns an instance of type policy_set

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
policy_setIdstringRequired

policy_set Identifier

Query parameters
Responses
200

Successful response

application/vnd.api+json
get/policy_set/{policy_setId}
GET /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": null,
      "createdBy": null,
      "createdDate": null,
      "description": null,
      "enforcementLevel": null,
      "folder": null,
      "global": null,
      "name": null,
      "opaVersion": null,
      "overrideTeam": null,
      "repository": null,
      "shadowEnforcementLevel": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "attachments": {
        "data": [
          null
        ]
      },
      "exemptions": {
        "data": [
          null
        ]
      },
      "notificationConfiguration": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "parameters": {
        "data": [
          null
        ]
      },
      "vcs": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
patch

Modifies an instance of type policy_set

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
policy_setIdstringRequired

policy_set Identifier

Body
Responses
204

Successful response

No content

patch/policy_set/{policy_setId}
PATCH /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 585

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "branch": null,
      "createdBy": null,
      "createdDate": null,
      "description": null,
      "enforcementLevel": null,
      "folder": null,
      "global": null,
      "name": null,
      "opaVersion": null,
      "overrideTeam": null,
      "repository": null,
      "shadowEnforcementLevel": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "attachments": {
        "data": [
          null
        ]
      },
      "exemptions": {
        "data": [
          null
        ]
      },
      "notificationConfiguration": {
        "data": [
          null
        ]
      },
      "organization": {
        "data": [
          null
        ]
      },
      "parameters": {
        "data": [
          null
        ]
      },
      "vcs": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
204

Successful response

No content

delete

Deletes an instance of type policy_set

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
policy_setIdstringRequired

policy_set Identifier

Responses
204

Successful response

No content

delete/policy_set/{policy_setId}
DELETE /api/v1/policy_set/{policy_setId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
204

Successful response

No content

Last updated

Was this helpful?