The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

No values in the API call "Search for code in a workspace"

Jonas Lüthi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 6, 2026

I am trying to search for code in my workspace using the API. We have Premium and have generated an API key and granted read permissions accordingly. Requests to other endpoints work. However, I never get any values back with the following call. When I go to the repo online at Bitbucket, I find entries for the master branch.

2026-03-06 13_52_35.png2026-03-06 13_52_22-.png

 

What's the problem? How can I do it so that it works?

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2026

Hi @Jonas Lüthi 

Welcome to the Bitbucket Cloud community! :)

The parameters you've used are almost correct, they just need to be adjusted slightly.

This is the correct input:

  • https://api.bitbucket.org/2.0/workspaces/workspaceID/search/code?search_query=repo:reposlug customer

If executed in cURL directly with url encoding, that will look like this:

curl --request GET \
--url 'https://api.bitbucket.org/2.0/workspaces/workspaceID/search/code?search_query=repo%3Areposlug%20test' \
--header 'AuthGoesHere'

Hope this helps!

Cheers!

- Ben (Bitbucket Cloud Support)

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events