---
title: "create"
method: POST
path: "/api/v1/repos/{user_id}/{repo}/gpg_keys.json"
tags: ["gpg_keys"]
---

# create

`POST /api/v1/repos/{user_id}/{repo}/gpg_keys.json`

Create a GPG key.

**Example request:**

```
curl -X POST -F "gpg_key[keydata]=@/path/to/key.gpg" https://packagecloud.io/api/v1/repos/username/reponame/gpg_keys.json
```

## Path parameters

- `user_id` string, required
- `repo` string, required

## Response `201`

[GPGKey](#object_GPGKey) The newly created GPG key object.

- GPGKey
  - `name` string — The name of the GPG key.
  - `fingerprint` string — The GPG key's fingerprint.
  - `keytype` string — The GPG key type ('repo' for repository signing keys or 'package' for package signing keys).
  - `self` string — The URL for this object.
  - `destroy_url` string — The URL that can be used to delete this GPG key.
  - `download_url` string — The URL that can be used to download the GPG public key data.

---

[API](https://skmtc.dev/cstrahan/apis/packagecloud-api.md) · [All operations](https://skmtc.dev/cstrahan/apis/packagecloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cstrahan/packagecloud-api/revisions/9744ac4cffc2/schema)
