Skip to Content
kosemdocs
ReferenceAPIAgents

Set IAM policy

Replaces the IAM policy of an agent, as its owner shares it with members of the organization, such as with roles/agents.agentViewer or roles/agents.agentWriter.

PUT
/v1/projects/{project}/agents/{agent}/iam-policy

Replaces the IAM policy of an agent, as its owner shares it with members of the organization, such as with roles/agents.agentViewer or roles/agents.agentWriter.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
agent*string

The agent's ID.

Match^ags_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
bindings*array<>

Role bindings. Each role appears at most once.

etag?string

The etag of the policy this one replaces, as getting it returned. Without one, the policy is replaced whatever it is.

Response Body

OK

application/json
  1. response
bindings*array<>

Role bindings. Each role appears at most once.

etag*string

Opaque version of the policy. Send it back when setting the policy; the update fails with aborted if the policy changed in between.

Example Request
curl -X PUT 'https://api.kosem.ai/v1/projects/string/agents/string/iam-policy' \
  -H 'Content-Type: application/json' \
  -d '{
  "bindings": [
    {
      "members": [
        "string"
      ],
      "role": "string"
    }
  ]
}'
Example Response
{
  "bindings": [
    {
      "members": [
        "string"
      ],
      "role": "string"
    }
  ],
  "etag": "string"
}