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

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)

Suggest an answer

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

Atlassian Community Events