Page Summary
-
Returns a paginated list of Google Workspace spaces based on an administrator's search criteria, including parameters like displayName, createTime, and spaceType.
-
Requires administrator privileges and the
useAdminAccessparameter set totruein the request. -
Utilizes the
GET https://chat.googleapis.com/v1/spaces:searchHTTP request with query parameters for customization. -
Needs authorization with either the
chat.admin.spacesorchat.admin.spaces.readonlyOAuth scope. -
Response body includes an array of spaces, a token for pagination, and an estimate of the total number of matching spaces.
- HTTP request
- Query parameters
- Request body
- Response body
- Authorization scopes
- SearchSpaceResult
- Try it!
Returns a list of spaces in a Google Workspace organization. For an example, see Search for and manage spaces.
When useAdminAccess is set to false, the results are limited to spaces where the calling user is a joined member. To search with administrator privileges, set useAdminAccess to true. Setting useAdminAccess to false is available under Developer Preview.
Supports the following types of authentication:
User authentication with one of the following authorization scopes:
https://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.spaces
User authentication with administrator privileges and one of the following authorization scopes:
https://www.googleapis.com/auth/chat.admin.spaces.readonlyhttps://www.googleapis.com/auth/chat.admin.spaces
HTTP request
GET https://chat.googleapis.com/v1/spaces:search
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
useAdminAccess |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires either the Setting |
pageSize |
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. If you use a value more than 1000, it's automatically changed to 1000. |
pageToken |
A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
query |
Required. A search query. You can search by using the following parameters when
When
Across different fields, only Among the same field, The following example queries are valid when The following example queries are valid when |
orderBy |
Optional. How the list of spaces is ordered. Supported attributes to order by are:
When Valid ordering operation values are:
The supported syntax are when
When
|
Request body
The request body must be empty.
Response body
Response with a list of spaces corresponding to the search spaces request.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "spaces": [ { object ( |
| Fields | |
|---|---|
spaces[] |
Deprecated: Please use the new |
nextPageToken |
A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages. |
totalSize |
The total number of spaces that match the query, across all pages. If the result is over 10,000 spaces, this value is an estimate. |
results[] |
Output only. The list of search results that matched the query. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/chat.spaceshttps://www.googleapis.com/auth/chat.spaces.readonlyhttps://www.googleapis.com/auth/chat.admin.spaceshttps://www.googleapis.com/auth/chat.admin.spaces.readonly
For more information, see the Authorization guide.
SearchSpaceResult
A single result item from a space search.
| JSON representation |
|---|
{
"space": {
object ( |
| Fields | |
|---|---|
space |
Output only. The matched space. |