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

# destroy

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

## Request

- Base URL: `https://packagecloud.io`
- URL: `https://packagecloud.io/api/v1/repos/{user_id}/{repo}/gpg_keys/{keyname}.json`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/cstrahan/apis/packagecloud-api/docs/api/v1/repos/:user_id/:repo/gpg_keys/:keyname.json/delete.ts> (a function with typed inputs; its response is checked against the schema)

Destroy a GPG key

**Example request:**

```
curl -X DELETE https://packagecloud.io/api/v1/repos/username/reponame/gpg_keys/username-reponame-85D7FBF915DFCBC6.pub.gpg.json
```

## Path parameters

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

## Response `204`

Successful response

## Changes

- **2026-06-09** `5591e5a92d9e`: 1 breaking
  - removed the media type `application/json` for the response with the status `204`

[Operation history](https://skmtc.dev/cstrahan/apis/packagecloud-api/changes/api/v1/repos/:user_id/:repo/gpg_keys/:keyname.json/delete.md)

---

[API](https://skmtc.dev/cstrahan/apis/packagecloud-api.md) - [All operations](https://skmtc.dev/cstrahan/apis/packagecloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cstrahan/apis/packagecloud-api/revisions/9744ac4cffc2?raw)
