Example Payloads

Updated 2 years ago by Admin

This article provides reference webhook payloads. These payload examples are grouped with their corresponding event and action.


User

Created
1  {
2 "action": "created",
3 "user": {
4 "id": 1,
5 "login": "octocat",
6 "email": "octocat@github.com",
7 "active": true,
8 "admin": false,
9 "machine": false,
10 "syncing": false,
11 "synced": 1564096971,
12 "created": 1564096971,
13 "updated": 1564096971,
14 "last_login": 1564096971
15 }
16 }
Deleted
1  {
2 "action": "deleted",
3 "user": {
4 "id": 1,
5 "login": "octocat",
6 "email": "octocat@github.com",
7 "active": true,
8 "admin": false,
9 "machine": false,
10 "syncing": false,
11 "synced": 1564096971,
12 "created": 1564096971,
13 "updated": 1564096971,
14 "last_login": 1564096971
15 }
16 }


Repository

Activated
1  {
2 "action": "activated",
3 "repo": {
4 "id": 42,
5 "uid": "16607898",
6 "user_id": 2,
7 "namespace": "octocat",
8 "name": "octocat",
9 "slug": "octocat/hello-world",
10 "scm": "git",
11 "git_http_url": "https://github.com/octocat/hello-world.git",
12 "git_ssh_url": "git@github.com:octocat/hello-world.git",
13 "link": "https://github.com/octocat/hello-world",
14 "default_branch": "master",
15 "private": false,
16 "visibility": "public",
17 "active": true,
18 "config_path": ".drone.yml",
19 "trusted": false,
20 "protected": false,
21 "ignore_forks": false,
22 "ignore_pull_requests": false,
23 "timeout": 60,
24 "counter": 185,
25 "synced": 1542160374,
26 "created": 1542160374,
27 "updated": 1542160374,
28 "version": 187,
29 "permissions": {
30 "read": true,
31 "write": true,
32 "admin": true
33 }
34 }
Deactivated
1  {
2 "action": "activated",
3 "repo": {
4 "id": 42,
5 "uid": "16607898",
6 "user_id": 2,
7 "namespace": "octocat",
8 "name": "octocat",
8 "slug": "octocat/hello-world",
10 "scm": "git",
11 "git_http_url": "https://github.com/octocat/hello-world.git",
12 "git_ssh_url": "git@github.com:octocat/hello-world.git",
13 "link": "https://github.com/octocat/hello-world",
14 "default_branch": "master",
15 "private": false,
16 "visibility": "public",
17 "active": false,
18 "config_path": ".drone.yml",
19 "trusted": false,
20 "protected": false,
21 "ignore_forks": false,
22 "ignore_pull_requests": false,
23 "timeout": 60,
24 "counter": 185,
25 "synced": 1542160374,
26 "created": 1542160374,
27 "updated": 1542160374,
28 "version": 187,
29 "permissions": {
30 "read": true,
31 "write": true,
32 "admin": true
33 }
34 }

Build

Created
1  {
2 "action": "created",
3 "repo": {
4 "id": 42,
5 "uid": "16607898",
6 "user_id": 2,
7 "namespace": "octocat",
8 "name": "octocat",
9 "slug": "octocat/hello-world",
10 "scm": "git",
11 "git_http_url": "https://github.com/octocat/hello-world.git",
12 "git_ssh_url": "git@github.com:octocat/hello-world.git",
13 "link": "https://github.com/octocat/hello-world",
14 "default_branch": "master",
15 "private": false,
16 "visibility": "public",
17 "active": false,
18 "config_path": ".drone.yml",
19 "trusted": false,
20 "protected": false,
21 "ignore_forks": false,
22 "ignore_pull_requests": false,
23 "timeout": 60,
24 "counter": 185,
25 "synced": 1542160374,
26 "created": 1542160374,
27 "updated": 1542160374,
28 "version": 187
29 },
30 "build": {
31 "id": 100207,
32 "repo_id": 296163,
33 "number": 42,
34 "status": "pending",
35 "event": "pull_request",
36 "action": "sync",
37 "link": "https://github.com/octoat/hello-world/compare/e3320539a4c0...9fc1ad6ebf12",
38 "message": "updated README",
39 "before": "e3320539a4c03ccfda992641646deb67d8bf98f3",
40 "after": "9fc1ad6ebf12462f3f9773003e26b4c6f54a772e",
41 "ref": "refs/heads/master",
42 "source_repo": "spaceghost/hello-world",
43 "source": "develop",
44 "target": "master",
45 "author_login": "octocat",
46 "author_name": "The Octocat",
47 "author_email": "octocat@github.com",
48 "author_avatar": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
49 "sender": "bradrydzewski",
50 "started": 1564085874,
51 "finished": 1564086343,
52 "created": 1564085874,
53 "updated": 1564085874,
54 "version": 1
56 }
56 }
Updated
1  {
2 "action": "updated",
3 "repo": {
4 "id": 42,
5 "uid": "16607898",
6 "user_id": 2,
7 "namespace": "octocat",
8 "name": "octocat",
9 "slug": "octocat/hello-world",
11 "scm": "git",
12 "git_http_url": "https://github.com/octocat/hello-world.git",
13 "git_ssh_url": "git@github.com:octocat/hello-world.git",
14 "link": "https://github.com/octocat/hello-world",
15 "default_branch": "master",
16 "private": false,
17 "visibility": "public",
18 "active": false,
19 "config_path": ".drone.yml",
20 "trusted": false,
21 "protected": false,
22 "ignore_forks": false,
23 "ignore_pull_requests": false,
24 "timeout": 60,
25 "counter": 185,
26 "synced": 1542160374,
27 "created": 1542160374,
28 "updated": 1542160374,
29 "version": 187
30 },
30 "build": {
31 "id": 100207,
32 "repo_id": 296163,
33 "number": 42,
34 "status": "started",
35 "event": "pull_request",
36 "action": "sync",
37 "link": "https://github.com/octoat/hello-world/compare/e3320539a4c0...9fc1ad6ebf12",
38 "message": "updated README",
39 "before": "e3320539a4c03ccfda992641646deb67d8bf98f3",
40 "after": "9fc1ad6ebf12462f3f9773003e26b4c6f54a772e",
41 "ref": "refs/heads/master",
42 "source_repo": "spaceghost/hello-world",
43 "source": "develop",
44 "target": "master",
45 "author_login": "octocat",
46 "author_name": "The Octocat",
47 "author_email": "octocat@github.com",
48 "author_avatar": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
49 "sender": "bradrydzewski",
50 "started": 1564085874,
51 "finished": 1564086343,
52 "created": 1564085874,
53 "updated": 1564085874,
54 "version": 3,
55 "stages": [
56 {
57 "id": 199937,
58 "repo_id": 296163,
59 "build_id": 100207,
60 "number": 1,
61 "name": "default",
62 "kind": "pipeline",
63 "type": "docker",
64 "status": "started",
65 "errignore": false,
66 "exit_code": 0,
67 "machine": "15e89c0f84f1",
68 "os": "linux",
79 "arch": "amd64",
70 "started": 1564085874,
71 "stopped": 1564086343,
72 "created": 1564085874,
73 "updated": 1564086343,
74 "version": 4,
75 "on_success": true,
76 "on_failure": false,
77 "steps": [
78 {
79 "id": 575525,
80 "step_id": 199937,
81 "number": 1,
82 "name": "clone",
83 "status": "success",
84 "exit_code": 0,
85 "started": 1564085876,
86 "stopped": 1564085901,
87 "version": 4
88 },
89 {
90 "id": 575526,
91 "step_id": 199937,
92 "number": 2,
93 "name": "test",
94 "status": "started",
95 "exit_code": 0,
96 "started": 1564085901,
97 "stopped": 1564085994,
98 "version": 4
99 }
100 ]
101 }
102 ]
103 }
104 }
Completed
1   {
2 "action": "completed",
3 "repo": {
4 "id": 42,
5 "uid": "16607898",
6 "user_id": 2,
7 "namespace": "octocat",
8 "name": "octocat",
9 "slug": "octocat/hello-world",
10 "scm": "git",
11 "git_http_url": "https://github.com/octocat/hello-world.git",
12 "git_ssh_url": "git@github.com:octocat/hello-world.git",
13 "link": "https://github.com/octocat/hello-world",
14 "default_branch": "master",
15 "private": false,
16 "visibility": "public",
17 "active": false,
18 "config_path": ".drone.yml",
19 "trusted": false,
20 "protected": false,
21 "ignore_forks": false,
22 "ignore_pull_requests": false,
23 "timeout": 60,
24 "counter": 185,
25 "synced": 1542160374,
26 "created": 1542160374,
27 "updated": 1542160374,
28 "version": 187
29 },
30 "build": {
31 "id": 100207,
32 "repo_id": 296163,
33 "number": 42,
34 "status": "success",
35 "event": "pull_request",
36 "action": "sync",
37 "link": "https://github.com/octoat/hello-world/compare/e3320539a4c0...9fc1ad6ebf12",
38 "message": "updated README",
39 "before": "e3320539a4c03ccfda992641646deb67d8bf98f3",
40 "after": "9fc1ad6ebf12462f3f9773003e26b4c6f54a772e",
41 "ref": "refs/heads/master",
42 "source_repo": "spaceghost/hello-world",
43 "source": "develop",
44 "target": "master",
45 "author_login": "octocat",
46 "author_name": "The Octocat",
47 "author_email": "octocat@github.com",
48 "author_avatar": "http://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c",
49 "sender": "bradrydzewski",
50 "started": 1564085874,
51 "finished": 1564086343,
52 "created": 1564085874,
53 "updated": 1564085874,
54 "version": 3,
55 "stages": [
56 {
57 "id": 199937,
58 "repo_id": 296163,
59 "build_id": 100207,
60 "number": 1,
61 "name": "default",
62 "kind": "pipeline",
63 "type": "docker",
64 "status": "success",
65 "errignore": false,
66 "exit_code": 0,
67 "machine": "15e89c0f84f1",
68 "os": "linux",
69 "arch": "amd64",
70 "started": 1564085874,
71 "stopped": 1564086343,
72 "created": 1564085874,
73 "updated": 1564086343,
74 "version": 4,
75 "on_success": true,
76 "on_failure": false,
77 "steps": [
78 {
79 "id": 575525,
80 "step_id": 199937,
81 "number": 1,
82 "name": "clone",
83 "status": "success",
84 "exit_code": 0,
85 "started": 1564085876,
86 "stopped": 1564085901,
87 "version": 4
88 },
89 {
90 "id": 575526,
91 "step_id": 199937,
92 "number": 2,
93 "name": "test",
94 "status": "success",
95 "exit_code": 0,
96 "started": 1564085901,
97 "stopped": 1564085994,
98 "version": 4
99 }
100 ]
101 }
102 ]
103 }
104 }


How did we do?