Google Admin SDK Admin Sdk Admin Directory Role Assignments API
The Admin Sdk Admin Directory Role Assignments API from Google Admin SDK — 2 operation(s) for admin sdk admin directory role assignments.
The Admin Sdk Admin Directory Role Assignments API from Google Admin SDK — 2 operation(s) for admin sdk admin directory role assignments.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/google-admin-sdk:google-admin-sdk-admin-directory-role-assignments-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.1.0
info:
title: Admin SDK API RoleAssignments API
version: directory_v1
description: Generated from Google's published Discovery document for Admin SDK API (admin directory_v1, revision 20261109).
4 operation(s).
contact:
name: Google
url: https://developers.google.com/
termsOfService: https://developers.google.com/terms
externalDocs:
url: https://developers.google.com/workspace/admin/
servers:
- url: https://admin.googleapis.com
paths:
/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}:
delete:
operationId: directory.roleAssignments.delete
summary: Delete roleAssignments
description: Deletes a role assignment.
parameters:
- name: customer
in: path
required: true
description: Immutable ID of the Google Workspace account.
schema:
type: string
- name: roleAssignmentId
in: path
required: true
description: Immutable ID of the role assignment.
schema:
type: string
responses:
'200':
description: Successful response
4XX:
content: &id001
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content: *id001
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/admin.directory.rolemanagement
- apiKey: []
tags:
- RoleAssignments
get:
operationId: directory.roleAssignments.get
summary: Get roleAssignments
description: Retrieves a role assignment.
parameters:
- name: customer
in: path
required: true
description: The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch
all groups for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent
your account's `customerId`. The `customerId` is also returned as part of the [Users](https://developers.google.com/workspace/admin/directory/v1/reference/users)
resource. You must provide either the `customer` or the `domain` parameter.
schema:
type: string
- name: roleAssignmentId
in: path
required: true
description: Immutable ID of the role assignment.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/RoleAssignment'
4XX:
content: &id002
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content: *id002
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/admin.directory.rolemanagement
- https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
- apiKey: []
tags:
- RoleAssignments
/admin/directory/v1/customer/{customer}/roleassignments:
get:
operationId: directory.roleAssignments.list
summary: List roleAssignments
description: Retrieves a paginated list of all roleAssignments.
parameters:
- name: customer
in: path
required: true
description: The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch
all groups for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent
your account's `customerId`. The `customerId` is also returned as part of the [Users](https://developers.google.com/workspace/admin/directory/v1/reference/users)
resource. You must provide either the `customer` or the `domain` parameter.
schema:
type: string
- name: includeIndirectRoleAssignments
in: query
required: false
description: When set to `true`, fetches indirect role assignments (i.e. role assignment via a group) as well as direct
ones. Defaults to `false`. You must specify `user_key` or the indirect role assignments will not be included.
schema:
type: boolean
- name: maxResults
in: query
required: false
description: Maximum number of results to return.
schema:
minimum: 1
format: int32
type: integer
maximum: 200
- name: pageToken
in: query
required: false
description: Token to specify the next page in the list.
schema:
type: string
- name: roleId
in: query
required: false
description: Immutable ID of a role. If included in the request, returns only role assignments containing this role
ID.
schema:
type: string
- name: userKey
in: query
required: false
description: The primary email address, alias email address, or unique user or group ID. If included in the request,
returns role assignments only for this user or group.
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/RoleAssignments'
4XX:
content: &id003
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content: *id003
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/admin.directory.rolemanagement
- https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly
- apiKey: []
tags:
- RoleAssignments
post:
operationId: directory.roleAssignments.insert
summary: Insert roleAssignments
description: Creates a role assignment.
parameters:
- name: customer
in: path
required: true
description: Immutable ID of the Google Workspace account.
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RoleAssignment'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/RoleAssignment'
4XX:
content: &id004
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcError'
description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
default:
content: *id004
description: Error response (google.rpc.Status)
security:
- oauth2:
- https://www.googleapis.com/auth/admin.directory.rolemanagement
- apiKey: []
tags:
- RoleAssignments
components:
securitySchemes:
apiKey:
type: apiKey
in: query
name: key
description: API key; accepted by methods that do not need user data.
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://accounts.google.com/o/oauth2/auth
tokenUrl: https://oauth2.googleapis.com/token
scopes:
https://www.googleapis.com/auth/admin.directory.userschema: View and manage the provisioning of user schemas on
your domain
https://www.googleapis.com/auth/admin.directory.group.readonly: View groups on your domain
https://www.googleapis.com/auth/admin.directory.resource.calendar: View and manage the provisioning of calendar
resources on your domain
https://www.googleapis.com/auth/admin.directory.domain.readonly: View domains related to your customers
https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly: View your ChromeOS devices' metadata
https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly: View calendar resources on your domain
https://www.googleapis.com/auth/admin.directory.device.mobile.readonly: View your mobile devices' metadata
https://www.googleapis.com/auth/admin.chrome.printers.readonly: See the printers that your organization can use
with Chrome
https://www.googleapis.com/auth/admin.directory.user.alias.readonly: View user aliases on your domain
https://www.googleapis.com/auth/admin.chrome.printers: See, add, edit, and permanently delete the printers that
your organization can use with Chrome
https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly: View delegated admin roles for your domain
https://www.googleapis.com/auth/admin.directory.user: View and manage the provisioning of users on your domain
https://www.googleapis.com/auth/admin.directory.group: View and manage the provisioning of groups on your domain
https://www.googleapis.com/auth/admin.directory.user.readonly: See info about users on your domain
https://www.googleapis.com/auth/admin.directory.rolemanagement: Manage delegated admin roles for your domain
https://www.googleapis.com/auth/admin.directory.user.security: Manage data access permissions for users on your
domain
https://www.googleapis.com/auth/admin.directory.customer: View and manage customer related information
https://www.googleapis.com/auth/admin.directory.userschema.readonly: View user schemas on your domain
https://www.googleapis.com/auth/admin.directory.device.mobile.action: Manage your mobile devices by performing
administrative tasks
https://www.googleapis.com/auth/admin.directory.orgunit: View and manage organization units on your domain
https://www.googleapis.com/auth/admin.directory.group.member: View and manage group subscriptions on your domain
https://www.googleapis.com/auth/admin.directory.device.chromeos: View and manage your ChromeOS devices' metadata
https://www.googleapis.com/auth/admin.directory.device.mobile: View and manage your mobile devices' metadata
https://www.googleapis.com/auth/cloud-platform: See, edit, configure, and delete your Google Cloud data and see
the email address for your Google Account.
https://www.googleapis.com/auth/admin.directory.group.member.readonly: View group subscriptions on your domain
https://www.googleapis.com/auth/admin.directory.orgunit.readonly: View organization units on your domain
https://www.googleapis.com/auth/admin.directory.user.alias: View and manage user aliases on your domain
https://www.googleapis.com/auth/admin.directory.customer.readonly: View customer related information
https://www.googleapis.com/auth/admin.directory.domain: View and manage the provisioning of domains for your customers
schemas:
ExpirationDetails:
type: object
description: Details regarding the expiration of this role assignment. Used to automatically revoke access when the
time limit is reached.
properties:
expireTime:
description: The specific timestamp when the role assignment expires.
type: string
format: google-datetime
GoogleRpcError:
type: object
description: The error envelope every Google API returns.
properties:
error:
type: object
properties:
code:
type: integer
message:
type: string
status:
type: string
details:
type: array
items:
type: object
RoleAssignment:
type: object
description: Defines an assignment of a role.
properties:
condition:
description: 'Optional. The condition associated with this role assignment. Note: Feature is available to Enterprise
Standard, Enterprise Plus, Google Workspace for Education Plus and Cloud Identity Premium customers. A `RoleAssignment`
with the `condition` field set will only take effect when the resource being accessed meets the condition. If
`condition` is empty, the role (`role_id`) is applied to the actor (`assigned_to`) at the scope (`scope_type`)
unconditionally. Currently, the following conditions are supported: - To make the `RoleAssignment` only applicable
to [Security Groups](https://cloud.google.com/identity/docs/groups#group_types): `api.getAttribute(''cloudidentity.googleapis.com/groups.labels'',
[]).hasAny([''groups.security'']) && resource.type == ''cloudidentity.googleapis.com/Group''` - To make the `RoleAssignment`
not applicable to [Security Groups](https://cloud.google.com/identity/docs/groups#group_types): `!api.getAttribute(''cloudidentity.googleapis.com/groups.labels'',
[]).hasAny([''groups.security'']) && resource.type == ''cloudidentity.googleapis.com/Group''` Currently, the condition
strings have to be verbatim and they only work with the following [pre-built administrator roles](https://support.google.com/a/answer/2405986):
- Groups Editor - Groups Reader The condition follows [Cloud IAM condition syntax](https://cloud.google.com/iam/docs/conditions-overview).
- To make the `RoleAssignment` not applicable to [Locked Groups](https://cloud.google.com/identity/docs/groups#group_types):
`!api.getAttribute(''cloudidentity.googleapis.com/groups.labels'', []).hasAny([''groups.locked'']) && resource.type
== ''cloudidentity.googleapis.com/Group''` This condition can also be used in conjunction with a Security-related
condition.'
type: string
scopeType:
description: The scope in which this role is assigned.
type: string
assigneeType:
readOnly: true
type: string
enum:
- user
- group
description: Output only. The type of the assignee (`USER` or `GROUP`).
assignedTo:
description: The unique ID of the entity this role is assigned to—either the `user_id` of a user, the `group_id`
of a group, or the `uniqueId` of a service account as defined in [Identity and Access Management (IAM)](https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts).
type: string
etag:
description: ETag of the resource.
type: string
kind:
type: string
default: admin#directory#roleAssignment
description: The type of the API resource. This is always `admin#directory#roleAssignment`.
orgUnitId:
description: If the role is restricted to an organization unit, this contains the ID for the organization unit the
exercise of this role is restricted to.
type: string
roleId:
format: int64
description: The ID of the role that is assigned.
type: string
roleAssignmentId:
description: ID of this roleAssignment.
type: string
format: int64
expirationDetails:
$ref: '#/components/schemas/ExpirationDetails'
description: Optional. Details regarding the expiration of this role assignment.
RoleAssignments:
properties:
kind:
default: admin#directory#roleAssignments
type: string
description: The type of the API resource. This is always `admin#directory#roleAssignments`.
nextPageToken:
type: string
etag:
description: ETag of the resource.
type: string
items:
description: A list of RoleAssignment resources.
type: array
items:
$ref: '#/components/schemas/RoleAssignment'
type: object
x-provenance:
method: harvested
publisher: Google
source: https://admin.googleapis.com/$discovery/rest?version=directory_v1
note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261109)