Skip to main content

Webhooks Integration

The Sauce Labs Webhooks integration allows you to specify a URL to which Sauce Labs will push test result data as it becomes available, rather than forcing you to constantly poll for updates.

What You'll Need

Configure a Webhook

  1. From your Sauce Labs account, navigate to the Account Integrations page.
  2. Click the Webhooks Enable button.
  3. Enter the URL of the endpoint to which you would like Sauce Labs events pushed.
  4. Select the events you wish to receive:
    • Virtual Devices: Receive test result events for jobs run on Sauce Labs desktop browsers and mobile emulators and simulators.
    • Real Devices: Receive test result events for Appium jobs run on Sauce Labs real devices.
  5. For each selected event type, choose whether you wish to receive data for all completed tests or only tests that failed.
  6. Click Save to complete your configuration. Your webhook enablement appears under the Saved Configurations section. You can configure up to ten webhook integrations.

Delete a Webhook

  1. From your Sauce Labs account, navigate to the Account Integrations page.
  2. Click the Webhooks Enable button.
  3. In the Saved Configurations section, click the trashcan icon of the webhook configuration you wish to delete.

Event Payload

Each event sends a POST request containing the job object with the following data fields as its payload:

Data FieldFormatDescription
idSTRINGSauce Labs unique identifier of the test.
creation_timeDATE-TIMEThe date-time value, in YYYY-MM-DDTHH:mm:ssZ format, at which the test launched.
modification_timeDATE-TIMEThe date-time value, in YYYY-MM-DDTHH:mm:ssZ format, at which the test changed. This is typically due to a change in status, which triggers a new event and new webhook post.
ownerSTRINGThe Sauce Labs user who initiated the test.
owner_idSTRINGThe unique identifier of the test owner.
org_idSTRINGThe unique identifier of the Sauce Labs organization to which the test owner belongs.
team_idSTRINGThe unique identifier of the Sauce Labs team of which the test owner is a member.
team_nameSTRINGThe name of the team of which the test owner is a member.
group_idSTRINGThe unique identifier of the Sauce Labs group of which the test owner is a member.
statusENUMThe status of the test at the time the webhook event was triggered. Possible values are:
  • COMPLETE
  • PASSED
  • FAILED
  • ERRORED
passedBOOLEANIf the test includes pass/fail assertions, this field states whether the test passed. This field is optional, possible values are:
  • 1 true
  • 0 false
  • null
nameSTRINGThe name of the test.
browser_nameSTRINGThe browser in which the test ran.
browser_versionINTEGERThe version of the browser in which the test ran.
os_nameSTRINGThe operating system on which the test ran.
os_versionSTRINGThe version of the operating system on which the test ran.
duration_secINTEGERThe length of time that the test took to complete. This value is only populated in the final event push for the test.
visibilityENUMWho within the Sauce Labs organization can see the test. Possible values are:
  • PUBLIC
  • PUBLIC RESTRICTED
  • SHARE
  • TEAM
  • PRIVATE
See Sharing Test Results for visibility definitions.
tagsARRAYA set of string values representing custom labels for the test.
deviceSTRINGFor mobile app tests, the Sauce Labs unique identifier of the device on which the test was run.
appSTRINGThe App Storage identifier of uploaded test materials, such as the mobile app under test or a project test file.
errorSTRINGAn error that occurred during the test.
exceptionSTRINGAn exception that was thrown during the test.
commit_idSTRINGCommit information related to your development repo, if you have added the custom-data.commit capability to your test. Currently this field is not supported for RDC events and it will always appear as an empty string.
branch_nameSTRINGThe relevant branch of the referenced commit, if you have added the custom-data.branch capability to your test. Currently this field is not supported for RDC events and it will always appear as an empty string.
buildSTRINGA custom value that can group multiple related tests.
automation_backendSTRINGThe framework on which the test is run. Currently this field is not supported for RDC events and it will always appear as an empty string.
data_typeENUMThe type of event that triggered the webhook. Possible values are:
  • vdc
  • rdc