I'm trying to work out how to add an SSH key to a Workspace.
There is this documentation for adding an SSH key to a User: https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Bselected_user%7D/ssh-keys#post
But I can't find anything for the Workspace, this call only adds an SSH key to my user.
When performing the action using the UI in a browser the users/%7Bselected_user%7D/ssh-keys call appears to happen, but I can't work out what is making it get added to the Workspace instead of the User.
Any help appreciated.
What is your reason for adding an SSH to a workspace?
SSH keys are only meant to be added for users.
The closest thing to what I think you're looking for is called Access Keys. You can upload SSH keys for each individual repository to enable `git clone` and `git pull` (read only) access only. This is useful for running tests or for deploying.
At the moment this is repository by repository. However, hopefully we'll have a solution for group the same repository settings for a project (a collection of repositories).
Hi @seanaty,
We use git submodules, so are generating a Pipeline SSH Key for a repository, then adding the generated public key to the Workspace SSH keys, so Bitbucket Pipelines can access other repositories during a build.
Creating the Pipeline SSH Key is possible via this endpoint: https://api.bitbucket.org/internal/repositories/<workspace>/<repo>/pipelines_config/ssh/key_pair/generate
When I create a Workspace SSH key via the UI it calls this endpoint:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.