- [HTTP request](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.request_body)
- [Response body](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.RetrieveApiViewsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#body.aspect_1)
- [ApiViewType](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiViewType)
- [ApiView](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiView)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiView.SCHEMA_REPRESENTATION)
- [FlattenedApiVersionDeploymentView](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionDeploymentView)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionDeploymentView.SCHEMA_REPRESENTATION)
- [FlattenedApiVersionOperationDeploymentView](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionOperationDeploymentView)
  - [JSON representation](https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionOperationDeploymentView.SCHEMA_REPRESENTATION)

Retrieve API views.

### HTTP request

`GET https://apihub.googleapis.com/v1/{parent=projects/*/locations/*}:retrieveApiViews`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource name. Format: `projects/{project}/locations/{location}`. |

### Query parameters

| Parameters ||
|---|---|
| `filter` | `string` Optional. The filter expression. |
| `pageSize` | `integer` Optional. The maximum number of results to return. Default to 100. |
| `pageToken` | `string` Optional. A page token, received from a previous `locations.retrieveApiViews` call. Provide this to retrieve the subsequent page. |
| `view` | ``enum (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiViewType`)`` Required. The view type to return. |

### Request body

The request body must be empty.

### Response body

The \[locations.retrieveApiViews\]\[ApiHubInternal.RetrieveApiViews\] method's response.

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

| JSON representation |
|---|
| ``` { "apiViews": [ { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiView`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `apiViews[]` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#ApiView`)`` Output only. The list of API views. |
| `nextPageToken` | `string` Next page token. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/apihub.readonly`
- `
  https://www.googleapis.com/auth/apihub.readwrite`
- `
  https://www.googleapis.com/auth/cloud-platform`

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permissions on the `parent` resource:

- `apihub.apiOperations.listAll`
- `apihub.apis.list`
- `apihub.deployments.list`
- `apihub.specs.listAll`
- `apihub.versions.listAll`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## ApiViewType

The view type of API.

| Enums ||
|---|---|
| `API_VIEW_TYPE_UNSPECIFIED` | The default view type. |
| `MCP_SERVER` | The MCP server view in API hub. |
| `MCP_TOOL` | The MCP tool view in API hub. |

## ApiView

The view of an API.

| JSON representation |
|---|
| ``` { // Union field `view` can be only one of the following: "mcpServerView": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionDeploymentView`) }, "mcpToolView": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionOperationDeploymentView`) } // End of list of possible types for union field `view`. } ``` |

| Fields ||
|---|---|
| Union field `view`. API view. `view` can be only one of the following: ||
| `mcpServerView` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionDeploymentView`)`` MCP server view. |
| `mcpToolView` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations/retrieveApiViews#FlattenedApiVersionOperationDeploymentView`)`` MCP tools view. |

## FlattenedApiVersionDeploymentView

A flattened view of an API, its version and one of the linked deployments.

| JSON representation |
|---|
| ``` { "api": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis#Api`) }, "version": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions#Version`) }, "deployment": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.deployments#Deployment`) } } ``` |

| Fields ||
|---|---|
| `api` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis#Api`)`` Optional. The API. |
| `version` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions#Version`)`` Optional. The version. |
| `deployment` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.deployments#Deployment`)`` Optional. The deployment. |

## FlattenedApiVersionOperationDeploymentView

A flattened view of an API, its version, one of its operations and one of the linked deployments. If there are no deployments linked to the operation then the result will be empty.

| JSON representation |
|---|
| ``` { "api": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis#Api`) }, "version": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions#Version`) }, "apiOperation": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.operations#ApiOperation`) }, "deployment": { object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.deployments#Deployment`) } } ``` |

| Fields ||
|---|---|
| `api` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis#Api`)`` Optional. The API. |
| `version` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions#Version`)`` Optional. The version. |
| `apiOperation` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.apis.versions.operations#ApiOperation`)`` Optional. The API operation. |
| `deployment` | ``object (`https://docs.cloud.google.com/apigee/docs/reference/apis/apihub/rest/v1/projects.locations.deployments#Deployment`)`` Optional. The deployment. |