What Is a Generic Webhook's Data Structure?
Information sent by a generic webhook is delivered with a POST request that
has the application/json
content-type, and the UTF-8 character set, in a
Message
object.
These are the Message
object's fields:
Field | Description |
---|---|
|
Version of the API that changes when the payload format of the request changes |
|
Unique identifier of the message |
|
Timestamp of the message when it was generated |
|
Set to |
|
Unique identifier of the project |
|
List of events delivered by the message |
Each event
delivered by the message follows a common structure.
These are its fields:
Field | Description |
---|---|
|
Type of the event ( |
|
Unique identifier of the project |
|
Timestamp of the event |
|
Data specific to the type of the event |
The structure of data
of each event type is described in the following sections.
ISSUE Event
The ISSUE
event contains these fields:
Field | Description |
---|---|
|
Type of the activity ( |
|
Timestamp of the activity |
|
Description of the change |
|
Description of the issue after the change |
|
Issue ID |
|
Change version |
|
URL of the issue |
|
Title of the issue |
|
Type of the issue ( |
|
Resolution of the issue. The value is |
|
User who reported the issue |
|
User to whom the issue is assigned |
|
Content of the added comment, available if the activity type is |
|
List of changed fields, available if the activity type is |
|
Field name |
|
Value before the change |
|
Value after the change |
Here's a JSON payload example for an issue create event:
{
"apiVersion": "1.0",
"messageId": "04abc282-a44e-4c23-ba53-15b519d30066",
"projectId": "qa-dev_example-project",
"testEvent": false,
"timestamp": 1417810876408,
"events": [
{
"eventId": "ISSUE",
"projectId": "example-project",
"timestamp": 1417810876,
"data": {
"activities": [
{
"type": "CREATED",
"date": 1417810875820,
"description": "",
"author": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
},
"issue": {
"id": 2,
"resolution": null,
"title": "Test Issue",
"type": "Feature",
"url": "http://test-server/#projects/example-project/task/2",
"version": "1417810875834",
"reporter": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
}
}
}
]
}
}
]
}
Here's a JSON payload example for an issue update event:
{
"apiVersion": "1.0",
"messageId": "ccce183e-097d-4668-a07b-cf762108716e",
"projectId": "qa-dev_example-project",
"testEvent": false,
"timestamp": 1417811058243,
"events": [
{
"eventId": "ISSUE",
"projectId": "example-project",
"timestamp": 1417811058
"data": {
"activities": [
{
"type": "UPDATED"
"date": 1417811057698,
"description": "Assign to alex.admin\nset Resolution to FIXED\nset Status to RESOLVED\n",
"author": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
},
"issue": {
"id": 2,
"resolution": "FIXED",
"title": "Test Issue",
"type": "Feature",
"url": "http://test-server/#projects/example-project/task/2",
"version": "1417811057698",
"asignee": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
},
"reporter": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
}
},
"fieldUpdates": [
{
"name": "assigned_to",
"newValue": "alex.admin",
"oldValue": ""
},
{
"name": "resolution",
"newValue": "FIXED",
"oldValue": ""
},
{
"name": "bug_status",
"newValue": "RESOLVED",
"oldValue": "UNCONFIRMED"
}
]
},
{
"type": "COMMENTED"
"date": 1417811057929,
"description": "Feature is implemented",
"author": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
},
"comment": {
"author": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
},
"date": 1417811057929,
"text": "Feature is implemented",
"type": "UNKNOWN"
},
"task": {
"id": 2,
"resolution": "FIXED",
"title": "Test Issue",
"type": "Feature",
"url": "http://test-server/#projects/qa-dev_example-project/task/2",
"version": "1417811057698",
"asignee": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Alex Admin"
},
"reporter": {
"gravatarHash": "8940829abebbc5d8d84e37af7161fd31",
"loginName": "alex.admin",
"realName": "Alex Admin"
}
}
}
]
}
}
]
}
PUSH Event
The PUSH
event contains these fields:
Field | Description |
---|---|
|
Updated references |
|
Commits of the Push event |
|
Commit identifier |
|
Comment in the commit |
|
Author of the commit |
|
Timestamp of the commit |
|
List of commit parent identifiers |
|
Name of the repository to which the commit was pushed |
Here's a JSON payload example for a Git Push event:
{
"apiVersion": "1.0",
"messageId": "c3378be6-6be5-4191-9b20-1fb5d429bfce",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1417810424512,
"events": [
{
"eventId": "GIT_PUSH",
"projectId": "example-project",
"timestamp": 1417810424,
"data": {
"refName": "refs/heads/main",
"commits": [
{
"sha": "32e03bc46a3a42eeab5dd25144a90c5b4f0b2e11",
"repository": "example-project.git",
"date": 1417810387000,
"comment": "file1.txt deleted, file3.txt created\n",
"author": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Admin",
"username": "alex.admin"
},
"parents": [
"1106e8c81cb49e71024e9017235f89dc3983d4ee"
]
},
{
"sha": "1106e8c81cb49e71024e9017235f89dc3983d4ee",
"repository": "example-project.git",
"date": 1417810290000,
"comment": "file2.txt updated\n",
"author": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Admin",
"username": "alex.admin"
},
"parents": [
"8dab56fb6ba6dd0fc0d0aa8c7ce4f01d77fa0835"
]
}
]
}
}
]
}
BUILD Event
The BUILD
event contains these fields:
Field | Description |
---|---|
|
Name of the job |
|
Build timestamp |
|
Build number |
|
Build URL |
|
Build result ( |
|
Build duration |
|
Name of the artifact |
|
Path relative to the job workspace |
|
URL of the artifact |
Here's a JSON payload example for a Build event:
{
"apiVersion":"1.0",
"messageId":"4a253425-4598-4838-a4b5-aac30d0b9710",
"timestamp":1417795613257,
"testEvent":true,
"projectId":"test-project",
"events":[
{
"eventId":"BUILD",
"projectId":"test-project",
"timestamp":1417795613256,
"data":{
"jobName":"example-job",
"details":{
"timestamp":1417795590256,
"number":16,
"url":"http://server/test-dev/s2/test-project/hudson/job/test-project.example-job/16/",
"result":"SUCCESS",
"duration":36905,
"artifacts":[
{
"fileName":"sample-1.0-SNAPSHOT.jar",
"relativePath":"sample-project/target/sample-1.0-SNAPSHOT.jar",
"url":"http://server/test-dev/s2/test-project/hudson/job/test-project.example-job/16/artifact/sample-project/target/sample-1.0-SNAPSHOT.jar"
}
]
}
}
}
]
}
REVIEW Event
The REVIEW
event represents changes in merge requests and contains
these fields:
Field | Description |
---|---|
|
Description of the merge request |
|
Unique ID of the merge request |
|
Title of the merge request |
|
Timestamp of the merge request creation |
|
Timestamp of the merge request last modification |
|
Profile of the user who created the merge request |
|
Name of the Git repository |
|
Name of the review branch |
|
Name of the target branch |
|
Profile of the user who performed the action |
|
Merge request action These are the merge request actions:
|
|
List of commits added to the merge request The
|
|
Text of the comment The |
|
Comment of the rejected or approved review action The |
|
Result of the merge ( The |
|
Status of the merge request ( The |
Here's a JSON payload example for a REVIEW
event.
{
"apiVersion": "1.0",
"events": [
{
"data": {
"action": "CREATED",
"review": {
"created": 1431944319181,
"id": 6,
"modified": 1431944319635,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Bug Fix"
},
"user": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
}
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1431944327
}
],
"messageId": "08758261-e4e7-4c8f-b9fe-7b74f715803f",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1431944329923
}
{
"apiVersion": "1.0",
"events": [
{
"data": {
"action": "COMMIT",
"commits": [
{
"author": "alex.admin",
"message": "fix version #3\n",
"sha": "8fd1d2a53a181aa7015e7535b6f64295c432eca7"
},
{
"author": "alex.admin",
"message": "fix version #2\n",
"sha": "ff2bdf91d0fb6fb664315879ec38acc0931beeb6"
}
],
"review": {
"created": 1431944319181,
"id": 6,
"modified": 1431944340209,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Bug Fix"
},
"user": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
}
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1431944353
}
],
"messageId": "5de98d08-49cd-4a19-86b5-d89757f75a1d",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1431944355646
}
{
"apiVersion": "1.0",
"events": [
{
"data": {
"user": {
"email": "clara.coder@example.com",
"firstName": "Clara",
"lastName": "Coder",
"username": "clara"
},
"review": {
"created": 1436521285722,
"id": 23,
"modified": 1438246154916,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Admin",
"username": "alex"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Some Review"
},
"action": "REVIEWED",
"status": "REJECTED",
"comment": "rejected the request because ...",
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1438246163
}
],
"messageId": "f0a75815-3470-4dc4-be82-975935152ed3",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1438246165924
}
{
"apiVersion": "1.0",
"events": [
{
"data": {
"action": "COMMENTED",
"review": {
"created": 1431944319181,
"id": 6,
"modified": 1431944478701,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Bug Fix"
},
"text": "General comment",
"user": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
}
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1431945965
}
],
"messageId": "d2a36692-dae6-44d4-a112-7a615b524cc3",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1431945967166
}
{
"apiVersion": "1.0",
"events": [
{
"data": {
"action": "MERGED",
"result": "FAST_FORWARD",
"review": {
"created": 1431944319181,
"id": 6,
"modified": 1431944478701,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Bug Fix"
},
"user": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
}
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1431945438
}
],
"messageId": "b06d5581-d38a-4972-9c80-dc1455547776",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1431945440287
}
{
"apiVersion": "1.0",
"events": [
{
"data": {
"action": "CLOSED",
"review": {
"created": 1431944319181,
"id": 6,
"modified": 1431945453967,
"reporter": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"repository": "example-project.git",
"reviewBranch": "bug_branch",
"targetBranch": "main",
"title": "Bug Fix"
},
"status": "COMPLETED",
"user": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
}
},
"eventId": "REVIEW",
"projectId": "example-project",
"timestamp": 1431945459
}
],
"messageId": "b434f6d2-b5c7-4c0a-bab2-3e6614025865",
"projectId": "example-project",
"testEvent": false,
"timestamp": 1431945453967
}
ACTIVITY Event
The ACTIVITY
event contains these fields:
Field | Description |
---|---|
|
Profile of the user whose action produced the activity The value is |
|
Name of the activity |
|
Description of the activity, or the object whose fields depends on the These activities are supported:
|
Here's a JSON payload example for an Activity event:
{
"apiVersion": "1.0",
"events": [
{
"data": {
"author": {
"email": "alex.admin@example.com",
"firstName": "Alex",
"lastName": "Alex Admin",
"username": "alex.admin"
},
"name": "WIKI",
"properties": {
"page": "New Page Title",
"type": "CREATED"
}
},
"eventId": "ACTIVITY",
"projectId": "example-project",
"timestamp": 1432035029
}
],
"messageId": "45066d85-5a5c-4647-9a6c-43fc8e99481a",
"projectId": "qa-dev_test-rss",
"testEvent": false,
"timestamp": 1432035031418
}