Method: projects.locations.keys.list

Lists the API keys owned by a project. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

HTTP request

GET https://apikeys.googleapis.com/v2/{parent=projects/*/locations/*}/keys

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Lists all API keys associated with this project.

Authorization requires the following IAM permission on the specified resource parent:

  • apikeys.keys.list

Query parameters

Parameters
pageSize

integer

Optional. Specifies the maximum number of results to be returned at a time.

pageToken

string

Optional. Requests a specific page of results.

showDeleted

boolean

Optional. Indicate that keys deleted in the past 30 days should also be returned.

Request body

The request body must be empty.

Response body

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

Response message for keys.list method.

JSON representation
{
  "keys": [
    {
      object (Key)
    }
  ],
  "nextPageToken": string
}
Fields
keys[]

object (Key)

A list of API keys.

nextPageToken

string

The pagination token for the next page of results.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • apikeys.keys.list

For more information, see the IAM documentation.