---
title: "List GPG keys"
method: GET
path: "/users/{selected_user}/gpg-keys"
tags: ["GPG"]
---

# List GPG keys

`GET /users/{selected_user}/gpg-keys`

Returns a paginated list of the user's GPG public keys.
The `key` and `subkeys` fields can also be requested from the endpoint.
See [Partial Responses](/cloud/bitbucket/rest/intro/#partial-response) for more details.

## Response `200`

A list of the GPG keys associated with the account.

- PaginatedGpgUserKeys — A paginated list of GPG keys.
  - `size` integer — Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
  - `page` integer — Page number of the current results. This is an optional element that is not provided in all responses.
  - `pagelen` integer — Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.
  - `next` string, uri — Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.
  - `previous` string, uri — Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.
  - `values` GPGAccountKey[]
    - `type` string, required
    - `owner` Account — An account object.
      - `type` string, required
      - `links` AccountLinks — Links related to an Account.
        - `avatar` Link — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `created_on` string, date-time
      - `display_name` string
      - `uuid` string
    - `key` string — The GPG key value in X format.
    - `key_id` string — The unique identifier for the GPG key
    - `fingerprint` string — The GPG key fingerprint.
    - `parent_fingerprint` string — The fingerprint of the parent key. This value is null unless the current key is a subkey.
    - `name` string — The user-defined label for the GPG key
    - `expires_on` string, date-time
    - `created_on` string, date-time
    - `added_on` string, date-time
    - `last_used` string, date-time
    - `subkeys` GPGAccountKey[]
    - `links` object
      - `self` object — A link to a resource related to this object.
        - `href` string, uri
        - `name` string

## Other responses

- `403` — If the specified user's keys are not accessible to the current user
- `404` — If the specified user does not exist

---

[API](https://skmtc.net/atlassian/apis/bitbucket-api.md) · [All operations](https://skmtc.net/atlassian/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/bitbucket-api/versions/8c7911c0a910/schema)
