Method: spaces.list

Stay organized with collections Save and categorize content based on your preferences.

Lists spaces the caller is a member of and that are visible to the caller or authenticated user. Requires authentication. Fully supports service account authentication.

HTTP request


The URL uses gRPC Transcoding syntax.

Query parameters



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 INVALID_ARGUMENT error.



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.



Optional. A query filter.

Requires user authentication.

The API supports filtering by spaceType.

For example, the following queries are valid:

spaceType = "SPACE"
spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"

Invalid queries are rejected by the server with an INVALID_ARGUMENT error.

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 (Space)
  "nextPageToken": string

object (Space)

List of spaces in the requested (or first) page.



A token that can be sent as pageToken to retrieve the next page of results. If empty, there are no subsequent pages.

Authorization Scopes

Requires one of the following OAuth scopes:


For more information, see the Authorization guide.