-
Bug
-
Resolution: Unresolved
-
Medium
-
9
-
Severity 3 - Minor
-
1,395
-
Issue Summary
Cannot create a repo via /2.0/repositories/{workspace}/{repo_slug} with project access token (PAT)
Steps to Reproduce
- create a PAT from project settings with scope repository:admin
- try creating a repository using create repository API endpoint
Expected Results
The repository should be created
Actual Results
The below error is thrown in the API response:
{
"type": "error",
"error": {
"message": "You do not have access to view this workspace."
}
}
Workaround
- Use an App password for authentication instead of an access token
Example:
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--user '{username}:{app_apssword}' \
--header 'Content-Type: application/json' \
--data '{
"is_private": "true",
"scm": "git",
"project": {
"key": "TEST"
}
}'