Lists spaces the caller is a member of. Requires authentication. Fully supports service account authentication.
Supports user authentication as part of the Google Workspace Developer Preview Program, which grants early access to certain features. User authentication requires the chat.spaces
or chat.spaces.readonly
authorization scope.
Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent.
HTTP request
GET https://chat.googleapis.com/v1/spaces
The URL uses gRPC Transcoding syntax.
Query parameters
Parameters | |
---|---|
pageSize |
Optional. The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an |
pageToken |
Optional. A page token, received from a previous list spaces call. Provide this to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results. |
filter |
Optional. A query filter. Requires user authentication. You can filter spaces by the space type ( To filter by space type, you must specify valid For example, the following queries are valid:
Invalid queries are rejected by the server with an With service account authentication, this field is ignored and the query always returns all spaces. But Chat API still validates the query syntax with service accounts, so invalid queries are still rejected. |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"spaces": [
{
object ( |
Fields | |
---|---|
spaces[] |
List of spaces in the requested (or first) page. |
nextPageToken |
A token that can be sent as |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.bot
For more information, see the Authorization guide.