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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Delete pull request from repo via API Edited

I am trying to delete the Pull request from repo where as i am getting 405 error.

curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "$PRID" --header "Content-Type: application/json" -H "Accept: application/json"  --data '{ "version": "'"$PRVERSION"'" }'  getting error 405, (The request HTTP method is not appropriate for the targeted resource)  < allow: HEAD,POST,GET,OPTIONS.

I gave the values instead of variables. still got the same error. 

Environment: Server version 6.6.4.

as per the api-document document, I can delete, where as i am getting 405 error.  allowed methods are HEAD,POST,GET,OPTIONS. I am the owner of the repo and have admin privileges.

1 answer

1 vote

Hi Sai,

The pull request ID needs to be provided as part of the path, not as a query string - try something like this instead:

curl -vvv -s -H "Authorization: Bearer $API-TOKEN" -X DELETE "$PRID" --header "Content-Type: application/json" -H "Accept: application/json"  --data '{ "version": "'"$PRVERSION"'" }'



Premier Support Engineer


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

441 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you