Hello,
I've been trying to use the API workspace search [1] endpoint to query our workspace.
This works fine when I use my username and an app password but won't work when using a workspace access token [2].
Are there known restrictions applying here?
I've tried it with a `repository` only scoped token as well as with a `account`, `project` and `repository` scoped token but neither would return any results.
I'd be grateful for any help.
Thank you
Olivier
1: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-other-operations/#api-workspaces-workspace-search-code-get
2: https://support.atlassian.com/bitbucket-cloud/docs/workspace-access-token-permissions/
G'day, @Olivier
Welcome to the community!
We currently don't support WAT for code search. We. have an existing feature request that I highly suggest you Vote on and Watch to keep an eye out for any updates at
https://jira.atlassian.com/browse/BCLOUD-22586
Unfortunately, the workaround is to use App password or OAuth access token as your authentication method.
Regards,Syahrul
Hello @Olivier
Workspace access tokens in Bitbucket are scoped for specific operations, and it seems the API search endpoint may require additional permissions not granted by these tokens.
I would recommend to ensure your token includes all necessary scopes (repository, project, and account) and matches the endpoint's requirements.
If the issue persists despite proper token configuration, it might be a limitation of the current API functionality.
Hello Syahrul,
Thank you for confirming that this isn't an issue on my side. I have upvoted the issue.
Maybe the docs could also mention this? It's currently not clear as it only mentions the `repository` scope as necessary for the search.
Cheers,
Hey @Olivier
Thanks for the update. I've raised an internal request to get the documentation updated.
Cheers,Syahrul
It looks like you're new here. Sign in or register to get started.