Webhooks
Please note that to interact with webhooks via API, you must have administrator rights in the project.
Description of the JSON object structure describing a webhook
| Field | Type | Description | 
|---|---|---|
| id | string | Unique webhook ID | 
| url | string | URL where JSON events will be sent | 
| secret | string | Webhook secret | 
| projectId | string | Project ID | 
| createdAt | string | Webhook creation date in UTC format | 
| updatedAt | string | Webhook update date in UTC format | 
| events | Object | Webhook events | 
Description of the JSON object structure describing webhook events
| Field | Type | Description | 
|---|---|---|
| COLLABORATOR_ADD | boolean | Adding a collaborator to the project | 
| COLLABORATOR_DELETE | boolean | Removing a collaborator from the project | 
| COLLABORATOR_UPDATE | boolean | Updating collaborator status in the project | 
| ISSUE_UPDATE | boolean | Issue update | 
| ISSUE_CREATE | boolean | Issue creation | 
| NEW_ISSUE_NOTE | boolean | New comment on issue | 
| TAG_DELETE | boolean | Tag deletion | 
| TAG_CREATE | boolean | Tag creation | 
| BRANCH_UPDATE | boolean | Branch update | 
| BRANCH_DELETE | boolean | Branch deletion | 
| BRANCH_CREATE | boolean | Branch creation | 
| MERGE_REQUEST_CREATE | boolean | Merge request creation | 
| MERGE_REQUEST_UPDATE | boolean | Merge request update | 
| MERGE | boolean | Merge | 
| MERGE_REQUEST_CLOSE | boolean | Merge request closure | 
| MERGE_REQUEST_CANCEL | boolean | Merge request cancellation | 
| MERGE_REQUEST_ACCEPT | boolean | Merge request approval | 
| DISCUSSION_CREATE | boolean | Discussion creation in merge request | 
| DISCUSSION_COMMENT_CREATE | boolean | Comment creation in discussion in merge request | 
| PIPELINE_NEW | boolean | New pipeline | 
| PIPELINE_SUCCESS | boolean | Successful pipeline | 
| PIPELINE_FAIL | boolean | Pipeline failure | 
| WEBHOOK_SEND | boolean | Webhook sent | 
View project webhooks
GET /project/{ownerAlias}/{projectAlias}/setting/webhook
The request returns an array of webhooks, with the ability to configure the number of displayed objects per page
| Path variable | Type | Description | 
|---|---|---|
| ownerAlias | String | Owner alias | 
| projectAlias | String | Project alias | 
Responses
STATUS 200 - JSON example:
Example response
    
{
    "_embedded": {
        "webhookList": [
            {
                "id": "e93b461a-aaaa-aaaa-aaaa-306c3578c989",
                "url": "https://example.com",
                "secret": "SOME SECRET CODE",
                "events": {
                    "COLLABORATOR_DELETE": true,
                    "NEW_ISSUE_NOTE": true,
                    "MERGE": true,
                    "ISSUE_UPDATE": true,
                    "TAG_DELETE": true,
                    "MERGE_REQUEST_CREATE": true,
                    "BRANCH_UPDATE": true,
                    "WEBHOOK_SEND": false,
                    "MERGE_REQUEST_ACCEPT": true,
                    "MERGE_REQUEST_CLOSE": true,
                    "DISCUSSION_CREATE": true,
                    "BRANCH_DELETE": true,
                    "MERGE_REQUEST_UPDATE": true,
                    "PIPELINE_NEW": true,
                    "ISSUE_CREATE": true,
                    "DISCUSSION_COMMENT_CREATE": true,
                    "TAG_CREATE": true,
                    "COLLABORATOR_ADD": true,
                    "MERGE_REQUEST_CANCEL": true,
                    "PIPELINE_SUCCESS": true,
                    "COLLABORATOR_UPDATE": true,
                    "BRANCH_CREATE": true,
                    "PIPELINE_FAIL": true
                },
                "projectId": "c94aedd2-aaaa-aaaa-aaaa-67fbf1112a82",
                "createdAt": "2024-03-19T09:56:16.376885Z",
                "updatedAt": "2024-03-21T10:10:07.336450Z"
            },
            {
                "id": "e93b461a-aaaa-aaaa-aaaa-306c3578c989",
                "url": "https://example.com",
                "secret": "SOME SECRET CODE",
                "events": {
                    "COLLABORATOR_DELETE": true,
                    "NEW_ISSUE_NOTE": true,
                    "MERGE": true,
                    "ISSUE_UPDATE": true,
                    "TAG_DELETE": true,
                    "WEBHOOK_SEND": false,
                    "MERGE_REQUEST_CREATE": true,
                    "BRANCH_UPDATE": true,
                    "MERGE_REQUEST_CLOSE": true,
                    "MERGE_REQUEST_ACCEPT": true,
                    "DISCUSSION_CREATE": true,
                    "BRANCH_DELETE": true,
                    "MERGE_REQUEST_UPDATE": true,
                    "PIPELINE_NEW": true,
                    "DISCUSSION_COMMENT_CREATE": true,
                    "ISSUE_CREATE": true,
                    "TAG_CREATE": true,
                    "COLLABORATOR_ADD": true,
                    "MERGE_REQUEST_CANCEL": true,
                    "PIPELINE_SUCCESS": true,
                    "COLLABORATOR_UPDATE": true,
                    "PIPELINE_FAIL": true,
                    "BRANCH_CREATE": true
                },
                "projectId": "c94aedd2-aaaa-aaaa-aaaa-67fbf1112a82",
                "createdAt": "2024-03-19T09:56:16.376885Z",
                "updatedAt": "2024-03-21T10:10:07.336450Z"
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}
    
  
STATUS 403 - No access rights.
STATUS 404 - No data found for the request.
View webhook by id
GET /project/{ownerAlias}/{projectAlias}/setting/webhook/{id}
The request returns a webhook
| Path variable | Type | Description | 
|---|---|---|
| ownerAlias | String | Owner alias | 
| projectAlias | String | Project alias | 
| id | String | Webhook ID | 
Responses
STATUS 200 - JSON example:
Example response
    
{
    "id": "e93b461a-aaaa-aaaa-aaaa-306c3578c989",
    "url": "https://example.com",
    "secret": "SOME SECRET CODE",
    "events": {
        "COLLABORATOR_DELETE": true,
        "NEW_ISSUE_NOTE": true,
        "MERGE": true,
        "ISSUE_UPDATE": true,
        "TAG_DELETE": true,
        "WEBHOOK_SEND": false,
        "MERGE_REQUEST_CREATE": true,
        "BRANCH_UPDATE": true,
        "MERGE_REQUEST_CLOSE": true,
        "MERGE_REQUEST_ACCEPT": true,
        "DISCUSSION_CREATE": true,
        "BRANCH_DELETE": true,
        "MERGE_REQUEST_UPDATE": true,
        "PIPELINE_NEW": true,
        "DISCUSSION_COMMENT_CREATE": true,
        "ISSUE_CREATE": true,
        "TAG_CREATE": true,
        "COLLABORATOR_ADD": true,
        "MERGE_REQUEST_CANCEL": true,
        "PIPELINE_SUCCESS": true,
        "COLLABORATOR_UPDATE": true,
        "PIPELINE_FAIL": true,
        "BRANCH_CREATE": true
    },
    "projectId": "c94aedd2-aaaa-aaaa-aaaa-67fbf1112a82",
    "createdAt": "2024-03-19T09:56:16.376885Z",
    "updatedAt": "2024-03-21T10:10:07.336450Z"
}
    
  
STATUS 403 - No access rights.
STATUS 404 - No data found for the request.
Create webhook
POST /project/{ownerAlias}/{projectAlias}/setting/webhook
The request creates a webhook
| Path variable | Type | Description | 
|---|---|---|
| ownerAlias | String | Owner alias | 
| projectAlias | String | Project alias | 
Request
Supported format: application/json
Note: You can skip some events by specifying only those you need.
POST request body structure:
    
{
    "url": "https://example.com",
    "secret": "SOME SECRET CODE",
    "events": {
        "COLLABORATOR_DELETE": true,
        "NEW_ISSUE_NOTE": true,
        "MERGE": true,
        "ISSUE_UPDATE": true,
        "TAG_DELETE": true,
        "WEBHOOK_SEND": false,
        "MERGE_REQUEST_CREATE": true,
        "BRANCH_UPDATE": true,
        "MERGE_REQUEST_CLOSE": true,
        "MERGE_REQUEST_ACCEPT": true,
        "DISCUSSION_CREATE": true,
        "BRANCH_DELETE": true,
        "MERGE_REQUEST_UPDATE": true,
        "PIPELINE_NEW": true,
        "DISCUSSION_COMMENT_CREATE": true,
        "ISSUE_CREATE": true,
        "TAG_CREATE": true,
        "COLLABORATOR_ADD": true,
        "MERGE_REQUEST_CANCEL": true,
        "PIPELINE_SUCCESS": true,
        "COLLABORATOR_UPDATE": true,
        "PIPELINE_FAIL": true,
        "BRANCH_CREATE": true
    }
}
    
Responses
STATUS 200 - JSON example:
Example response
    
    {
        "id": "28209e4d-aaaa-aaaa-aaaa-5ef23f559530",
        "url": "https://example.com",
        "secret": "SOME SECRET CODE",
        "events": {
            "COLLABORATOR_DELETE": true,
            "NEW_ISSUE_NOTE": true,
            "MERGE": true,
            "ISSUE_UPDATE": true,
            "TAG_DELETE": true,
            "WEBHOOK_SEND": false,
            "MERGE_REQUEST_CREATE": true,
            "BRANCH_UPDATE": true,
            "MERGE_REQUEST_CLOSE": true,
            "MERGE_REQUEST_ACCEPT": true,
            "DISCUSSION_CREATE": true,
            "BRANCH_DELETE": true,
            "MERGE_REQUEST_UPDATE": true,
            "PIPELINE_NEW": true,
            "DISCUSSION_COMMENT_CREATE": true,
            "ISSUE_CREATE": true,
            "TAG_CREATE": true,
            "COLLABORATOR_ADD": true,
            "MERGE_REQUEST_CANCEL": true,
            "PIPELINE_SUCCESS": true,
            "COLLABORATOR_UPDATE": true,
            "PIPELINE_FAIL": true,
            "BRANCH_CREATE": true
        },
        "projectId": "c94aedd2-aaaa-aaaa-aaaa-67fbf1112a82",
        "createdAt": "2024-05-03T20:35:35.895525Z",
        "updatedAt": "2024-05-03T20:35:35.895526Z"
    }
    
  
STATUS 403 - No access rights.
STATUS 404 - No data found for the request.
STATUS 422 - Request body failed server validation.
Update webhook by id
POST /project/{ownerAlias}/{projectAlias}/setting/webhook/{id}
The request updates a webhook by ID
| Path variable | Type | Description | 
|---|---|---|
| ownerAlias | String | Owner alias | 
| projectAlias | String | Project alias | 
| id | String | Webhook ID | 
Request
Supported format: application/json
Note: You can skip some events by specifying only those you need.
POST request body structure:
    
{
    "url": "https://example.com",
    "secret": "SOME SECRET CODE",
    "events": {
        "COLLABORATOR_DELETE": true,
        "NEW_ISSUE_NOTE": true,
        "MERGE": true,
        "ISSUE_UPDATE": true,
        "TAG_DELETE": true,
        "WEBHOOK_SEND": false,
        "MERGE_REQUEST_CREATE": true,
        "BRANCH_UPDATE": true,
        "MERGE_REQUEST_CLOSE": true,
        "MERGE_REQUEST_ACCEPT": true,
        "DISCUSSION_CREATE": true,
        "BRANCH_DELETE": true,
        "MERGE_REQUEST_UPDATE": true,
        "PIPELINE_NEW": true,
        "DISCUSSION_COMMENT_CREATE": true,
        "ISSUE_CREATE": true,
        "TAG_CREATE": true,
        "COLLABORATOR_ADD": true,
        "MERGE_REQUEST_CANCEL": true,
        "PIPELINE_SUCCESS": true,
        "COLLABORATOR_UPDATE": true,
        "PIPELINE_FAIL": true,
        "BRANCH_CREATE": true
    }
}
    
Responses
STATUS 200 - JSON example:
Example response
    
    {
        "id": "28209e4d-aaaa-aaaa-aaaa-5ef23f559530",
        "url": "https://example.com",
        "secret": "SOME SECRET CODE",
        "events": {
            "COLLABORATOR_DELETE": true,
            "NEW_ISSUE_NOTE": true,
            "MERGE": true,
            "ISSUE_UPDATE": true,
            "TAG_DELETE": true,
            "WEBHOOK_SEND": false,
            "MERGE_REQUEST_CREATE": true,
            "BRANCH_UPDATE": true,
            "MERGE_REQUEST_CLOSE": true,
            "MERGE_REQUEST_ACCEPT": true,
            "DISCUSSION_CREATE": true,
            "BRANCH_DELETE": true,
            "MERGE_REQUEST_UPDATE": true,
            "PIPELINE_NEW": true,
            "DISCUSSION_COMMENT_CREATE": true,
            "ISSUE_CREATE": true,
            "TAG_CREATE": true,
            "COLLABORATOR_ADD": true,
            "MERGE_REQUEST_CANCEL": true,
            "PIPELINE_SUCCESS": true,
            "COLLABORATOR_UPDATE": true,
            "PIPELINE_FAIL": true,
            "BRANCH_CREATE": true
        },
        "projectId": "c94aedd2-aaaa-aaaa-aaaa-67fbf1112a82",
        "createdAt": "2024-05-03T20:35:35.895525Z",
        "updatedAt": "2024-05-03T20:35:35.895526Z"
    }
    
  
STATUS 403 - No access rights.
STATUS 404 - No data found for the request.
Delete webhook
POST /project/{ownerAlias}/{projectAlias}/setting/webhook/{id}/delete
The request deletes a webhook by ID
| Path variable | Type | Description | 
|---|---|---|
| ownerAlias | String | Owner alias | 
| projectAlias | String | Project alias | 
| id | String | Webhook ID | 
Responses
STATUS 200 - Successfully deleted.
STATUS 403 - No access rights.
STATUS 404 - No data found for the request.
Automated translation!
This page was translated using automatic translation tools. The text may contain inaccuracies.