Directory API 概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Directory API 是 RESTful Admin SDK API 的一部分,可用于以编程方式创建和管理 Google Workspace 账号拥有的由管理员控制的资源。一些应用场景包括:
- 创建和管理用户以及添加管理员。
- 创建和管理群组及群组成员资格。
- 监控连接到您网域的设备,并对丢失的设备采取措施。
- 管理组织结构图和组织结构。
- 审核用户已授予访问权限的应用,并撤消未经授权的应用。
以下是 Directory API 中使用的常见术语的列表:
- 客户
- Google Workspace 账号的所有者实体,由 Customer 资源表示。
- 网域
- 与 Google Workspace 账号关联的 DNS 网域(如果适用),由 Domain 资源表示。并非所有账号都关联了网域。
- 组织部门 (OU)
- Google Workspace 账号组织树的一个子单元,用于对用户进行分组和排序,以便应用政策和授予授权。组织部门由 OrgUnit 资源表示。
- 权限
- 用户对 Google Workspace 资源执行操作的能力。主要适用于管理员。权限由 Privilege 资源表示。
- 角色
- 一组已定义的权限,可分配给一个或一组用户,由 Role 资源表示。
- 角色分配
- 一条记录,用于指明向哪个用户授予了哪些角色,以及授予的范围。
角色分配由 RoleAssignment 资源表示。
- 架构
- 一个 JSON 对象,用于定义组织的自定义用户属性,由 Schema 资源表示。
- 用户
- 可访问 Google Workspace 应用和资源的个人最终用户账号,由 User 资源表示。
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Directory API Overview\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| Got 5 minutes? Help us improve our Google Workspace documentation by taking a quick [online survey](https://forms.gle/XcqRP3PJiQv9ADuj9). |\n\nThe Directory API is part of the RESTful Admin SDK API that can be used to\nprogrammatically create and manage admin-controlled resources owned by a\nGoogle Workspace account. Some use cases include:\n\n- Creating and managing users and adding administrators.\n- Creating and managing groups and group memberships.\n- Monitoring devices connected to your domain and taking action on lost devices.\n- Managing your org chart and organization structures.\n- Auditing applications your users have granted access to and revoking unauthorized apps.\n\nFollowing is a list of common terms used in the Directory API:\n\n*Customer*\n: The entity that owns the Google Workspace account, represented by the\n [Customer](/workspace/admin/directory/reference/rest/v1/customers) resource.\n\n*Domain*\n: If applicable, the DNS domain associated with a Google Workspace account,\n represented by the\n [Domain](/workspace/admin/directory/reference/rest/v1/domains) resource. Not all\n accounts have an associated domain.\n\n*Organizational unit (OU)*\n: A sub-unit of a Google Workspace account's organizational tree, used to\n group and sort users for the purpose of applying policies and granting\n authorizations. An OU is represented by the\n [OrgUnit](/workspace/admin/directory/reference/rest/v1/orgunits) resource.\n\n*Privilege*\n: The ability of a user to perform an action on a Google Workspace resource.\n Applies primarily to admins. A privilege is represented by the\n [Privilege](/workspace/admin/directory/reference/rest/v1/privileges/list#Privilege)\n resource.\n\n*Role*\n: A defined collection of privileges that can be assigned to a user or set of\n users, represented by the\n [Role](/workspace/admin/directory/reference/rest/v1/roles) resource.\n\n*Role assignment*\n: A record indicating which user is granted what roles, and over what scope.\n A role assignment is represented by the\n [RoleAssignment](/workspace/admin/directory/reference/rest/v1/roleAssignments)\n resource.\n\n*Schema*\n: A JSON object that defines custom user attributes for your organization,\n represented by the\n [Schema](/workspace/admin/directory/reference/rest/v1/schemas) resource.\n\n*User*\n: An individual end user account with access to Google Workspace apps and\n resources, represented by the\n [User](/workspace/admin/directory/reference/rest/v1/users) resource.\n\nNext steps\n----------\n\n- To learn about developing with Google Workspace APIs, including handling\n authentication and authorization, refer to\n [Get started as a Workspace developer](/workspace/guides/getstarted-overview).\n\n- To learn how to configure and run a simple Directory API app, try the\n [JavaScript quickstart](/workspace/admin/directory/v1/quickstart/js)."]]