---
title: "Delete a previous revision of a snippet"
method: DELETE
path: "/snippets/{workspace}/{encoded_id}/{node_id}"
tags: ["Snippets"]
---

# Delete a previous revision of a snippet

`DELETE /snippets/{workspace}/{encoded_id}/{node_id}`

Deletes the snippet.

Note that this only works for versioned URLs that point to the latest
commit of the snippet. Pointing to an older commit results in a 405
status code.

To delete a snippet, regardless of whether or not concurrent changes
are being made to it, use `DELETE /snippets/{encoded_id}` instead.

## Response `204`

If the snippet was deleted successfully.

## Other responses

- `401` — If the snippet is private and the request was not authenticated.
- `403` — If authenticated user does not have permission to delete the private snippet.
- `404` — If the snippet does not exist.
- `405` — If `{node_id}` is not the latest revision.

---

[API](https://skmtc.net/atlassian/apis/bitbucket-api.md) · [All operations](https://skmtc.net/atlassian/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/bitbucket-api/versions/8c7911c0a910/schema)
