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

# POST /v1alpha1/policies:set

`POST /v1alpha1/policies:set`

## Request

- Base URL: `https://prod-tt-sasportal.googleapis.com`
- URL: `https://prod-tt-sasportal.googleapis.com/v1alpha1/policies:set`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/sasportal`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/sasportal`
- TypeScript: <https://skmtc.dev/google/apis/prod-tt-sasportal/docs/v1alpha1/policies:set/post.ts> (a function with typed inputs; its response is checked against the schema)

Sets the access control policy on the specified resource. Replaces any existing policy.

## Request body

- SasPortalSetPolicyRequest: Request message for `SetPolicy` method.
  - `resource` string: Required. The resource for which the policy is being specified. This policy replaces any existing policy.
  - `disableNotification` boolean: Optional. Set the field as `true` to disable the onboarding notification.
  - `policy` SasPortalPolicy: Defines an access control policy to the resources.
    - `etag` string, byte: The etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to GetPolicy, and systems are expected to put that etag in the request to SetPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to GetPolicy, then the existing policy is overwritten blindly.
    - `assignments` SasPortalAssignment[]: List of assignments
      - `role` string: Required. Role that is assigned to `members`.
      - `members` string[]: The identities the role is assigned to. It can have the following values: * `{user_email}`: An email address that represents a specific Google account. For example: `alice@gmail.com`. * `{group_email}`: An email address that represents a Google group. For example, `viewers@gmail.com`.

## Response `200`

Successful response

- SasPortalPolicy: Defines an access control policy to the resources.
  - `etag` string, byte: The etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to GetPolicy, and systems are expected to put that etag in the request to SetPolicy to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to GetPolicy, then the existing policy is overwritten blindly.
  - `assignments` SasPortalAssignment[]: List of assignments
    - `role` string: Required. Role that is assigned to `members`.
    - `members` string[]: The identities the role is assigned to. It can have the following values: * `{user_email}`: An email address that represents a specific Google account. For example: `alice@gmail.com`. * `{group_email}`: An email address that represents a Google group. For example, `viewers@gmail.com`.

## Changes

- **2026-10-10** `33012279ba52`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/sasportal` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/sasportal` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/prod-tt-sasportal/changes/v1alpha1/policies:set/post.md)

---

[API](https://skmtc.dev/google/apis/prod-tt-sasportal.md) - [All operations](https://skmtc.dev/google/apis/prod-tt-sasportal/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/prod-tt-sasportal/revisions/33012279ba52?raw)
