ListWebHooks – List webhooks

Updated at:

Lists the webhooks configured for a repository.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Obtain the endpoint: Use this endpoint to replace {domain} in the API request syntax.
  • Obtain a personal access token.
  • Obtain the organization ID from the Basic Information page in the Organization Management console. This parameter is required only for the Central edition.

Product

Resource

Required permission

Code Management

Webhook

Read-only

Request syntax

Central edition

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/repositories/{repositoryId}/webhooks

Region edition

GET https://{domain}/oapi/v1/codeup/repositories/{repositoryId}/webhooks

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Your 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

page

integer

query

No

The page number. Defaults to 1. In general, you should not use a page number greater than 150.

1

perPage

integer

query

No

The number of items per page. Defaults to 20. Valid values: 1 to 100.

20

Request examples

Central edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/organizations/60d54f3daccf2bbd6659f3ad/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/webhooks?page=1&perPage=20' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'GET' \
  'https://{domain}/oapi/v1/codeup/repositories/2813489 or 60de7a6852743a5162b5f957%2FDemoRepo/webhooks?page=1&perPage=20' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

object

createdAt

string

The time when the webhook was created.

2024-10-05T15:30:45Z

description

string

The description of the webhook.

Description text

enableSSLVerification

boolean

Whether SSL verification is enabled.

false

id

integer

The primary key ID of the webhook.

1

mergeRequestEvents

boolean

Whether merge request events trigger the webhook.

true

noteEvents

boolean

Whether comment events trigger the webhook.

true

pushEvents

boolean

Whether code push events trigger the webhook.

true

repositoryId

integer

The repository ID.

1

tagPushEvents

boolean

Whether tag push events trigger the webhook.

true

token

string

A custom token for webhook authentication.

xxx

updatedAt

string

The time when the webhook was last updated.

2024-10-05T15:30:45Z

url

string

The webhook URL.

http://example/example

Response example

{
    "createdAt": "2024-10-05T15:30:45Z",
    "description": "Description text",
    "enableSSLVerification": false,
    "id": 1,
    "mergeRequestEvents": true,
    "noteEvents": true,
    "pushEvents": true,
    "repositoryId": 1,
    "tagPushEvents": true,
    "token": "xxx",
    "updatedAt": "2024-10-05T15:30:45Z",
    "url": "http://example/example"
}

Response headers

Parameter

Description

Example value

x-next-page

The next page number.

3

x-page

The current page number.

2

x-per-page

The number of items per page.

20

x-prev-page

The previous page number.

1

x-request-id

The request ID.

37294673-00CA-5B8B-914F-A8B35511E90A

x-total

The total number of items.

50

x-total-pages

The total number of pages.

3

Error codes

For more information, see the error code center.