GetSSHKey - Query an SSH key

Updated at:

Queries the details of a single SSH key.

Applicable editions

Central edition, Region edition

Endpoints and authorization information

  • Obtain an endpoint: Replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID: Required only for the Central edition. Navigate to the Basic Information page in the Organization Management console to obtain the organization ID.

Product

Resource

Required permission

Code Management

SSH key

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/keys/{keyId}

Region edition

GET https://{domain}/oapi/v1/codeup/keys/{keyId}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

Your personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Position

Required

Description

Example

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

The organization ID.

60d54f3daccf2bbd6659f3ad

keyId

integer

path

Yes

The primary key ID of the SSH key.

1

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/keys/1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/keys/1' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

createdAt

string

The time when the key was created.

2024-10-05T15:30:45Z

expireTime

string

The expiration time.

2024-10-05T15:30:45Z

fingerPrint

string

The device fingerprint.

xxx

id

integer

The primary key ID of the SSH key.

1

key

string

The public key string of the SSH key.

xxx

keyScope

string

The permission scope. Valid values: ALL (clone, pull, and push) and READ (clone and pull only).

ALL

lastUsedTime

string

The time when the key was last used.

2024-10-05T15:30:45Z

title

string

The title of the SSH key.

username@example

updatedAt

string

The time when the key was last updated.

2024-10-05T15:30:45Z

Response example

{
    "createdAt": "2024-10-05T15:30:45Z",
    "expireTime": "2024-10-05T15:30:45Z",
    "fingerPrint": "xxx",
    "id": 1,
    "key": "xxx",
    "keyScope": "ALL",
    "lastUsedTime": "2024-10-05T15:30:45Z",
    "title": "username@example",
    "updatedAt": "2024-10-05T15:30:45Z"
}

Error codes

For more information, see Error Code Center.