v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1330180264.7 KB
spaces

Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Supports the following types of authentication: - App authentication with administrator approval and the authorization scope: - https://www.googleapis.com/auth/chat.app.memberships - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.memberships - https://www.googleapis.com/auth/chat.memberships.app (to add the calling app to the space) - https://www.googleapis.com/auth/chat.import (import mode spaces only) - User authentication grants administrator privileges when an administrator account authenticates, use_admin_access is true, and the following authorization scope is used: - https://www.googleapis.com/auth/chat.admin.memberships App authentication is not supported for the following use cases: - Inviting users external to the Workspace organization that owns the space. - Adding a Google Group to a space. - Adding a Chat app to a space. For example usage, see: - Invite or add a user to a space. - Invite or add a Google Group to a space. - Add the Chat app to a space.

post/v1/{+parent}/members

Path parameters

parentstring required

Required. The resource name of the space for which to create the membership. Format: spaces/{space}

Query parameters

useAdminAccessboolean

Optional. When true, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the chat.admin.memberships OAuth 2.0 scope. Creating app memberships or creating memberships for users outside the administrator's Google Workspace organization isn't supported using admin access.

Request body

namestring

Identifier. Resource name of the membership, assigned by the server. Format: spaces/{space}/members/{member}

state'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER'

Output only. State of the membership.

role'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER'

Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in UpdateMembership.

createTimestring google-datetime

Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.

deleteTimestring google-datetime

Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.

affiliation'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL'

Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is EXTERNAL.

Response

Successful response