You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I'm having some difficulty creating a repo under a workspace using the cloud API through a repo setup script. This is the curl command:
curl --request POST \
--url "https://api.bitbucket.org/2.0/repositories/${workspace}/${repo_slug}" \
--header "Authorization: Bearer ${BITBUCKET_REPO_SETUP}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"type\": \"repository\",
\"name\": \"${repo_slug}\",
\"project\": {
\"key\": \"${PROJECT_KEY}\"
}
}"
When I execute this command I get the following error:
{
"type": "error",
"error": {
"message": "You do not have access to view this workspace."
}
}
This is seemingly a permission issue, so the first thing I did was check the project access token's permissions. I verified it has the correct permissions:
When I execute a GET request with the same token to the same workspace I get a successful response:
curl --request GET \
--url "https://api.bitbucket.org/2.0/workspaces/${workspace}" \
--header "Authorization: Bearer ${BITBUCKET_REPO_SETUP}" \
--header "Accept: application/json"
What am I missing?
G'day, @Ryan Mangum
Welcome to the community!
Are you an administrator of the workspace with the ability to create a repository through the user interface? If so, which type of token did you use to create the repository? There are three types of tokens available: the Workspace token, the Repository token, and the Project token, which is referred to as the Bitbucket Access Token.
If you do not have administrative privileges in the workspace, it is expected that you won't be able to create a repository due to insufficient permissions hence the error
You do not have access to view this workspace
You need to request your administrator to provide you with access to create a repository to allow you to create a repository.
I hope this helps.
Regards,
Syahrul
I am an administrator for the project, and the request above is being sent with a project level access token. Just so I understand, I cannot create a repo within a project that I have an admin token for, and I will need a workspace admin token to do this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan Mangum
It looks like there's a bug with the Project access token with the create repository endpoint that is currently tracked at:
https://jira.atlassian.com/browse/BCLOUD-22568
Please Vote and Watch the bug report so that you'll receive an update whenever it's fixed.
As a workaround, please use App Password instead temporarily.
I hope this helps.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.