Webhook payloads
Webhook payload examples for each event
This page explains the structure of data sent during visual testing events. It helps you integrate Percy with CI/CD pipelines by outlining key fields like build info and test statuses.
build_created
Triggers when a build is created.
```json
{
"data": {
"type": "webhook-deliveries",
"id": "123-abcd",
"attributes": {
"build-number": 123,
"event": "build_created"
},
"relationships": {
"build": {
"data": {
"type": "builds",
"id": "123"
}
},
"commit": {
"data": {
"type": "commits",
"id": "123abc"
}
}
}
},
"included": [
{
"type": "builds",
"id": "123",
"attributes": {
"branch": "master",
"build-number" 123,
"partial": false,
"web-url": "https://percy.io/example/example-project/builds/1234",
"commit-html-url": null,
"branch-html-url": null,
"pull-request-html-url": null,
"state": "pending",
"review-state": null,
"review-state-reason": null,
"is-pull-request": false,
"pull-request-number": null,
"pull-request-title": null,
"user-agent": "Percy/v1 percy-sdk-example",
"total-snapshots": null,
"total-snapshots-requesting-changes": 0,
"total-snapshots-unreviewed": null,
"total-comparisons": null,
"total-comparisons-finished": null,
"total-comparisons-diff": null,
"total-open-comments": 0,
"failure-reason": null,
"failure-details": null,
"parallel-nonce": null,
"parallel-total-shards": null,
"finished-at": null,
"approved-at": null,
"created-at": "2019-10-24T18:46:00.000Z",
"updated-at": "2019-10-24T18:46:00.000Z"
},
"links": {
"self": "/api/v1/builds/1234"
},
"relationships": {
"project": {
"links": {
"self": "/api/v1/builds/1234/relationships/project",
"related": "/api/v1/builds/1234/project"
},
"data": {
"type": "projects",
"id": "123"
}
},
"commit": {
"links": {
"self": "/api/v1/builds/1234/relationships/commit",
"related": "/api/v1/builds/1234/commit"
},
"data": {
"type": "commits",
"id": "123"
}
},
"repo": {
"links": {
"self": "/api/v1/builds/1234/relationships/repo",
"related": "/api/v1/builds/1234/repo"
},
"data": null
},
"base-build": {
"links": {
"self": "/api/v1/builds/1234/relationships/base-build",
"related": "/api/v1/builds/1234/base-build"
},
"data": {
"type": "builds",
"id": "123"
}
},
"approved-by": {
"links": {
"self": "/api/v1/builds/1234/relationships/approved-by",
"related": "/api/v1/builds/1234/approved-by"
},
"data": null
},
"snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/snapshots",
"related": "/api/v1/builds/1234/snapshots"
}
},
"comparisons": {
"links": {
"self": "/api/v1/builds/1234/relationships/comparisons",
"related": "/api/v1/builds/1234/comparisons"
}
},
"browsers": {
"links": {
"self": "/api/v1/builds/1234/relationships/browsers",
"related": "/api/v1/builds/1234/browsers"
},
"data": [
{
"type": "browsers",
"id": "5"
},
{
"type": "browsers",
"id": "8"
}
]
},
"removed-snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/removed-snapshots",
"related": "/api/v1/builds/1234/removed-snapshots"
}
},
"missing-resources": {
"links": {
"self": "/api/v1/builds/1234/relationships/missing-resources",
"related": "/api/v1/builds/1234/missing-resources"
}
}
},
"meta": {
"finalize-link": "/api/v1/builds/1234/finalize",
"approve-link": "/api/v1/builds/1234/approve"
}
},
{
"type": "commits",
"id": "123",
"attributes": {
"sha": "123dqw21fakesha",
"message": "Update btn styles (#5)",
"author-name": "Percy dev"
},
"links": {
"self": "/api/v1/commits/123"
}
}
]
}
```
json
build_approved
Triggers when a build gets approved.
```json
{
"data": {
"type": "webhook-deliveries",
"id": "123-abcd",
"attributes": {
"build-review-state-reason": "no_diffs",
"event": "build_approved"
},
"relationships": {
"build": {
"data": {
"type": "builds",
"id": "123"
}
},
"commit": {
"data": {
"type": "commits",
"id": "123"
}
}
}
},
"included": [
{
"type": "builds",
"id": "123",
"attributes": {
"branch": "master",
"build-number": 123,
"partial": false,
"web-url": "https://percy.io/percy/example/example-project/builds/1234",
"commit-html-url": null,
"branch-html-url": null,
"pull-request-html-url": null,
"state": "processing",
"review-state": "approved",
"review-state-reason": "no_diffs",
"is-pull-request": false,
"pull-request-number": null,
"pull-request-title": null,
"user-agent": "Percy/v1 percy-agent sdk-example",
"total-snapshots": 1,
"total-snapshots-requesting-changes": 0,
"total-snapshots-unreviewed": 0,
"total-comparisons": 4,
"total-comparisons-finished": 4,
"total-comparisons-diff": 0,
"total-open-comments": 0,
"failure-reason": null,
"failure-details": null,
"parallel-nonce": null,
"parallel-total-shards": null,
"finished-at": null,
"approved-at": "2019-10-24T18:43:47.000Z",
"created-at": "2019-10-24T18:43:04.000Z",
"updated-at": "2019-10-24T18:43:48.000Z"
},
"links": {
"self": "/api/v1/builds/1234"
},
"relationships": {
"project": {
"links": {
"self": "/api/v1/builds/1234/relationships/project",
"related": "/api/v1/builds/1234/project"
},
"data": {
"type": "projects",
"id": "123"
}
},
"commit": {
"links": {
"self": "/api/v1/builds/1234/relationships/commit",
"related": "/api/v1/builds/1234/commit"
},
"data": {
"type": "commits",
"id": "123"
}
},
"repo": {
"links": {
"self": "/api/v1/builds/1234/relationships/repo",
"related": "/api/v1/builds/1234/repo"
},
"data": null
},
"base-build": {
"links": {
"self": "/api/v1/builds/1234/relationships/base-build",
"related": "/api/v1/builds/1234/base-build"
},
"data": {
"type": "builds",
"id": "123"
}
},
"approved-by": {
"links": {
"self": "/api/v1/builds/1234/relationships/approved-by",
"related": "/api/v1/builds/1234/approved-by"
},
"data": null
},
"snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/snapshots",
"related": "/api/v1/builds/1234/snapshots"
}
},
"comparisons": {
"links": {
"self": "/api/v1/builds/1234/relationships/comparisons",
"related": "/api/v1/builds/1234/comparisons"
}
},
"browsers": {
"links": {
"self": "/api/v1/builds/1234/relationships/browsers",
"related": "/api/v1/builds/1234/browsers"
},
"data": [
{
"type": "browsers",
"id": "5"
},
{
"type": "browsers",
"id": "8"
}
]
},
"removed-snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/removed-snapshots",
"related": "/api/v1/builds/1234/removed-snapshots"
}
},
"missing-resources": {
"links": {
"self": "/api/v1/builds/1234/relationships/missing-resources",
"related": "/api/v1/builds/1234/missing-resources"
}
}
},
"meta": {
"finalize-link": "/api/v1/builds/1234/finalize",
"approve-link": "/api/v1/builds/1234/approve"
}
},
{
"type": "commits",
"id": "123",
"attributes": {
"sha": "123dqw21fakesha",
"message": "Update btn styles (#5)",
"author-name": "Percy dev"
},
"links": {
"self": "/api/v1/commits/123"
}
}
]
}
```
json
build_finished
Triggers when a build finishes processing.
```json
{
"data": {
"type": "webhook-deliveries",
"id": "123-abcd",
"attributes": {
"state": "finished",
"total-comparisons-finished": 4,
"total-comparisons-diff": 0,
"event": "build_finished"
},
"relationships": {
"build": {
"data": {
"type": "builds",
"id": "123"
}
},
"commit": {
"data": {
"type": "commits",
"id": "123"
}
}
}
},
"included": [
{
"type": "builds",
"id": "123",
"attributes": {
"branch": "master",
"build-number": 123,
"partial": false,
"web-url": "https://percy.io/percy/example/example-project/builds/1234",
"commit-html-url": null,
"branch-html-url": null,
"pull-request-html-url": null,
"state": "finished",
"review-state": "approved",
"review-state-reason": "no_diffs",
"is-pull-request": false,
"pull-request-number": null,
"pull-request-title": null,
"user-agent": "Percy/v1 percy-agent sdk-example",
"total-snapshots": 1,
"total-snapshots-requesting-changes": 0,
"total-snapshots-unreviewed": 0,
"total-comparisons": 4,
"total-comparisons-finished": 4,
"total-comparisons-diff": 0,
"total-open-comments": 0,
"failure-reason": null,
"failure-details": null,
"parallel-nonce": null,
"parallel-total-shards": null,
"finished-at": "2019-10-24T18:43:48.000Z",
"approved-at": "2019-10-24T18:43:47.000Z",
"created-at": "2019-10-24T18:43:04.000Z",
"updated-at": "2019-10-24T18:43:48.000Z"
},
"links": {
"self": "/api/v1/builds/1234"
},
"relationships": {
"project": {
"links": {
"self": "/api/v1/builds/1234/relationships/project",
"related": "/api/v1/builds/1234/project"
},
"data": {
"type": "projects",
"id": "123"
}
},
"commit": {
"links": {
"self": "/api/v1/builds/1234/relationships/commit",
"related": "/api/v1/builds/1234/commit"
},
"data": {
"type": "commits",
"id": "123"
}
},
"repo": {
"links": {
"self": "/api/v1/builds/1234/relationships/repo",
"related": "/api/v1/builds/1234/repo"
},
"data": null
},
"base-build": {
"links": {
"self": "/api/v1/builds/1234/relationships/base-build",
"related": "/api/v1/builds/1234/base-build"
},
"data": {
"type": "builds",
"id": "123"
}
},
"approved-by": {
"links": {
"self": "/api/v1/builds/1234/relationships/approved-by",
"related": "/api/v1/builds/1234/approved-by"
},
"data": null
},
"snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/snapshots",
"related": "/api/v1/builds/1234/snapshots"
}
},
"comparisons": {
"links": {
"self": "/api/v1/builds/1234/relationships/comparisons",
"related": "/api/v1/builds/1234/comparisons"
}
},
"browsers": {
"links": {
"self": "/api/v1/builds/1234/relationships/browsers",
"related": "/api/v1/builds/1234/browsers"
},
"data": [
{
"type": "browsers",
"id": "5"
},
{
"type": "browsers",
"id": "8"
}
]
},
"removed-snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/removed-snapshots",
"related": "/api/v1/builds/1234/removed-snapshots"
}
},
"missing-resources": {
"links": {
"self": "/api/v1/builds/1234/relationships/missing-resources",
"related": "/api/v1/builds/1234/missing-resources"
}
}
},
"meta": {
"finalize-link": "/api/v1/builds/1234/finalize",
"approve-link": "/api/v1/builds/1234/approve"
}
},
{
"type": "commits",
"id": "123",
"attributes": {
"sha": "123dqw21fakesha",
"message": "Update btn styles (#5)",
"author-name": "Percy dev"
},
"links": {
"self": "/api/v1/commits/123"
}
}
]
}
```
json
build_changes_requested
Triggers when changes are requested for a build.
```json
{
"data": {
"type": "webhook-deliveries",
"id": "123-abcd",
"attributes": {
"build-review-state-reason": "changes_requested_snapshot",
"event": "build_changes_requested"
},
"relationships": {
"build": {
"data": {
"type": "builds",
"id": "123"
}
},
"commit": {
"data": {
"type": "commits",
"id": "123"
}
}
}
},
"included": [
{
"type": "builds",
"id": "123",
"attributes": {
"branch": "other",
"build-number": 123,
"partial": false,
"web-url": "https://percy.io/percy/example/example-project/builds/1234",
"commit-html-url": null,
"branch-html-url": null,
"pull-request-html-url": null,
"state": "finished",
"review-state": "changes_requested",
"review-state-reason": "changes_requested_snapshot",
"is-pull-request": false,
"pull-request-number": null,
"pull-request-title": null,
"user-agent": "Percy/v1 percy-agent sdk-example",
"total-snapshots": 1,
"total-snapshots-requesting-changes": 1,
"total-snapshots-unreviewed": 0,
"total-comparisons": 4,
"total-comparisons-finished": 4,
"total-comparisons-diff": 4,
"total-open-comments": 1,
"failure-reason": null,
"failure-details": null,
"parallel-nonce": null,
"parallel-total-shards": null,
"finished-at": "2019-10-24T18:50:02.000Z",
"approved-at": null,
"created-at": "2019-10-24T18:49:02.000Z",
"updated-at": "2019-10-24T18:50:46.000Z"
},
"links": {
"self": "/api/v1/builds/1234"
},
"relationships": {
"project": {
"links": {
"self": "/api/v1/builds/1234/relationships/project",
"related": "/api/v1/builds/1234/project"
},
"data": {
"type": "projects",
"id": "123"
}
},
"commit": {
"links": {
"self": "/api/v1/builds/1234/relationships/commit",
"related": "/api/v1/builds/1234/commit"
},
"data": {
"type": "commits",
"id": "123"
}
},
"repo": {
"links": {
"self": "/api/v1/builds/1234/relationships/repo",
"related": "/api/v1/builds/1234/repo"
},
"data": null
},
"base-build": {
"links": {
"self": "/api/v1/builds/1234/relationships/base-build",
"related": "/api/v1/builds/1234/base-build"
},
"data": {
"type": "builds",
"id": "2919619"
}
},
"approved-by": {
"links": {
"self": "/api/v1/builds/1234/relationships/approved-by",
"related": "/api/v1/builds/1234/approved-by"
},
"data": null
},
"snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/snapshots",
"related": "/api/v1/builds/1234/snapshots"
}
},
"comparisons": {
"links": {
"self": "/api/v1/builds/1234/relationships/comparisons",
"related": "/api/v1/builds/1234/comparisons"
}
},
"browsers": {
"links": {
"self": "/api/v1/builds/1234/relationships/browsers",
"related": "/api/v1/builds/1234/browsers"
},
"data": [
{
"type": "browsers",
"id": "5"
},
{
"type": "browsers",
"id": "8"
}
]
},
"removed-snapshots": {
"links": {
"self": "/api/v1/builds/1234/relationships/removed-snapshots",
"related": "/api/v1/builds/1234/removed-snapshots"
}
},
"missing-resources": {
"links": {
"self": "/api/v1/builds/1234/relationships/missing-resources",
"related": "/api/v1/builds/1234/missing-resources"
}
}
},
"meta": {
"finalize-link": "/api/v1/builds/1234/finalize",
"approve-link": "/api/v1/builds/1234/approve"
}
},
{
"type": "commits",
"id": "123",
"attributes": {
"sha": "123dqw21fakesha",
"message": "Update btn styles (#5)",
"author-name": Percy dev"
},
"links": {
"self": "/api/v1/commits/123"
}
}
]
}
```
json
Did this page help you?
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback
Is this page helping you?
Yes
No
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!