Skip to main content
POST
/
api
/
v1
/
credentials
/
digitalocean
/
ssh-key
Create an SSH key credential
import requests

url = "https://platform.ankra.app/api/v1/credentials/digitalocean/ssh-key"

payload = { "name": "<string>" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};

fetch('https://platform.ankra.app/api/v1/credentials/digitalocean/ssh-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request POST \
--url https://platform.ankra.app/api/v1/credentials/digitalocean/ssh-key \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'
{
  "errors": [],
  "id": "<string>",
  "name": "<string>",
  "private_key": "<string>",
  "success": true
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null
x-ankra-organisation-id
string | null

Body

application/json
name
string
required
generate
boolean
default:false
ssh_public_key
string | null

Response

SSH key credential created successfully

errors
ResourceError · object[]
id
string<uuid4> | null
name
string | null
private_key
string | null
success
boolean
default:true