EnableDeployKey - Enable Deployment Key

Updated at:

Enables a deployment key using OpenAPI.

Applicable editions

Central edition, Region edition

Endpoints and Authorization Information

  • Obtain endpoints: Replace the `{domain}` placeholder in the request syntax.
  • Obtain a personal access token.
  • Obtain the organizationId: This parameter is required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain the organization ID.

Product

Resource

Required Permissions

Code Management

Deployment Key

Request Syntax

Central edition

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

Region edition

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

Request Headers

Parameter

Type

Required

Description

Example Value

x-yunxiao-token

string

Yes

The 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

The organization ID.

60d54f3daccf2bbd6659f3ad

repositoryId

string

path

Yes

The repository ID or the URL-encoded full path.

2813489 or 60de7a6852743a5162b5f957%2FDemoRepo

keyId

number

path

Yes

The deployment key ID.

2813489

Request Examples

Central edition

curl -X 'POST' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489%2For%2F60de7a6852743a5162b5f957%2FDemoRepo/keys/2813489/enable' \
  -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/2813489or60de7a6852743a5162b5f957%2FDemoRepo/keys/2813489/enable' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response Parameters

Parameter

Type

Description

Example Value

-

object

result

boolean

Indicates whether the deployment key is enabled successfully.

true

Response Example

{
    "result": true
}

Error Codes

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