POST /v1/spaces
Changed onCreates a space. Can be used to create a named space, or a group chat in Import mode. For an example, see Create a space. Supports the following types of authentication: - App authentication with administrator approval and one of the following authorization scopes: - https://www.googleapis.com/auth/chat.app.spaces.create - https://www.googleapis.com/auth/chat.app.spaces - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.spaces.create - https://www.googleapis.com/auth/chat.spaces - https://www.googleapis.com/auth/chat.import (import mode spaces only) When authenticating as an app, the space.customer field must be set in the request. When authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set space.permission_settings.manage_apps to managers_allowed. Space membership upon creation depends on whether the space is created in Import mode: * Import mode: No members are created. * All other modes: The calling user is added as a member. This is: * The app itself when using app authentication. * The human user when using user authentication. If you receive the error message ALREADY_EXISTS when creating a space, try a different displayName. An existing space within the Google Workspace organization might already use this display name.
Request
- Base URLhttps://chat.googleapis.com
- URLhttps://chat.googleapis.com/v1/spaces
- Auth
- OAuth 2 and OAuth 2Implicit: https://accounts.google.com/o/oauth2/authScopes: https://www.googleapis.com/auth/chat.app.spacesAuthorization code: https://accounts.google.com/o/oauth2/authToken URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.app.spaces
- or OAuth 2 and OAuth 2Implicit: https://accounts.google.com/o/oauth2/authScopes: https://www.googleapis.com/auth/chat.app.spaces.createAuthorization code: https://accounts.google.com/o/oauth2/authToken URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.app.spaces.create
- or OAuth 2 and OAuth 2Implicit: https://accounts.google.com/o/oauth2/authScopes: https://www.googleapis.com/auth/chat.importAuthorization code: https://accounts.google.com/o/oauth2/authToken URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.import
- or OAuth 2 and OAuth 2Implicit: https://accounts.google.com/o/oauth2/authScopes: https://www.googleapis.com/auth/chat.spacesAuthorization code: https://accounts.google.com/o/oauth2/authToken URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.spaces
- or OAuth 2 and OAuth 2Implicit: https://accounts.google.com/o/oauth2/authScopes: https://www.googleapis.com/auth/chat.spaces.createAuthorization code: https://accounts.google.com/o/oauth2/authToken URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/chat.spaces.create
Query parameters
Optional. A unique ID for this request. A random UUID is recommended. Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single space being created. Subsequent requests with the same request ID return the existing space and do not update the space, even if the requested details differ from the current state. To use this field effectively: - Ensure that subsequent requests are identical and use the same authentication credentials as the original request. - If a space was already created with the provided request ID, the request returns that space. Note that the returned space might not be fully populated; the API echoes the space in your request with the system-assigned resource name populated. To retrieve the latest metadata for the space, call GetSpace. - Reusing an existing request ID with a different authenticated user results in an error.
Request body
Response
Successful response
Changes
- info
the security scope
https://www.googleapis.com/auth/chat.app.spaceswas added to the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/chat.app.spaceswas added to the endpoint's security schemeOauth2c - info
the security scope
https://www.googleapis.com/auth/chat.spaces.createwas removed from the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/chat.spaces.createwas removed from the endpoint's security schemeOauth2c
- info
- info
the security scope
https://www.googleapis.com/auth/chat.app.spaceswas added to the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/chat.app.spaceswas added to the endpoint's security schemeOauth2c - info
the security scope
https://www.googleapis.com/auth/chat.spaces.createwas removed from the endpoint's security schemeOauth2 - info
the security scope
https://www.googleapis.com/auth/chat.spaces.createwas removed from the endpoint's security schemeOauth2c
- info