Add an SSH key for a user
POST
/api/v4/users/{user_id}/keys
Adds an SSH key for a specified user account. Administrators only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
integer
The ID of the user
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
key
required
The new SSH key
string
title
required
The title of the new SSH key
string
expires_at
The expiration date of the SSH key in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ)
string format: date-time
usage_type
Scope of usage for the SSH key
string
Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
integer format: int64
title
string
created_at
string format: date-time
expires_at
string format: date-time
last_used_at
string format: date-time
key
string
usage_type
string
Example
{ "id": 1, "title": "Sample key 25", "created_at": "2015-09-03T07:24:44.627Z", "expires_at": "2020-09-03T07:24:44.627Z", "last_used_at": "2020-09-03T07:24:44.627Z", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1256k6Yjz\\\n GGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCdd\\\n NaP0L+hM7zhFNzjFvpaMgJw0=", "usage_type": "auth"}Bad Request
Not Found