Create
cancel
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

Update Repository Variable via REST returning 404, GET returns 200

I am attempting to update a pipeline variable using the REST API.

When I run the below GET curl command I receive a 200 response:

curl "https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pipelines_config/variables/{UUID}" \
-H "authorization: Basic <token>"

The response indicates I have the right scope (pipeline:variable)

X-OAuth-Scopes: pipeline:variable, webhook, snippet:write, wiki, issue:write, pullrequest:write, repository:delete, repository:admin, project:write, team:write, account:write

 

However when I run either of the following PUT statement I receive a 404

curl "https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pipelines_config/variables/{UUID}" \
-X PUT \
-d "{\"key\": \"VERSION\", \"value\": \"2\"}" \
-H "{'Content-Type': 'application/json'}" \
-H "authorization: Basic <token>"

 

curl "https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/pipelines_config/variables/{UUID}" \
-X PUT \
-d "{\"uuid\": \"{e0432975-d630-43a6-ae1f-fc763e225d9e}\", \"key\": \"VERSION\", \"value\": \"2\", \"secured\": false}" \
-H "{'Content-Type': 'application/json'}" \
-H "authorization: Basic <token>"

 

Given I receive a 200 and the object I am struggling to understand why I receive a 404 when I perform a PUT.

Does anyone have any suggestions?  I believe I am sending everything detailed in the documentation:

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines_config/variables/%7Bvariable_uuid%7D?_ga=2.9386805.1498113289.1591731597-564959769.1588164046#put

1 answer

1 accepted

0 votes
Answer accepted

This is a permission issue, the App Account had the right permissions but the user did not have access to the repo.  Could do with the right response code being returned but hopefully this will help someone.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,736 views 10 16
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