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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Querying all repos in project

Hi team - I'm trying to query all repos in a workspace, but I get an empty response for some reason:

api.bitbucket.org/2.0/repositories/[workspacename]

{
"values": [],
"pagelen": 10,
"size": 0,
"page": 1
}

When I query the workspace:

https://api.bitbucket.org/2.0/workspaces/[workspacename]

I get:

{
"type": "workspace",
"uuid": "{ba9c2c51-0e86-4b0d-b893-f69d8aa2e916}",
"name": "[workspacename]",
"slug": "[workspacename]",
"is_private": true,
"links": {
"avatar": {
"href": "https://bitbucket.org/workspaces/[workspacename]/avatar/?ts=1679930059"
},
"hooks": {
"href": "https://api.bitbucket.org/2.0/workspaces/[workspacename]/hooks"
},
"html": {
"href": "https://bitbucket.org/[workspacename]/"
},
"html_overview": {
"href": "https://bitbucket.org/[workspacename]/workspace/overview/"
},
"members": {
"href": "https://api.bitbucket.org/2.0/workspaces/[workspacename]/members"
},
"owners": {
"href": "https://api.bitbucket.org/2.0/workspaces/[workspacename]/members?q=permission%3D%22owner%22"
},
"projects": {
"href": "https://api.bitbucket.org/2.0/workspaces/[workspacename]/projects"
},
"repositories": {
"href": "https://api.bitbucket.org/2.0/repositories/[workspacename]"
},
"snippets": {
"href": "https://api.bitbucket.org/2.0/snippets/[workspacename]"
},
"self": {
"href": "https://api.bitbucket.org/2.0/workspaces/[workspacename]"
}
},
"created_on": "2018-12-02T00:29:19.834722+00:00"
}

Going through .../projects/ takes me back to the same point

As I'm logged in as an owner, surely I should be able to see all the repos that I have access to?

1 answer

1 accepted

2 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 09, 2023

Hey @Scott Harman !

thank you for reaching out to Community :) 

The List repositories in a workspace endpoint should indeed return all the repositories of a workspace to which the authenticated user has access.

I tested in one of my own workspaces authenticating using an App Password, and the list was returned successfully : 

curl --request GET -u USERNAME:APP_PASSWORD 'https://api.bitbucket.org/2.0/repositories/{WORKSPACE}'

In this case, could you confirm what kind of authentication you are using to make the request?

If you are also using app passwords, it should have at least repo:read scope. You can also try using an app password with all the scopes selected to verify if the issue is permission-related.

Thank you, @Scott Harman !

Patrik S

Thanks - it only appears to work with an app password, but not with standard credentials.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events