How to create/add ssh-keys inside the repository via REST API?

Sugar Ray Tenorio
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!
October 10, 2023

I tried this API endpoint:

data = {
"label": "new-ssh-key",
"key": "ssh-rsa blah blah"
}
and authenticated using Oath2.
The response is this:
"{\"type\": \"error\", \"error\": {\"message\": \"Resource not found\", \"detail\": \"There is no API hosted at this URL.\\n\\nFor information about our API's, please refer to the documentation at: https://developer.atlassian.com/bitbucket/api/2/reference/\"}}"
what is the correct endpoint? I can't find it on the REST API docs.

1 answer

1 vote
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2023

G'day @Sugar Ray Tenorio 

I believe the endpoint you are looking for is the following:

Add a repository deploy key 

This should add the SSH key on the repository level. The location of this in UI is under Repository settings > Access keys

I hope this helps

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events