---
title: "Delete a deploy key"
method: DELETE
path: "/api/v4/projects/{id}/deploy_keys/{key_id}"
tags: ["deploy_resources"]
---

# Delete a deploy key

`DELETE /api/v4/projects/{id}/deploy_keys/{key_id}`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/deploy_keys/{key_id}`
- Auth: none declared

Deletes a deploy key from the project. If the deploy key is used only for this project, it is deleted from the system.

## Path parameters

- `id` string, required
- `key_id` integer, required

## Response `204`

Resource deleted

## Other responses

- `401`: Unauthorized
- `404`: Not found

---

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