DeleteSSHKey - Delete SSH Key

Updated at:

Deletes a specified SSH key.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

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

Product

Resource

Required permission

Code Management

SSH keys

Read-write

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

60d54f3daccf2bbd6659f3ad

keyId

string

path

Yes

Primary key ID of the SSH key.

1

Request examples

Central edition

curl -X 'DELETE' \
  '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 'DELETE' \
  '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 value

-

object

createdAt

string

Creation time.

2024-10-05T15:30:45Z

expireTime

string

Expiration time.

2024-10-05T15:30:45Z

fingerPrint

string

Key fingerprint.

xxx

id

integer

Primary key ID of the SSH key.

1

key

string

Public key string of the SSH key.

xxx

keyScope

string

Access scope. Valid values: ALL (read/write operations including clone/pull/push) and READ (clone/pull only).

ALL

lastUsedTime

string

Last used time.

2024-10-05T15:30:45Z

title

string

Title of the SSH key.

username@example

updatedAt

string

Update time.

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 API error codes, see Error Code Center.