Skip to main content
POST
/
v1
/
workspaces
/
{workspace}
:setIamPolicy
cURL
curl --request POST \
  --url https://api.example.com/v1/workspaces/{workspace}:setIamPolicy \
  --header 'Content-Type: application/json' \
  --data '
{
  "resource": "<string>",
  "policy": {
    "bindings": [
      {
        "role": "<string>",
        "members": [
          "<string>"
        ],
        "condition": {
          "id": "<string>",
          "constExpr": {
            "nullValue": "NULL_VALUE",
            "boolValue": true,
            "int64Value": "<string>",
            "uint64Value": "<string>",
            "doubleValue": 123,
            "stringValue": "<string>",
            "bytesValue": "<string>",
            "durationValue": "<string>",
            "timestampValue": "2023-11-07T05:31:56Z"
          },
          "identExpr": {
            "name": "<string>"
          },
          "selectExpr": {
            "operand": "<unknown>",
            "field": "<string>",
            "testOnly": true
          },
          "callExpr": {
            "target": "<unknown>",
            "function": "<string>",
            "args": "<array>"
          },
          "listExpr": {
            "elements": "<array>",
            "optionalIndices": [
              123
            ]
          },
          "structExpr": {
            "messageName": "<string>",
            "entries": [
              {
                "id": "<string>",
                "fieldKey": "<string>",
                "mapKey": "<unknown>",
                "value": "<unknown>",
                "optionalEntry": true
              }
            ]
          },
          "comprehensionExpr": {
            "iterVar": "<string>",
            "iterVar2": "<string>",
            "iterRange": "<unknown>",
            "accuVar": "<string>",
            "accuInit": "<unknown>",
            "loopCondition": "<unknown>",
            "loopStep": "<unknown>",
            "result": "<unknown>"
          }
        }
      }
    ],
    "etag": "<string>"
  },
  "etag": "<string>"
}
'
{
  "bindings": [
    {
      "role": "<string>",
      "members": [
        "<string>"
      ],
      "condition": {
        "id": "<string>",
        "constExpr": {
          "nullValue": "NULL_VALUE",
          "boolValue": true,
          "int64Value": "<string>",
          "uint64Value": "<string>",
          "doubleValue": 123,
          "stringValue": "<string>",
          "bytesValue": "<string>",
          "durationValue": "<string>",
          "timestampValue": "2023-11-07T05:31:56Z"
        },
        "identExpr": {
          "name": "<string>"
        },
        "selectExpr": {
          "operand": "<unknown>",
          "field": "<string>",
          "testOnly": true
        },
        "callExpr": {
          "target": "<unknown>",
          "function": "<string>",
          "args": "<array>"
        },
        "listExpr": {
          "elements": "<array>",
          "optionalIndices": [
            123
          ]
        },
        "structExpr": {
          "messageName": "<string>",
          "entries": [
            {
              "id": "<string>",
              "fieldKey": "<string>",
              "mapKey": "<unknown>",
              "value": "<unknown>",
              "optionalEntry": true
            }
          ]
        },
        "comprehensionExpr": {
          "iterVar": "<string>",
          "iterVar2": "<string>",
          "iterRange": "<unknown>",
          "accuVar": "<string>",
          "accuInit": "<unknown>",
          "loopCondition": "<unknown>",
          "loopStep": "<unknown>",
          "result": "<unknown>"
        }
      },
      "parsedExpr": {
        "id": "<string>",
        "constExpr": {
          "nullValue": "NULL_VALUE",
          "boolValue": true,
          "int64Value": "<string>",
          "uint64Value": "<string>",
          "doubleValue": 123,
          "stringValue": "<string>",
          "bytesValue": "<string>",
          "durationValue": "<string>",
          "timestampValue": "2023-11-07T05:31:56Z"
        },
        "identExpr": {
          "name": "<string>"
        },
        "selectExpr": {
          "operand": "<unknown>",
          "field": "<string>",
          "testOnly": true
        },
        "callExpr": {
          "target": "<unknown>",
          "function": "<string>",
          "args": "<array>"
        },
        "listExpr": {
          "elements": "<array>",
          "optionalIndices": [
            123
          ]
        },
        "structExpr": {
          "messageName": "<string>",
          "entries": [
            {
              "id": "<string>",
              "fieldKey": "<string>",
              "mapKey": "<unknown>",
              "value": "<unknown>",
              "optionalEntry": true
            }
          ]
        },
        "comprehensionExpr": {
          "iterVar": "<string>",
          "iterVar2": "<string>",
          "iterRange": "<unknown>",
          "accuVar": "<string>",
          "accuInit": "<unknown>",
          "loopCondition": "<unknown>",
          "loopStep": "<unknown>",
          "result": "<unknown>"
        }
      }
    }
  ],
  "etag": "<string>"
}

Path Parameters

workspace
string
required

The workspace id.

Body

application/json

Request message for setting an IAM policy.

resource
string
required

The name of the resource to set the IAM policy. Format: projects/{project} Format: workspaces/{workspace}

policy
object
required

IAM policy that binds members to roles.

etag
string

The current etag of the policy.

Response

OK

IAM policy that binds members to roles.

bindings
object[]

Collection of binding. A binding binds one or more project members to a single project role.

etag
string

The current etag of the policy. If an etag is provided and does not match the current etag of the policy, the call will be blocked and an ABORTED error will be returned.