---
title: "POST /v1/policies"
method: POST
path: "/v1/policies"
tags: ["policies"]
---

# POST /v1/policies

`POST /v1/policies`

Create a policy.

## Request body

- Policy — A Policy resource binds an instance of a single Setting with the scope of a PolicyQuery. The Setting instance will be applied to all entities that satisfy the query.
  - `name` string — Output only. Identifier. The [resource name](https://cloud.google.com/apis/design/resource_names) of the Policy. Format: policies/{policy}.
  - `policyQuery` PolicyQuery — PolicyQuery
    - `query` string — Immutable. The CEL query that defines which entities the Policy applies to (ex. a User entity). For details about CEL see https://opensource.google.com/projects/cel. The OrgUnits the Policy applies to are represented by a clause like so: entity.org_units.exists(org_unit, org_unit.org_unit_id == orgUnitId('{orgUnitId}')) The Group the Policy applies to are represented by a clause like so: entity.groups.exists(group, group.group_id == groupId('{groupId}')) The Licenses the Policy applies to are represented by a clause like so: entity.licenses.exists(license, license in ['/product/{productId}/sku/{skuId}']) **Note:** The licenses clause is not supported in mutate endpoints. The above clauses can be present in any combination, and used in conjunction with the &&, || and ! operators. The org_unit and group fields below are helper fields that contain the corresponding value(s) as the query to make the query easier to use.
    - `orgUnit` string — Required. Immutable. Non-empty default. The OrgUnit the query applies to. This field is only set if there is a single value for org_unit that satisfies all clauses of the query.
    - `sortOrder` number, double — Output only. The decimal sort order of this PolicyQuery. The value is relative to all other policies with the same setting type for the customer. (There are no duplicates within this set).
    - `group` string — Immutable. The group that the query applies to. This field is only set if there is a single value for group that satisfies all clauses of the query. If no group applies, this will be the empty string.
  - `customer` string — Immutable. Customer that the Policy belongs to. The value is in the format 'customers/{customerId}'. The `customerId` must begin with "C" To find your customer ID in Admin Console see https://support.google.com/a/answer/10070793.
  - `setting` Setting — Setting
    - `type` string — Required. Immutable. The type of the Setting. .
    - `value` object — Required. The value of the Setting.
  - `type` 'POLICY_TYPE_UNSPECIFIED' | 'SYSTEM' | 'ADMIN' — Output only. The type of the policy.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/cloudidentity.md) · [All operations](https://skmtc.net/google/apis/cloudidentity/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/cloudidentity/revisions/179b4eeed5a2/schema)
