> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# policies

> sift/policies/v1/policies.proto

<a name="sift_policies_v1_policies-proto" />

<a name="sift_policies_v1_policies-proto-services" />

## Services

*RPC methods exposed by this API.*

### PolicyService

| Method          | Request                                           | Response                                            | Description                                 |
| :-------------- | :------------------------------------------------ | :-------------------------------------------------- | :------------------------------------------ |
| GetPolicy       | [GetPolicyRequest](#getpolicyrequest)             | [GetPolicyResponse](#getpolicyresponse)             | Retrieve a policy                           |
| ListPolicies    | [ListPoliciesRequest](#listpoliciesrequest)       | [ListPoliciesResponse](#listpoliciesresponse)       | Retrieve policies using an optional filter. |
| CreatePolicy    | [CreatePolicyRequest](#createpolicyrequest)       | [CreatePolicyResponse](#createpolicyresponse)       | Create a policy                             |
| UpdatePolicy    | [UpdatePolicyRequest](#updatepolicyrequest)       | [UpdatePolicyResponse](#updatepolicyresponse)       | Update a policy                             |
| ValidatePolicy  | [ValidatePolicyRequest](#validatepolicyrequest)   | [ValidatePolicyResponse](#validatepolicyresponse)   | Validate a Cedar policy configuration       |
| ArchivePolicy   | [ArchivePolicyRequest](#archivepolicyrequest)     | [ArchivePolicyResponse](#archivepolicyresponse)     | Archive a policy                            |
| UnarchivePolicy | [UnarchivePolicyRequest](#unarchivepolicyrequest) | [UnarchivePolicyResponse](#unarchivepolicyresponse) | Unarchive a policy                          |

<a name="sift_policies_v1_policies-proto-messages" />

## Messages

*Data models used across requests/responses.*

### ArchivePolicyRequest

The request for a call to `PolicyService_ArchivePolicy` to archive a policy.

| Field      | Type   | Label | Description |
| :--------- | :----- | :---- | :---------- |
| policy\_id | string |       |             |

### ArchivePolicyResponse

The response of a call to `PolicyService_ArchivePolicy`.

| Field  | Type              | Label | Description |
| :----- | :---------------- | :---- | :---------- |
| policy | [Policy](#policy) |       |             |

### CreatePolicyRequest

The request for a call to `PolicyService_CreatePolicy` to create a new policy.

| Field          | Type                                        | Label    | Description                     |
| :------------- | :------------------------------------------ | :------- | :------------------------------ |
| name           | string                                      |          |                                 |
| description    | string                                      | optional |                                 |
| configuration  | [PolicyConfiguration](#policyconfiguration) |          | Policy rules/configuration      |
| version\_notes | string                                      | optional | Optional notes for this version |

### CreatePolicyResponse

The response of a call to `PolicyService_CreatePolicy`.

| Field  | Type              | Label | Description |
| :----- | :---------------- | :---- | :---------- |
| policy | [Policy](#policy) |       |             |

### GetPolicyRequest

The request for a call to `PolicyService_GetPolicy`.

| Field      | Type   | Label | Description |
| :--------- | :----- | :---- | :---------- |
| policy\_id | string |       |             |

### GetPolicyResponse

The response of a call to `PolicyService_GetPolicy`.

| Field  | Type              | Label | Description |
| :----- | :---------------- | :---- | :---------- |
| policy | [Policy](#policy) |       |             |

### ListPoliciesRequest

The request for a call to `PolicyService_ListPolicies` to retrieve policies.

| Field             | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| :---------------- | :----- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| page\_size        | uint32 |       | The 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\_token       | string |       | A 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.                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| filter            | string |       | A [Common Expression Language (CEL)](https://github.com/google/cel-spec) 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](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/policies#policy). Optional. |
| order\_by         | string |       | How 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](https://google.aip.dev/132#ordering) Example: "created\_date desc,modified\_date"                                                                                                                                                                                                                                             |
| include\_archived | bool   |       | Whether to include archived policies in the response. If false or unset, archived policies are excluded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

### ListPoliciesResponse

The result of a call to `PolicyService_ListPolicies`.

| Field             | Type              | Label    | Description |
| :---------------- | :---------------- | :------- | :---------- |
| policies          | [Policy](#policy) | repeated |             |
| next\_page\_token | string            |          |             |

### Policy

| Field                      | Type                                        | Label    | Description                                    |
| :------------------------- | :------------------------------------------ | :------- | :--------------------------------------------- |
| policy\_id                 | string                                      |          |                                                |
| name                       | string                                      |          |                                                |
| description                | string                                      | optional |                                                |
| organization\_id           | string                                      |          |                                                |
| created\_by\_user\_id      | string                                      |          |                                                |
| modified\_by\_user\_id     | string                                      |          |                                                |
| created\_date              | google.protobuf.Timestamp                   |          |                                                |
| modified\_date             | google.protobuf.Timestamp                   |          |                                                |
| configuration              | [PolicyConfiguration](#policyconfiguration) |          | Policy rules/configuration                     |
| policy\_version\_id        | string                                      |          | Reference to the current policy version ID     |
| archived\_date             | google.protobuf.Timestamp                   |          | The date the policy was archived.              |
| is\_archived               | bool                                        |          |                                                |
| version                    | int32                                       | optional | Optional version number for this policy        |
| version\_notes             | string                                      | optional | Optional notes for this version                |
| generated\_change\_message | string                                      | optional | Auto-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](https://docs.cedarpolicy.com/policies/syntax-policy.html)

| Field         | Type   | Label | Description |
| :------------ | :----- | :---- | :---------- |
| cedar\_policy | string |       |             |

### UnarchivePolicyRequest

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

| Field      | Type   | Label | Description |
| :--------- | :----- | :---- | :---------- |
| policy\_id | string |       |             |

### UnarchivePolicyResponse

The response of a call to `PolicyService_UnarchivePolicy`.

| Field  | Type              | Label | Description |
| :----- | :---------------- | :---- | :---------- |
| policy | [Policy](#policy) |       |             |

### UpdatePolicyRequest

The request for a call to `PolicyService_UpdatePolicy` to update a policy.

| Field          | Type                                                    | Label    | Description                                                                                                                         |
| :------------- | :------------------------------------------------------ | :------- | :---------------------------------------------------------------------------------------------------------------------------------- |
| policy         | [Policy](#policy)                                       |          |                                                                                                                                     |
| update\_mask   | [google.protobuf.FieldMask](#google-protobuf-fieldmask) |          | The list of fields to be updated. The fields available to be updated are `name`, `description`, `configuration`, and `is_archived`. |
| version\_notes | string                                                  | optional | Optional notes for the new policy version when configuration changes                                                                |

### UpdatePolicyResponse

The response of a call to `PolicyService_UpdatePolicy`.

| Field  | Type              | Label | Description |
| :----- | :---------------- | :---- | :---------- |
| policy | [Policy](#policy) |       |             |

### ValidatePolicyRequest

The request for a call to `PolicyService_ValidatePolicy`.

| Field         | Type   | Label | Description |
| :------------ | :----- | :---- | :---------- |
| cedar\_policy | string |       |             |

### ValidatePolicyResponse

The response of a call to `PolicyService_ValidatePolicy`.

| Field            | Type   | Label    | Description |
| :--------------- | :----- | :------- | :---------- |
| valid            | bool   |          |             |
| failure\_message | string | optional |             |

<a name="sift_policies_v1_policies-proto-enums" />

## Enums

*Allowed constant values used in message fields.*
