DisableDeployKey - Disable Deploy Key

Updated at:

You can use OpenAPI to disable a deploy key.

Applicable editions

Central edition, Region edition

Endpoints and Authorization Information

  • Obtain the service endpoint. This endpoint is used to replace the {domain} placeholder in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID. This parameter is required only for the Central edition. You can obtain the organization ID from the Basic Information page in the Organization Management console.

Product

Resource

Permissions Required

Code Management

Deploy Key

Request Syntax

Central edition

POST https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/keys/{keyId}/disable

Region edition

POST https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/keys/{keyId}/disable

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

repositoryId

string

path

Yes

Repository ID or URL-encoded full path.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

keyId

number

path

Yes

Deploy key ID.

2813489

Request Examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/keys/2813489/disable' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/repositories/{namespace_id_or_uuid}%2FDemoRepo/keys/2813489/disable' \
  -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

fingerPrint

string

Deploy key fingerprint.

xxx

id

integer

Deploy key ID.

1

key

string

Deploy key.

xxx

title

string

The title of the deployment key.

username@example

Response Examples

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

Error Codes

For more information about API error codes, see the error code center.