keys

Retrieve user by SSH key ID

Retrieves user by SSH key ID. Administrators only.

get/api/v4/keys/{id}

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID of an SSH key

Response

Retrieve user by SSH key ID

idinteger required
titlestring required
created_atstring date-time required
expires_atstring date-time required
last_used_atstring date-time required
keystring required
usage_typestring required

Example response

{
  "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",
  "user": {
    "id": 1,
    "username": "admin",
    "public_email": "john@example.com",
    "name": "Administrator",
    "state": "active",
    "avatar_url": "https://gravatar.com/avatar/1",
    "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
    "custom_attributes": [
      {
        "key": "foo",
        "value": "bar"
      }
    ],
    "web_url": "https://gitlab.example.com/root",
    "last_sign_in_at": "2015-09-03T07:24:01.670Z",
    "confirmed_at": "2015-09-03T07:24:01.670Z",
    "last_activity_on": "2015-09-03T07:24:01.670Z",
    "email": "john@example.com",
    "theme_id": 2,
    "color_scheme_id": 1,
    "projects_limit": 10,
    "current_sign_in_at": "2015-09-03T07:24:01.670Z",
    "can_create_group": true,
    "can_create_project": true,
    "two_factor_enabled": true,
    "preferred_language": "en"
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.