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).
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:
Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events