I have SSH keys in my BitBucket account, and I would like to be able to manage them via the API, but the ssh-keys endpoint doesn't work:
$ curl -H "Authorization: Bearer redacted" http://redacted/rest/api/1.0/users/evans.tucker | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 239 0 239 0 0 239 0 --:--:-- --:--:-- --:--:-- 5311
{
"name": "evans.tucker",
"emailAddress": "evans.tucker@iovation.com",
"id": redacted,
"displayName": "Evans Tucker",
"active": true,
"slug": "evans.tucker",
"type": "NORMAL",
"links": {
"self": [
{
"href": "https://redacted/users/evans.tucker"
}
]
}
}
$ curl -H "Authorization: Bearer redacted" http://redacted/rest/api/1.0/users/evans.tucker/ssh-keys
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://redacted/rest/api/1.0/users/evans.tucker/ssh-keys</message></status>$
$
Hi Evans,
Are you using a Bitbucket Server (self-hosted by your company) or a Bitbucket Cloud (available on bitbucket.org) version of Bitbucket?
In case of Bitbucket Server, the following applies:
- these are the available REST API endpoints for ssh keys: SSH rest. As an example, a valid end point will look as the following one:
http://example.com/rest/keys/1.0/ssh/{keyId}
The one in your example looks similar to the bitbucket.org version (see some examples here).
- Which authentication method are you using? If you are using an access token, these can only be used for very specific operations on projects and repositories and these will depend on the permission level of the user (see Personal access tokens for more details).
Thanks, Caterina - Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.