Skip to main content

Services

RPC methods exposed by this API.

PolicyService

MethodRequestResponseDescription
GetPolicyGetPolicyRequestGetPolicyResponseRetrieve a policy
ListPoliciesListPoliciesRequestListPoliciesResponseRetrieve policies using an optional filter.
CreatePolicyCreatePolicyRequestCreatePolicyResponseCreate a policy
UpdatePolicyUpdatePolicyRequestUpdatePolicyResponseUpdate a policy
ValidatePolicyValidatePolicyRequestValidatePolicyResponseValidate a Cedar policy configuration
ArchivePolicyArchivePolicyRequestArchivePolicyResponseArchive a policy
UnarchivePolicyUnarchivePolicyRequestUnarchivePolicyResponseUnarchive a policy

Messages

Data models used across requests/responses.

ArchivePolicyRequest

The request for a call to PolicyService_ArchivePolicy to archive a policy.
FieldTypeLabelDescription
policy_idstring

ArchivePolicyResponse

The response of a call to PolicyService_ArchivePolicy.
FieldTypeLabelDescription
policyPolicy

CreatePolicyRequest

The request for a call to PolicyService_CreatePolicy to create a new policy.
FieldTypeLabelDescription
namestring
descriptionstringoptional
configurationPolicyConfigurationPolicy rules/configuration
version_notesstringoptionalOptional notes for this version

CreatePolicyResponse

The response of a call to PolicyService_CreatePolicy.
FieldTypeLabelDescription
policyPolicy

GetPolicyRequest

The request for a call to PolicyService_GetPolicy.
FieldTypeLabelDescription
policy_idstring

GetPolicyResponse

The response of a call to PolicyService_GetPolicy.
FieldTypeLabelDescription
policyPolicy

ListPoliciesRequest

The request for a call to PolicyService_ListPolicies to retrieve policies.
FieldTypeLabelDescription
page_sizeuint32The maximum number of policies to return. The service may return fewer than this value. If unspecified, at most 50 policies will be returned. The maximum value is 100; values above 100 will be coerced to 100. Optional.
page_tokenstringA page token, received from a previous ListPolicies call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListPolicies must match the call that provided the page token. Optional.
filterstringA Common Expression Language (CEL) filter string. Available fields to filter by are policy_id, organization_id, name, description, created_by_user_id, modified_by_user_id, created_date, and modified_date. Archive state is controlled via the include_archived field below, not via filter. For further information about how to use CELs, please refer to this guide. For more information about the fields used for filtering, please refer to this definition. Optional.
order_bystringHow to order the retrieved policies. Formatted as a comma-separated string i.e. “FIELD_NAME[ desc],…”. Available fields to order_by are created_date, modified_date, and name. If left empty, items are ordered by created_date in descending order (newest-first). For more information about the format of this field, read this Example: “created_date desc,modified_date”
include_archivedboolWhether to include archived policies in the response. If false or unset, archived policies are excluded.

ListPoliciesResponse

The result of a call to PolicyService_ListPolicies.
FieldTypeLabelDescription
policiesPolicyrepeated
next_page_tokenstring

Policy

FieldTypeLabelDescription
policy_idstring
namestring
descriptionstringoptional
organization_idstring
created_by_user_idstring
modified_by_user_idstring
created_dategoogle.protobuf.Timestamp
modified_dategoogle.protobuf.Timestamp
configurationPolicyConfigurationPolicy rules/configuration
policy_version_idstringReference to the current policy version ID
archived_dategoogle.protobuf.TimestampThe date the policy was archived.
is_archivedbool
versionint32optionalOptional version number for this policy
version_notesstringoptionalOptional notes for this version
generated_change_messagestringoptionalAuto-generated change message for this version

PolicyConfiguration

PolicyConfiguration represents the configuration and rules for a policy. Expects a string containing a policy in the Cedar format https://docs.cedarpolicy.com/policies/syntax-policy.html
FieldTypeLabelDescription
cedar_policystring

UnarchivePolicyRequest

The request for a call to PolicyService_UnarchivePolicy to unarchive a previously-archived policy.
FieldTypeLabelDescription
policy_idstring

UnarchivePolicyResponse

The response of a call to PolicyService_UnarchivePolicy.
FieldTypeLabelDescription
policyPolicy

UpdatePolicyRequest

The request for a call to PolicyService_UpdatePolicy to update a policy.
FieldTypeLabelDescription
policyPolicy
update_maskgoogle.protobuf.FieldMaskThe list of fields to be updated. The fields available to be updated are name, description, configuration, and is_archived.
version_notesstringoptionalOptional notes for the new policy version when configuration changes

UpdatePolicyResponse

The response of a call to PolicyService_UpdatePolicy.
FieldTypeLabelDescription
policyPolicy

ValidatePolicyRequest

The request for a call to PolicyService_ValidatePolicy.
FieldTypeLabelDescription
cedar_policystring

ValidatePolicyResponse

The response of a call to PolicyService_ValidatePolicy.
FieldTypeLabelDescription
validbool
failure_messagestringoptional

Enums

Allowed constant values used in message fields.