---
title: "Get a GPG key"
method: GET
path: "/users/{selected_user}/gpg-keys/{fingerprint}"
tags: ["GPG"]
---

# Get a GPG key

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

Returns a specific GPG public key belonging to a user.
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`

The specific GPG key matching the user and fingerprint.

- GPGAccountKey — Represents a GPG public key for a user.
  - `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/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.net/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/versions/4ec8bd2515c5/schema)
