# Method: organizations.search

- [HTTP request](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.HTTP_TEMPLATE)
- [Query parameters](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.request_body)
- [Response body](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.SearchOrganizationsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#body.aspect)
- [Try it!](https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations/search#try-it)

Searches organization resources that are visible to the user and satisfy the specified filter. This method returns organizations in an unspecified order. New organizations do not necessarily appear at the end of the results, and may take a small amount of time to appear.

Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.

### HTTP request

`GET https://cloudresourcemanager.googleapis.com/v3/organizations:search`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. The maximum number of organizations to return in the response. The server can return fewer organizations than requested. If unspecified, server picks an appropriate default. |
| `pageToken` | `string` Optional. A pagination token returned from a previous call to `organizations.search` that indicates from where listing should continue. |
| `query` | `string` Optional. An optional query string used to filter the Organizations to return in the response. Query rules are case-insensitive. | Field            | Description                                | |---|---| | directoryCustomerId, owner.directoryCustomerId | Filters by directory customer id. | | domain           | Filters by domain.                         | Organizations may be queried by `directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for example: - Query `directorycustomerid:123456789` returns Organization resources with `owner.directory_customer_id` equal to `123456789`. - Query `domain:google.com` returns Organization resources corresponding to the domain `google.com`. |

### Request body

The request body must be empty.

### Response body

The response returned from the `organizations.search` method.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "organizations": [ { object (`https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations#Organization`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `organizations[]` | ``object (`https://docs.cloud.google.com/resource-manager/reference/rest/v3/organizations#Organization`)`` The list of Organizations that matched the search query, possibly paginated. |
| `nextPageToken` | `string` A pagination token to be used to retrieve the next page of results. If the result is too large to fit within the page size specified in the request, this field will be set with a token that can be used to fetch the next page of results. If this field is empty, it indicates that this response contains the last page of results. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/cloud-platform.read-only`
- `https://www.googleapis.com/auth/cloudplatformorganizations`
- `https://www.googleapis.com/auth/cloudplatformorganizations.readonly`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).