Creates a space with no members. Can be used to create a named space, or a group chat in Import mode
. For an example, see Create a space.
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.
Supports the following types of authentication:
When authenticating as an app, the space.customer
field must be set in the request.
HTTP request
POST https://chat.googleapis.com/v1/spaces
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters | |
---|---|
request |
Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. |
Request body
The request body contains an instance of Space
.
Response body
If successful, the response body contains a newly created instance of Space
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/chat.app.spaces.create
https://www.googleapis.com/auth/chat.app.spaces
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.create
For more information, see the Authorization guide.