Policy Exceptions
List Policy Exceptions
/api/orgs/{orgName}/policy/exceptionsLists the organization’s policy exceptions, most recently created first. By default only active exceptions are returned; pass status to choose others. Results are paginated; use continuationToken and maxResults to page through them. Returns 400 for an unknown status, a stack that isn’t <project>/<stack>, policy combined with stack, or an invalid continuation token.
Request Parameters
orgNamestring path requiredThe organization namecontinuationTokenstring query optionalToken from a previous response to fetch the next page of exceptionsmaxResultsinteger query optionalMaximum number of exceptions to return per page (default and max 500)policystring query optionalOnly return exceptions that name this policypolicyPackstring query optionalOnly return exceptions for this policy packstackstring query optionalOnly return exceptions with a resource on this stack, as<project>/<stack>. Can’t be combined withpolicy.statusarray query optionalOnly return exceptions with one of these statuses (default: active)
Responses
- The policy exceptions, most recently created first.
- ↳
idstring requiredThe exception ID, unique within the organization, for exampleEXC-42. - ↳
policyPackstring requiredThe name of the policy pack the exception applies to. - The exception’s entries.
- ↳
reasonstring requiredThe justification for the exception. - ↳
statusenum requiredThe exception’s lifecycle status.Values:active,removed - ↳
expiresAtstring optionalWhen the exception expires, after which it’s removed. Null if it never expires. - ↳
changeRequestIdstring optionalThe change request that approved the exception, if creating it required approval. - The user who created the exception, if the user still exists.
- ↳
createdAtstring requiredWhen the exception was created. - The user who removed the exception, if the user still exists.
- ↳
removedAtstring optionalWhen the exception was removed. Null while it is active. continuationTokenstring optionalPass ascontinuationTokento fetch the next page. Null once all exceptions have been returned.
Create Policy Exception
/api/orgs/{orgName}/policy/exceptionsCreates an active policy exception and returns it with its ID (EXC-<n>). Returns 400 when the request breaks a field’s limits or the policy pack isn’t in one of the organization’s policy groups, 403 when the organization has disabled policy exceptions, and 409 when it requires approval to create them.
Request Parameters
orgNamestring path requiredThe organization name
Request Body
policyPackstring requiredThe name of the policy pack the exception applies to.- The exception’s entries: between 1 and 100.
reasonstring requiredThe justification for the exception: up to 2048 characters, not blank.expiresInSecondsinteger optionalSeconds until the exception expires, counted from when it’s created: a whole number of hours, between 1 hour and 3650 days. Omit for an exception that never expires.
Responses
idstring requiredThe exception ID, unique within the organization, for exampleEXC-42.policyPackstring requiredThe name of the policy pack the exception applies to.- The exception’s entries.
- ↳
policiesarray[string] requiredThe names of policies within the policy pack: between 1 and 100 non-blank names. - ↳
targetsarray[string] requiredThe URNs of the resources the violations are reported against: between 1 and 100 URNs of at most 2048 characters each. reasonstring requiredThe justification for the exception.statusenum requiredThe exception’s lifecycle status.Values:active,removedexpiresAtstring optionalWhen the exception expires, after which it’s removed. Null if it never expires.changeRequestIdstring optionalThe change request that approved the exception, if creating it required approval.- The user who created the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. createdAtstring requiredWhen the exception was created.- The user who removed the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. removedAtstring optionalWhen the exception was removed. Null while it is active.
Get Policy Exception
/api/orgs/{orgName}/policy/exceptions/{exceptionId}Returns a policy exception by ID, active or removed.
Request Parameters
orgNamestring path requiredThe organization nameexceptionIdstring path requiredThe exception ID, for exampleEXC-42
Responses
idstring requiredThe exception ID, unique within the organization, for exampleEXC-42.policyPackstring requiredThe name of the policy pack the exception applies to.- The exception’s entries.
- ↳
policiesarray[string] requiredThe names of policies within the policy pack: between 1 and 100 non-blank names. - ↳
targetsarray[string] requiredThe URNs of the resources the violations are reported against: between 1 and 100 URNs of at most 2048 characters each. reasonstring requiredThe justification for the exception.statusenum requiredThe exception’s lifecycle status.Values:active,removedexpiresAtstring optionalWhen the exception expires, after which it’s removed. Null if it never expires.changeRequestIdstring optionalThe change request that approved the exception, if creating it required approval.- The user who created the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. createdAtstring requiredWhen the exception was created.- The user who removed the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. removedAtstring optionalWhen the exception was removed. Null while it is active.
Remove Policy Exception
/api/orgs/{orgName}/policy/exceptions/{exceptionId}Marks an active policy exception removed and returns it. Returns 409 when the exception was already removed.
Request Parameters
orgNamestring path requiredThe organization nameexceptionIdstring path requiredThe exception ID, for exampleEXC-42
Responses
idstring requiredThe exception ID, unique within the organization, for exampleEXC-42.policyPackstring requiredThe name of the policy pack the exception applies to.- The exception’s entries.
- ↳
policiesarray[string] requiredThe names of policies within the policy pack: between 1 and 100 non-blank names. - ↳
targetsarray[string] requiredThe URNs of the resources the violations are reported against: between 1 and 100 URNs of at most 2048 characters each. reasonstring requiredThe justification for the exception.statusenum requiredThe exception’s lifecycle status.Values:active,removedexpiresAtstring optionalWhen the exception expires, after which it’s removed. Null if it never expires.changeRequestIdstring optionalThe change request that approved the exception, if creating it required approval.- The user who created the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. createdAtstring requiredWhen the exception was created.- The user who removed the exception, if the user still exists.
- ↳
namestring requiredThe user’s display name. - ↳
githubLoginstring requiredThe user’s login name. - ↳
avatarUrlstring requiredThe URL of the user’s avatar image. - ↳
emailstring optionalThe user’s email address. It is only populated on selected endpoints and is omitted from most responses. Treat it as sensitive information. removedAtstring optionalWhen the exception was removed. Null while it is active.