Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Delete the files in Bitbucket using Bitbucket API

Raja Deshapu December 23, 2018

How to Delete the files in Bitbucket Repo using Bitbucket API, the below endpoints are not working. 

$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \
  -F files=/file/to/delete/1.txt \
  -F files=/file/to/delete/2.txt

1 answer

1 accepted

0 votes
Answer accepted
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2018

Hello Raja,

The only methods supported from /2.0/repositories/{username}/{repo_slug}/src are POST or GET. There is not a listed method for DELETE.

To find out more about the available methods, please see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src

Regards,
Stephen Sifers

Raja Deshapu December 27, 2018

Hello Stephen, 

As there is No endpoint to delete the files. Could you please let me know, how to delete the files from bitbucket repo using Bitbucket API? I went through the Documentation/link. but it didn't work out. 

Thanks

Raja,

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 27, 2018

Hello again Raja,

As it stands, there is no method to delete files via the REST API within Bitbucket. Meaning, deleting files via the REST API is not available.

If you would like to see this as a feature within the product in the future, we would suggest you submit a feature request. You may find more about raising a feature request at Raising a request with Atlassian Support. When creating your request, ensure you select suggestion since this will be a feature request.

Regards,
Stephen Sifers

nbadaracco
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 9, 2024

Hi @Stephen Sifers Regarding this topic: deleting files using REST API is not available. Is this still the case today?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events