Webhook event list
- Print
- PDF
Webhook event list
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Available in Classic and VPC
The following events can be registered in your webhook.
Note
- If you select an event type, all sub-actions are detected.
- You can't select each sub-action of an event type separately.
Caution
If you've created a new branch, only the create event occurs, and the push event does not occur.
Event type | Description | Sub-action | Reference for how to run action |
---|---|---|---|
push | One or more commits push in repository |
| Use Git client |
pull_request | Pull Request tasks |
| Manage repository - Use pull request |
create | Create branch or tag |
| Manage repository - Manage branch |
delete | Delete branch or tag |
| Manage repository - Manage branch |
meta | Delete webhook | N/A | Use webhook - Delete webhook |
repository | Change repository properties |
| Manage repository - Change repository settings |
file_safer | Complete File Safer malware scan |
| File Safer malware scan |
file_lock | Use (LFS) file lock |
| Lock file |
Configuring webhook payload
A webhook payload means the actual data delivered when the webhook is called.
Caution
- If the payload data size is larger than 65,535 bytes, normal webhook calls are not possible.
- If the Content Type is set to application/x-www-form-urlencoded , the entire payload data is sent to the value corresponding to the 'payload' key in the request body.
Webhook payload format
The format of webhook payload configuration is as follows: The event
key differs by the event type, and the version
, repository
, sender
, and timestamp
hold the consistent format.
{
"version": <Webhook version>,
"repository": {
"id": <Repository ID>,
"name": <Repository name>,
"description": <Repository description>,
"ssh_url": <Repository git ssh address>,
"https_url": <Repository git https address>,
"portaladdr": <Repository portal address>
"created_at": <Creation date>,
"owner": <Creator>
},
"sender": <Sender information>,
"event": {
"type": <Event type>
"payload": <Event information>
},
"timestamp": <Time information>
}
Key | Type | Description | Remarks |
---|---|---|---|
version | string | SourceCommit webhook version | The latest webhook version is "v1" |
repository.id | number | Repository id value | |
repository.name | string | Repository name | |
repository.description | string | Repository description | |
repository.ssh_url | string | Repository git ssh address | |
repository.https_url | string | Repository git https address | |
repository.portaladdr | string | Repository portal address | |
repository.created_at | number | Repository creation date | timestamp |
repository.owner | string | User who created repository | |
sender | object | Sender information | Reference: Sender information format |
event.type | string | Event type | Reference: Webhook event |
event.payload | object | Event information | Reference: Details by event |
timestamp | number | Webhook occurrence time unix timestamp |
Sender information format
The sender information format is as follows:
If the event has occurred using https git address
{ "mbrNo": <member-no>, "user_id": <user-id>, "id_no" : <id-No> }
If the event has occurred using SSH git address
{ "mbrNo": <member-no>, "type": "Tenant" | "SubAccount", "user_id" : <user-id> // Provided only in case of subaccount }
If using file_safer event
{ "mbrNo": <member-no>, "type": "system", }
Key | Type | Description | Remarks |
---|---|---|---|
mbrNo | string | Customer number | |
id_no | string | Customer identification value | |
user_id | string | User id |
Full example of payload
The following is an example of event.type=create.
{
"version": "v1",
"repository": {
"id": 123456,
"name": "test-name",
"description": "test-description",
"ssh_url": "ssh://devtools.ncloud.com/test/test-repo.git",
"https_url": "https://devtools.ncloud.com/test/test-repo.git",
"portaladdr": "https://devtools.ncloud.com/test/test-repo",
"created_at": 1662524215000,
"owner": "test@sample.com"
},
"sender": {
"mbrNo": "123456789",
"id_no": "aaaaaaaaa-bbbb-cccc-dddd-eeeeeeeeee",
"user_id": "test-user"
},
"timestamp": 1663208183206,
"event": {
"type": "create",
"payload": {
"ref": "refs/heads/<branch name>",
"type": "branch",
"name": <branch-name>,
"action": "created",
"before": "0000000000000000000000000000000000000000",
"after": "ce7c990a1e8762d13e5ef0dc98e605e7c0bd75ec",
"sender": {
"protocol": "https",
"user_id": <user id>,
"id_no": <id-no>
},
"head_commit": [
{
"hash_id": "ce7c990a1e8762d13e5ef0dc98e605e7c0bd75ec",
"tree_id": "b9daacb4ab18228adf369b71b02eae916a00e081",
"parent_hash_id": "7b287cee698ca0a0f8df15a8b6133e895ba9e9bb",
"timestamp": "1655899275",
"author": {
"author_name": <author name>
},
"committer": {
"committer_name": <committer name>
},
"commit_message": <commit message>
}
]
}
}
}
Details by event
The following describes event formats in webhook payload that differ depending on the event type.
Push event details and examples
{
"type": "push",
"payload": {
"ref": "refs/heads/<branch name>",
"action": "commit",
"before": "c3b67b4527cb196da2195082794cca1643aa7bba",
"after": "0eb7c3a853eb50ada35f8dc96ae796ba404d1485",
"sender": {
"protocol": "https",
"user_id": <user id>,
"id_no": <id-no>
},
"head_commit": [
{
"hash_id": "0eb7c3a853eb50ada35f8dc96ae796ba404d1485",
"tree_id": "d038fe14f2da4ac2227b982a20891a32fb8ae99c",
"parent_hash_id": "71e03a954a845240b1944fdc93b9606adce98cc1",
"timestamp": "1655899919",
"author": {
"author_name": <author name>
},
"committer": {
"committer_name": <committer name>
},
"commit_message": <commit message>
}
],
"commits": [
{
"hash_id": "0eb7c3a853eb50ada35f8dc96ae796ba404d1485",
"tree_id": "d038fe14f2da4ac2227b982a20891a32fb8ae99c",
"parent_hash_id": "71e03a954a845240b1944fdc93b9606adce98cc1",
"timestamp": "1655899919",
"author": {
"author_name": <author name>
},
"committer": {
"committer_name": <committer name>
},
"commit_message": <commit message>
}
]
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "push" |
payload.ref | string | Push target ref information | |
payload.action | string | Sub-action | "commit" |
payload.before | string | Previous sha value | |
payload.after | string | Next sha value | |
payload.sender | object | Sender information |
|
payload.head_commit | array | head commit of pushed commit | |
payload.head_commit[*].hash_id | string | hash_id of commit | |
payload.head_commit[*].tree_id | string | tree_id of commit | |
payload.head_commit[*].parent_hash_id | string | parent_hash_id of commit | |
payload.head_commit[*].timestamp | string | timestamp of commit | |
payload.head_commit[*].author.author_name | string | author_name of commit | |
payload.head_commit[*].committer.committer_name | string | committer_name of commit | |
payload.commits | array | pushed commit list | The newest commit starts from index 0 |
payload.commits[*].commit_message | string | commit_message of commit | |
payload.commits[*].hash_id | string | hash_id of commit | |
payload.commits[*].tree_id | string | tree_id of commit | |
payload.commits[*].parent_hash_id | string | parent_hash_id of commit | |
payload.commits[*].timestamp | string | timestamp of commit | |
payload.commits[*].author.author_name | string | author_name of commit | |
payload.commits[*].committer.committer_name | string | committer_name of commit | |
payload.commits[*].commit_message | string | commit_message of commit |
Create event details and examples
{
"type": "create",
"payload": {
"ref": "refs/heads/<branch name>",
"type": "branch",
"name": <branch-name>,
"action": "created",
"before": "0000000000000000000000000000000000000000",
"after": "ce7c990a1e8762d13e5ef0dc98e605e7c0bd75ec",
"sender": {
"protocol": "https",
"user_id": <user id>,
"id_no": <id-no>
},
"head_commit": [
{
"hash_id": "ce7c990a1e8762d13e5ef0dc98e605e7c0bd75ec",
"tree_id": "b9daacb4ab18228adf369b71b02eae916a00e081",
"parent_hash_id": "7b287cee698ca0a0f8df15a8b6133e895ba9e9bb",
"timestamp": "1655899275",
"author": {
"author_name": <author name>
},
"committer": {
"committer_name": <committer name>
},
"commit_message": <commit message>
}
]
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "create" |
payload.ref | string | Push target ref information | |
payload.type | string | Creation target type | "branch" or "tag" |
payload.action | string | Sub-action | "created" |
payload.before | string | Previous sha value | |
payload.after | string | Next sha value | |
payload.sender | object | Sender information |
|
payload.head_commit | array | head commit of pushed commit | |
payload.head_commit[*].hash_id | string | hash_id of commit | |
payload.head_commit[*].tree_id | string | tree_id of commit | |
payload.head_commit[*].parent_hash_id | string | parent_hash_id of commit | |
payload.head_commit[*].timestamp | string | timestamp of commit | |
payload.head_commit[*].author.author_name | string | author_name of commit | |
payload.head_commit[*].committer.committer_name | string | committer_name of commit |
Delete event details and examples
{
"type": "delete",
"payload": {
"ref": "refs/heads/<branch name>",
"type": "branch",
"name": <branch-name>,
"action": "deleted",
"before": "68ed6fc3e2cdf74af0fa1b3591ff593d1e28a4cb",
"after": "0000000000000000000000000000000000000000",
"sender": {
"protocol": "https",
"user_id": <user id>,
"id_no": <id-no>
},
"head_commit": [
{
"hash_id": "ce7c990a1e8762d13e5ef0dc98e605e7c0bd75ec",
"tree_id": "b9daacb4ab18228adf369b71b02eae916a00e081",
"parent_hash_id": "7b287cee698ca0a0f8df15a8b6133e895ba9e9bb",
"timestamp": "1655899275",
"author": {
"author_name": <author name>
},
"committer": {
"committer_name": <committer name>
},
"commit_message": <commit message>
}
]
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "delete" |
payload.ref | string | Push target ref information | |
payload.type | string | Creation target type | "branch" or "tag" |
payload.action | string | Sub-action | "deleted" |
payload.before | string | Previous sha value | |
payload.after | string | Next sha value | |
payload.sender | object | Sender information |
|
payload.head_commit | array | head commit of pushed commit | |
payload.head_commit[*].hash_id | string | hash_id of commit | |
payload.head_commit[*].tree_id | string | tree_id of commit | |
payload.head_commit[*].parent_hash_id | string | parent_hash_id of commit | |
payload.head_commit[*].timestamp | string | timestamp of commit | |
payload.head_commit[*].author.author_name | string | author_name of commit | |
payload.head_commit[*].committer.committer_name | string | committer_name of commit |
pull_request event details and examples
{
"type": "pull_request",
"payload": {
"action": "opened" | "closed" | "merged" | "edited" | "updated_head",
"pull_request_number": 10,
"pull_request_title": <pull request name>,
"pull_request_description": <pull request description>,
"auto_merge_enable": true,
"from": {
"branch": "sub",
"sha": <sha>
},
"to": {
"branch": "master",
"sha": <sha>
},
"sender": {
"user_id": <user id>
},
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "pull_request" |
payload.action | string | Sub-action |
|
payload.pull_request_number | number | Pull request number | |
payload.pull_request_title | string | Pull request title | |
payload.pull_request_description. | string | Pull request description | |
payload.auto_merge_enable | boolean | Whether you can merge without clash | Provided only when payload.action is 'opened' and 'updated_head' |
from.branch | string | from branch name | |
from.sha | string | from branch sha value | |
to.branch | string | to branch name | |
to.sha | string | to branch sha value | |
sender.user_id | string | User id value |
Meta event details and examples
{
"type": "meta",
"payload": {
"webhook": {
"id": <webhook id>,
"name": <webhook name>
}
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "meta" |
payload.webhook.id | number | Webhook id value | |
payload.webhook.name | string | Webhook name |
Repository event details and examples
{
"type": "repository",
"payload": {
"action": "edited",
"sender": {
"user_id": <user id>
},
"before": {
"description": "before description",
"file_safer": true
},
"after": {
"description": "after description",
"file_safer": false
}
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "repository" |
payload.action | string | Sub-action | "edited" |
payload.sender.user_id | string | User id | |
payload.before.description | string | Pre-edit repository description | |
payload.before.file_safer | boolean | Pre-edit file safer use status | |
payload.after.description | string | Post-edit repository description | |
payload.after.file_safer | boolean | Post-edit file safer use status |
file_safer event details and examples
{
"type": "file_safer",
"payload": {
"target_hash": "123456117f77a541bdcb68d36234dbb317c7f1f7",
"action": "done",
"total_file_count": 1,
"infected_file_count": 0,
"request_date": "2022-09-14T11:24:28.000Z",
"complete_date": "2022-09-14T11:24:40.000Z"
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "file_safer" |
payload.target_hash | string | Target hash value | |
payload.action | string | Sub-action | done |
payload.total_file_count | number | Total number of scanned files | |
payload.infected_file_count | number | Total number of malicious files | |
payload.request_date | string | File scan request time | |
payload.complete_date | string | File scan completion time |
file_lock event details and examples
{
"type": "file_lock",
"payload": {
"action": "create",
"sender": {
"user_id": <user id>
},
"path": "file.txt",
"locked_time": "2022-01-01 00:00:00.00",
"unlocked_time": "2022-01-01 00:00:00.00"
}
}
Key | Type | Description | Remarks |
---|---|---|---|
type | string | Event type | "file_lock" |
payload.action | string | Sub-action |
|
payload.sender.user_id | string | User id | |
path | string | File path | |
locked_time | string | Locked time | Provided only when action is create |
unlocked_time | string | Unlocked time | Provided only when action is delete |
Was this article helpful?