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

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

throws required key not provided when submit comments using REST API 2.0 Edited

I am submitting the comments to the issues using REST API, in API 1.0 it was working fine, but from yesterday it stopped working. So now I am integrating API2.0.

As I said when I try to POST a comment to an issue, I am getting

required key not provided

my request follows:


$content= ["raw" => "test"];

return $this->requestPost(
array('content' => $content)


3 answers

Could you solve it?

Same issue in python, and similar from the curl command line. Smells like a bug.


url = f'{company}/{repo}/pullrequests/{pr_id}/comments'
payload = {
"content": {
"raw": "robo comment",
resp =, data=payload, auth=(self.vcs_user, self.vcs_token))

b'{"type": "error", "error": {"fields": {"content": "expected a dictionary"}, "message": "Bad request"}}'


$ curl -X POST -H "Authorization: Bearer MDkwg89afxxxxxxxxxxxxxxxxxx" -d '{ "content": { "raw": "some comment" }}'<company>/<repo>/pullrequests/<pull_id>/comments
{"type": "error", "error": {"fields": {"content": "required key not provided", "{ \"content\": { \"raw\": \"some comment\" }}": "extra keys not allowed"}, "message": "Bad request"}}


I solved my issue. I had to add headers to my curl

-H "Content-Type: application/json"

and in python it's now

resp =, data=json.dumps(payload), auth=(self.vcs_user, self.vcs_token), headers={'Content-Type': 'application/json'})

 All better.

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,892 views 0 7
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