---
title: "Delete a repository deploy key"
method: DELETE
path: "/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}"
tags: ["Deployments"]
---

# Delete a repository deploy key

`DELETE /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}`

## Request

- Base URL: `https://api.bitbucket.org/2.0`
- URL: `https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://bitbucket.org/site/oauth2/authorize`
    - Token URL: `https://bitbucket.org/site/oauth2/access_token` scopes: `repository`, `repository:admin`
  - HTTP basic
  - API key in header `Authorization`

This deletes a deploy key from a repository.

## Response `204`

The key has been deleted

## Other responses

- `403`: If the current user does not have permission to delete a key for the specified user
- `404`: If the specified user, repository, or deploy key does not exist

---

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