DeleteRepositoryWebhook

Updated at:

Deletes a webhook in a code repository.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

DELETE /repository/{repositoryId}/hooks/{hookId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

repositoryId

integer

Yes

The ID of the code repository.

2369234

hookId

integer

Yes

The ID of the webhook.

524836

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The enterprise ID in string format. You can obtain the ID from the Apsara DevOps URL, such as https://devops.aliyun.com/organization/[OrganizationId].

60de7a6852743a5162b5f957

accessToken

string

No

The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or Security Token Service (STS) for temporary authorization.

f0b1e61db5961df5975a93f9129d2513

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The ID of the request.

F7B85D1B-D1C2-140F-A039-341859F130B9

errorMessage

string

The error message.

""

errorCode

string

The error code.

SYSTEM_UNKNOWN_ERROR

success

boolean

Indicates whether the call was successful.

true

result

object

The returned result.

id

integer

The unique identifier of the webhook.

524836

url

string

The URL of the webhook.

https://xxxxx

createdAt

string

The creation time in the YYYY-MM-DD HH:mm:ss format.

2022-03-18 14:24:54

projectId

integer

The ID of the code repository.

2369234

pushEvents

boolean

Specifies whether branch push events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

true

issuesEvents

boolean

Specifies whether issue events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

false

mergeRequestsEvents

boolean

Specifies whether merge request events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

true

tagPushEvents

boolean

Specifies whether tag push events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

true

buildEvents

boolean

Specifies whether build events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

false

noteEvents

boolean

Specifies whether comment events are subscribed to. Valid values:

  • true: Subscribed.

  • false: Not subscribed.

true

enableSslVerification

boolean

Specifies whether SSL verification is enabled. Valid values:

  • true: Enabled.

  • false: Disabled.

false

lastTestResult

string

The last execution result. Valid values:

  • ok: Successful.

  • error: Failed.

  • "": Empty string.

""

description

string

The description of the webhook.

Webhook description content

secretToken

string

The custom token used for identity verification.

webhook-demo-token

type

string

The type of the webhook. Valid values:

  • ProjectHook: Code repository webhook.

  • OrganizationHook: Enterprise webhook.

ProjectHook

Examples

Success response

JSON format

{
  "requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
  "errorMessage": "\"\"",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "success": true,
  "result": {
    "id": 524836,
    "url": "https://xxxxx",
    "createdAt": "2022-03-18 14:24:54",
    "projectId": 2369234,
    "pushEvents": true,
    "issuesEvents": false,
    "mergeRequestsEvents": true,
    "tagPushEvents": true,
    "buildEvents": false,
    "noteEvents": true,
    "enableSslVerification": false,
    "lastTestResult": "\"\"",
    "description": "Webhook description content",
    "secretToken": "xxxx",
    "type": "ProjectHook"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.AccessDenied The user is not authorized to perform the operation. The user is not authorized to perform the operation.
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.