Skip to main content

Insights API Endpoints

Use the Insights API methods to retrieve analytics data about your Sauce Labs jobs that you can then use to populate a dashboard that is meaningful for your organization.

Refer to Getting Started for Authentication and Server information.

Analytics

Get Test Results

GET /v1/analytics/tests

Return run data for all tests that match the request criteria.

Parameters

build

| QUERY | OPTIONAL | STRING |

Limit results to those grouped by this build name.

build_missing

| QUERY | OPTIONAL | BOOLEAN |

Limit results to those without the build name provided. Default value is false.

descending

| QUERY | OPTIONAL | BOOLEAN |

Sort results by test creation time. Default value is true.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

error

| QUERY | OPTIONAL | STRING |

Limit results to only those that threw the specified error message.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

from

| QUERY | OPTIONAL | INTEGER |

Begin results list from this record number. Default value is 0

owner

| QUERY | OPTIONAL | STRING |

Limit results to the provided owner (username).

scope

| QUERY | OPTIONAL | STRING |

Specifies the scope of the owner parameter. Supported values are:

  • me - owner is the logged-in requestor.
  • organization - owner is all users the logged-in requestor's organization.
  • single - owner is one or more users in the logged-in requestor's organization. Setting this value makes the owner parameter required.

size

| QUERY | OPTIONAL | INTEGER |

The maximum number of results to return. Default value is 10

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • errored
  • failed
  • complete

time_range

| QUERY | OPTIONAL | STRING |

The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include d (day); h (hour); m (minute); s (second).

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v1/analytics/tests" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"has_more": true,
"items": [
{
"ancestor": "<ancestor>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"build": "build123",
"creation_time": "2023-04-19T10:01:44.785Z",
"details_url": "<url>",
"duration": 5,
"end_time": "2023-04-19T10:01:44.785Z",
"error": "<error>",
"id": "123",
"name": "<name>",
"os": "<os>",
"os_normalized": "<os>",
"owner": "<owner>",
"start_time": "2023-04-19T10:01:44.785Z",
"status": "complete"
}
],
"meta": {
"status": 200
}
}

Get a Summary of Test Metrics

GET /v1/analytics/insights/test-metrics

Return an aggregate of metric values for runs of a specified test during the specified period.

Parameters

note

This call requires start and end parameters OR the time_range parameter.

start

| QUERY | REQUIRED | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | REQUIRED | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

time_range

| QUERY | REQUIRED | DURATION + UNIT |

The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include d (day); h (hour); m (minute); s (second).

query

| QUERY | REQUIRED | STRING |

The name of the test for which results are requested.

scope

| QUERY | OPTIONAL | STRING |

Specifies the scope of the owner parameter. Supported values are:

  • me - owner is the logged-in requestor.
  • organization - owner is all users the logged-in requestor's organization.
  • single - owner is one or more users in the logged-in requestor's organization. Setting this value makes the owner parameter required.

owner

| QUERY | OPTIONAL | ARRAY of STRINGS |

The name of one or more users in the requestor's organization who executed the requested tests. This parameter is required if the scope parameter is set to single.

status

| QUERY | OPTIONAL | STRING |

Limit results to only those with a specified status. Supported values are:

  • passed
  • errored
  • failed
  • complete

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v1/analytics/insights/test-metrics?start=1515687172&end=1516291972&query=AnalyticsSeleniumTest%20on%20OS%20X%2010.10" | json_pp

Responses

200Success.
400Bad Request. May include additional error messages, such as "start and end parameters are required."
404Not found.
Sample Response
{
"meta": {
"status": 200
},
"aggs": {
"count": 1008,
"fastestRun": {
"id": "1cc127f6af024184a45fc45817672a341",
"owner": "a-team",
"ancestor": "a-team",
"name": "AnalyticsSeleniumTest on OS X 10.10",
"build": "",
"creation_time": "2018-01-12T11:50:02Z",
"start_time": "2018-01-12T11:50:02Z",
"end_time": "2018-01-12T11:50:27Z",
"duration": 25,
"status": "passed",
"error": "",
"os": "OS X Yosemite (10.10)",
"os_normalized": "",
"browser": "Chrome 51.0",
"browser_normalized": "",
"details_url": "https://saucelabs.com/rest/v1.1/a-team/jobs/1cc127f6af024184a45fc45817672a341"
},
"slowestRun": {
"id": "faf35305919245ebaceab93712d009b0",
"owner": "a-team",
"ancestor": "a-team",
"name": "AnalyticsSeleniumTest on OS X 10.10",
"build": "",
"creation_time": "2018-01-15T19:10:01Z",
"start_time": "2018-01-15T19:10:01Z",
"end_time": "2018-01-15T19:40:59Z",
"duration": 1858,
"status": "errored",
"error": "Test exceeded maximum duration after 1800 seconds",
"os": "OS X Yosemite (10.10)",
"os_normalized": "",
"browser": "Chrome 51.0",
"browser_normalized": "",
"details_url": "https://saucelabs.com/rest/v1.1/a-team/jobs/faf35305919245ebaceab93712d009b0"
},
"statuses": {
"errored": 7,
"failed": 1,
"passed": 1000
},
"totalQueueTime": 0.3843098311817279,
"totalRunTime": 33.18867924528302
}
}

GET /v1/analytics/trends/tests

Return a set of data "buckets" representing tests that were run in each time interval defined by the request parameters.

Parameters

scope

| QUERY | OPTIONAL | STRING |

Specifies the scope of the owner parameter. Supported values are:

  • me - owner is the logged-in requestor.
  • organization - owner is all users the logged-in requestor's organization.
  • single - owner is one or more users in the logged-in requestor's organization. Setting this value makes the owner parameter required.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

time_range

| QUERY | OPTIONAL | STRING |

The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include d (day); h (hour); m (minute); s (second).

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | STRING |

Limit results to only those with a specified status. Supported values are:

  • passed
  • errored
  • failed
  • complete

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v1/analytics/trends/tests" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "complete"
},
"buckets": [
{
"timestamp": 1681844306,
"datetime": "2023-04-19T11:03:28.158Z",
"count": 3,
"aggs": {
"browser": [
{
"name": "<browser>",
"count": 3
}
],
"browserError": [
{
"name": "<browser>",
"count": 6
}
],
"browserFail": [
{
"name": "<browser>",
"count": 1
}
],
"device": [
{
"name": "<device>",
"count": 2
}
],
"deviceError": [
{
"name": "<device>",
"count": 4
}
],
"deviceFail": [
{
"name": "<device>",
"count": 3
}
],
"errorMessage": [
{
"name": "<error>",
"count": 6
}
],
"framework": [
{
"name": "<framework>",
"count": 7
}
],
"frameworkError": [
{
"name": "<framework>",
"count": 4
}
],
"frameworkFail": [
{
"name": "<framework>",
"count": 1
}
],
"os": [
{
"name": "<os>",
"count": 2
}
],
"osError": [
{
"name": "<os>",
"count": 5
}
],
"osFail": [
{
"name": "<os>",
"count": 3
}
],
"owner": [
{
"name": "<owner>",
"count": 4
}
],
"status": [
{
"name": "complete",
"count": 2
}
]
}
}
],
"metrics": {
"additionalProp1": {
"additionalProp1": 1,
"additionalProp2": 4,
"additionalProp3": 6
},
"additionalProp2": {
"additionalProp1": 2,
"additionalProp2": 4,
"additionalProp3": 4
},
"additionalProp3": {
"additionalProp1": 2,
"additionalProp2": 3,
"additionalProp3": 4
}
}
}

Get Builds and Tests

GET /v1/analytics/trends/builds_tests

Return the set of all tests run in the specified period, grouped by whether each test was part of a build or not.

Parameters

note

This call requires start and end parameters OR the time_range parameter.

start

| QUERY | REQUIRED | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | REQUIRED | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

time_range

| QUERY | REQUIRED | DURATION + UNIT |

The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include d (day); h (hour); m (minute); s (second).

scope

| QUERY | OPTIONAL | STRING |

Specifies the scope of the owner parameter. Supported values are:

  • me - owner is the logged-in requestor.
  • organization - owner is all users the logged-in requestor's organization.
  • single - owner is one or more users in the logged-in requestor's organization. Setting this value makes the owner parameter required.

owner

| QUERY | OPTIONAL | ARRAY of STRINGS |

The name of one or more users in the requestor's organization who executed the requested tests. This parameter is required if the scope parameter is set to single.

status

| QUERY | OPTIONAL | STRING |

Limit results to only those with a specified status. Supported values are:

  • passed
  • errored
  • failed
  • complete

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v1/analytics/trends/builds_tests?start=2021-05-01T12:00:00Z&end=2021-05-02T12:00:00Z" | json_pp

Responses

200Success.
400Bad Request. May include additional error messages, such as "start and end parameters are required."
404Not found.
Sample Response
{
"meta": {
"status": 200
},
"builds": {
"items": [
{
"name": "build-123",
"tests_count": 34,
"duration": 1916,
"start_time": "2017-03-01T12:09:16Z",
"end_time": "2017-03-01T12:41:25Z",
"tests": [
{
"id": "a1a2b38812hy42e5affbd54p9757re5t",
"owner": "USERNAME",
"ancestor": "USERNAME",
"name": "TestStatus",
"creation_time": "2017-03-01T12:09:16Z",
"end_time": "2017-03-01T12:10:44Z",
"status": "failed",
"error": "",
"os": "Linux",
"browser": "Android 5.1",
"details_url": "https://saucelabs.com/rest/v1.1/a-team/jobs/a1a2b38812hy42e5affbd54p9757re5t"
},
// up to 10 items
],
"has_more": true,
"aggs": {
"status": [
{
"name": "complete",
"count": 23
},
{
"name": "passed",
"count": 9
},
{
"name": "failed",
"count": 2
}
]
}
},
// up to 25 builds
],
"has_more": true
},
"tests_missing_build": {
"items": [],
"has_more": false
}
}

Filters

Get Filter Items

GET /v2/insights/{source}/filters

Return data for all tests that match the request criteria.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • error
  • failed
  • complete

Default value is: ["error", "failed", "passed", "complete"]
start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | STRING |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

user_id

| PATH | REQUIRED | STRING |

Return only jobs that belongs to the specified user_id

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

must_have

| QUERY | OPTIONAL | STRING |

It supports error as a value. When you set must_have=error, jobs took to calculate the response must have ended with an error.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/filters?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"automation_backend": [
{
"name": "<automation_backend>",
"count": 5
}
],
"browser": [
{
"name": "<browser>",
"count": 7
}
],
"build": [
{
"name": "<build>",
"count": 2
}
],
"os": [
{
"name": "<os>",
"count": 4
}
],
"device": [
{
"name": "<device>",
"count": 8
}
],
"tag": [
{
"name": "<tag>",
"count": 8
}
]
}

Get Filter Items from All Sources

GET /insights/v2/filters

Return data from all sources for all tests that match the request criteria.

Parameters

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

status

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • error
  • failed
  • complete

Default value is: ["error", "failed", "passed", "complete"]
start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | STRING |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

user_id

| PATH | REQUIRED | STRING |

Return only jobs that belongs to the specified user_id

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

must_have

| QUERY | OPTIONAL | STRING |

It supports error as a value. When you set must_have=error, jobs took to calculate the response must have ended with an error.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/filters?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"automation_backend": [
{
"name": "<automation_backend>",
"count": 5
}
],
"browser": [
{
"name": "<browser>",
"count": 7
}
],
"build": [
{
"name": "<build>",
"count": 2
}
],
"os": [
{
"name": "<os>",
"count": 4
}
],
"device": [
{
"name": "<device>",
"count": 8
}
],
"tag": [
{
"name": "<tag>",
"count": 8
}
]
}

Activity

Get Activity

GET /rest/v1/users/{user_id}/activity

Return daily statistics about test results and concurrency usage for the specified user_id.

Parameters

user_id

| PATH | REQUIRED | STRING |

Return only jobs that belongs to the specified user_id

since

| QUERY | OPTIONAL | DATE |

Return only jobs ran from the provided Unix timestamp on.

until

| QUERY | OPTIONAL | DATE |

Return only jobs ran until the provided Unix timestamp.

level

| QUERY | OPTIONAL | STRING |

Specifies the ownership level. Supported values are:

  • user
  • organization

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/rest/v1/users/<user_id>/activity" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
}

Get Activity for Users

GET /rest/v1/users_activity

Return daily statistics about test results and concurrency usage.

Parameters

users

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to specific users.

since

| QUERY | OPTIONAL | DATE |

Return only jobs ran from the provided Unix timestamp on.

until

| QUERY | OPTIONAL | DATE |

Return only jobs ran until the provided Unix timestamp.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/rest/v1/users_activity" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"additionalProp1": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp2": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp3": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
}
}

Get Activity for Teams

GET /rest/v1/activity/teams

Return daily statistics about test results and concurrency usage for teams.

Parameters

id

| QUERY | OPTIONAL | ARRAY of STRINGS |

Return results for the specified team id.

since

| QUERY | OPTIONAL | DATE |

Return only jobs ran from the provided Unix timestamp on.

until

| QUERY | OPTIONAL | DATE |

Return only jobs ran until the provided Unix timestamp.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/rest/v1/activity/teams" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"additionalProp1": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp2": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp3": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
}
}

Get Activity for Org

GET /rest/v1/activity/organization

Return daily statistics about test results and concurrency usage for organization.

Parameters

since

| QUERY | OPTIONAL | DATE |

Return only jobs ran from the provided Unix timestamp on.

until

| QUERY | OPTIONAL | DATE |

Return only jobs ran until the provided Unix timestamp.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/rest/v1/activity/organization" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"additionalProp1": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp2": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
},
"additionalProp3": {
"ccy_exec_mean": [
0
],
"ccy_exec_peak": [
0
],
"datestamp": [
"2023-04-18"
],
"jobs": [
0
],
"minutes": [
0
]
}
}

Errors

Get Errors

GET/v2/insights/{source}/errors

Return an array of errors with occurrence count on all tests run in the specified period.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

limit

| QUERY | OPTIONAL | INTEGER |

Identifies the number of records to return. Default value is 50.

offset

| QUERY | OPTIONAL | INTEGER |

Specifies the number of items to be skipped from the beginning of the list. Default value is 0.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/rdc/errors?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"buckets": [
{
"name": "abc123",
"count": 1
}
],
"all_items_count": 2,
"total": 3
}

GET /v2/insights/{source}/errors/trends

Return past and current data about errors for comparison.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

time_zone

| QUERY | OPTIONAL | STRING |

Specified the time zone. Default value is +00:00.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/rdc/errors/trends?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"histogram": [
{
"count": 2,
"datetime": "2017-03-01T12:16:22Z"
}
],
"trend": {
"current": 2,
"past": 4,
"tests_count": 7
}
}

Test Cases

Get Tests

GET /v2/insights/{source}/tests

Return an array of tests with details.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

error

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those that threw the specified error message.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

limit

| QUERY | OPTIONAL | INTEGER |

Identifies the number of records to return. Default value is 50.

offset

| QUERY | OPTIONAL | INTEGER |

Specifies the number of items to be skipped from the beginning of the list. Default value is 0.

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • duration
  • creation_time
Default value is creation_time.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"items": [
{
"id": "abc123",
"name": "test1",
"status": "complete",
"creation_time": "2017-03-01T12:13:39Z",
"modification_time": "2017-03-03T14:23:25Z",
"error": "<error>",
"passed": true,
"browser_normalized": "<browser_normalized>",
"os_normalized": "<os_normalized>",
"device_name": "<device_name>",
"device_group": "<device_group>",
"build": "abcd1234",
"automation_backend": "<automation_backend>",
"duration": 15,
"tags": [
"build_abcd1234"
],
"owner": "<owner>",
"ancestor": "<ancestor>",
"user_id": "<user_id>",
"team_id": "<team_id>",
"group_id": "<group_id>",
"org_id": "<org_id>",
"start_time": "2023-04-18T17:51:14.654Z",
"end_time": "2023-04-18T17:51:14.654Z",
"deletion_time": "2023-04-18T17:51:14.654Z",
"is_expired": true
}
],
"total": 3,
"statuses": {
"additionalProp1": 2,
"additionalProp2": 5,
"additionalProp3": 7
},
"max_duration": 10
}

Get Common Tests

GET /insights/v2/tests

Return an array of tests with details.

Parameters

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

error

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those that threw the specified error message.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

limit

| QUERY | OPTIONAL | INTEGER |

Identifies the number of records to return. Default value is 50.

offset

| QUERY | OPTIONAL | INTEGER |

Specifies the number of items to be skipped from the beginning of the list. Default value is 0.

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • duration
  • creation_time
Default value is creation_time.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

build_missing

| QUERY | OPTIONAL | BOOLEAN |

Limit results to those without the build name provided. Default value is false.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"items": [
{
"id": "abc123",
"name": "test1",
"source": "rdc",
"status": "complete",
"creation_time": "2023-06-05T14:47:21.209Z",
"modification_time": "2023-06-05T14:47:21.209Z",
"error": "<error>",
"passed": true,
"browser_normalized": "<broser>",
"os_normalized": "<os>",
"device_name": "<device>",
"device_group": "private",
"build": "<build>",
"automation_backend": "<automation_backend>",
"duration": 0,
"org_id": "<ord_id>",
"user_id": "<user_id>",
"team_id": "<team_id>",
"group_id": "<group_id>",
"tags": [
"<tag>"
],
"owner": "<owner>",
"ancestor": "<ancestor>",
"start_time": "2023-06-05T14:47:21.209Z",
"end_time": "2023-06-05T14:47:21.209Z",
"deletion_time": "2023-06-05T14:47:21.209Z",
"is_expired": false
}
],
"total": 5,
"statuses": {
"additionalProp1": 3,
"additionalProp2": 5,
"additionalProp3": 2
},
"max_duration": 10
}

Get Test Cases

GET /v2/insights/{source}/test-cases

Return an array of test cases (grouped by name) with statistical details.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

limit

| QUERY | OPTIONAL | INTEGER |

Identifies the number of records to return. Default value is 50.

offset

| QUERY | OPTIONAL | INTEGER |

Specifies the number of items to be skipped from the beginning of the list. Default value is 0.

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • total_runs
  • name
  • complete_count
  • error_count
  • fail_count
  • pass_count
  • complete_rate
  • error_rate
  • failure_rate
  • pass_rate
  • avg_duration
  • median_duration
  • total_duration
Default value is total_runs.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/test-cases?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"test_cases": [
{
"name": "abc123",
"statuses": {
"additionalProp1": 3,
"additionalProp2": 2,
"additionalProp3": 0
},
"total_runs": 5,
"complete_rate": 5,
"error_rate": 2,
"fail_rate": 1,
"pass_rate": 4,
"avg_duration": 16,
"median_duration": 10,
"total_duration": 20
}
],
"total": 4,
"statuses": {
"additionalProp1": 3,
"additionalProp2": 5,
"additionalProp3": 1
},
"avg_runtime": 15
}

Get Test Cases CSV

GET /v2/insights/{source}/test-cases/csv

Return an array of test cases (grouped by name) with statistical details as a CSV file.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • total_runs
  • name
  • complete_count
  • error_count
  • fail_count
  • pass_count
  • complete_rate
  • error_rate
  • failure_rate
  • pass_rate
  • avg_duration
  • median_duration
  • total_duration
Default value is total_runs.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/test-cases/csv?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{}

Get Test Cases Stats

GET /v2/insights/{source}/test-cases/stats

Return an array of test cases (grouped by name) with statistical details.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/test-cases/stats?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"consistently_complete": 5,
"consistently_error": 1,
"consistently_failing": 0,
"consistently_passing": 6,
"total_test_cases": 12,
"total_test_cases_limited": 15
}

Get Status Trend

GET /v2/insights/{source}/test-cases/trends

Return a histogram with test statistic details grouped by specific period.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

groupby

| QUERY| REQUIRED | STRING |

Time period for grouping. Available values are:

  • 1h
  • 1d
  • 7d

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

start

| QUERY | REQUIRED | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | REQUIRED | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

time_zone

| QUERY | OPTIONAL | STRING |

Specified the time zone. Default value is +00:00.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

name

| QUERY | OPTIONAL | STRING |

Limit results to only those with the specified name.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/test-cases/trends?groupby=<groupby>&org_id=<org_id>&start=<start>&end=<end>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"histogram": [
{
"timestamp_s": 1,
"timestamp_ms": 60,
"complete": 10,
"error": 2,
"failed": 3,
"passed": 5
}
]
}

Concurrency

Get Max Concurrency Report CSV

GET /v2/insights/{source}/concurrency/max/csv

Return information about concurrency usage in a CSV format.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud. Supported values are:

  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

start_date

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end_date

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/concurrency/max/csv?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{}

Get Max Concurrency Report JSON

GET /v2/insights/{source}/concurrency/max/json

Return information about concurrency usage.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud. Supported values are:

  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

start_date

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end_date

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/concurrency/max/json?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{}

Coverage

Get Coverage

GET /v2/insights/{source}/coverage/{coverage_field}

Return information about tests coverage for the specified coverage_field.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

coverage_field

| PATH | REQUIRED | STRING |

Available values are:

  • device
  • browser
  • os

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Return results only for the specified framework used to run the test.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • name
  • count
  • total_duration
Default value is count.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/coverage/<coverage_field>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"coverage": [
{
"name": "<name>",
"count": 3,
"total_duration": 5
}
],
"max_count": 7
}

Get Coverage from All Sources

GET /insights/v2/coverage/{coverage_field}

Return information from all sources about test coverage for the specified coverage_field.

Parameters

coverage_field

| PATH | REQUIRED | STRING |

Available values are:

  • device
  • browser
  • os

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Return results only for the specified framework used to run the test.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

sort_by

| QUERY | OPTIONAL | STRING |

Sort the dataset by the specified value. Available values are:

  • name
  • count
  • total_duration
Default value is count.

sort

| QUERY | OPTIONAL | STRING |

Sort the dataset in ascending or descending order. Available values are:

  • asc
  • desc
Default value is desc.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/coverage/<coverage_field>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"coverage": [
{
"name": "<name>",
"count": 3,
"total_duration": 5
}
],
"max_count": 7
}

Get Coverage CSV

GET /v2/insights/{source}/coverage/{coverage_field}/csv

Return information about tests coverage for the specified coverage_field in a CSV format.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

coverage_field

| PATH | REQUIRED | STRING |

Available values are:device, browser, os.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Return results only for the specified framework used to run the test.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/coverage/<coverage_field>/csv" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{}

Get Coverage CSV from All Sources

GET /insights/v2/coverage/{coverage_field}/csv

Return information from all sources about test coverage for the specified coverage_field in a CSV format.

Parameters

coverage_field

| PATH | REQUIRED | STRING |

Available values are:

  • device
  • browser
  • os

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Return results only for the specified framework used to run the test.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/coverage/<coverage_field>/csv" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{}
GET /v2/insights/{source}/trends/tests

Return an array of buckets with aggregations, such as number of tests run on a specific browser or device.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

time_zone

| QUERY | OPTIONAL | STRING |

Specified the time zone. Default value is +00:00.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/trends/tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "complete"
},
"buckets": [
{
"timestamp": 1681844306,
"datetime": "2017-03-01T12:13:39Z",
"count": 3,
"aggs": {
"browser": [
{
"name": "<browser>",
"count": 3
}
],
"browserError": [
{
"name": "<browser>",
"count": 1
}
],
"browserFail": [
{
"name": "<browser>",
"count": 4
}
],
"device": [
{
"name": "<device>",
"count": 6
}
],
"deviceError": [
{
"name": "<device>",
"count": 2
}
],
"deviceFail": [
{
"name": "<device>",
"count": 5
}
],
"errorMessage": [
{
"name": "<error>",
"count": 0
}
],
"framework": [
{
"name": "<framework>",
"count": 0
}
],
"frameworkError": [
{
"name": "<framework>",
"count": 0
}
],
"frameworkFail": [
{
"name": "<framework>",
"count": 0
}
],
"os": [
{
"name": "<os>",
"count": 8
}
],
"osError": [
{
"name": "<os>",
"count": 2
}
],
"osFail": [
{
"name": "<os>",
"count": 7
}
],
"owner": [
{
"name": "<owner>",
"count": 0
}
],
"status": [
{
"name": "<status>",
"count": 0
}
]
}
}
],
"metrics": {
"additionalProp1": {
"additionalProp1": 1,
"additionalProp2": 4,
"additionalProp3": 5
},
"additionalProp2": {
"additionalProp1": 6,
"additionalProp2": 8,
"additionalProp3": 3
},
"additionalProp3": {
"additionalProp1": 6,
"additionalProp2": 7,
"additionalProp3": 2
}
}
}

GET /insights/v2/trends/tests

Return an array of buckets with aggregations, such as the number of tests from all sources run on a specific browser or device.

Parameters

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

time_zone

| QUERY | OPTIONAL | STRING |

Specified the time zone. Default value is +00:00.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • error
  • failed
  • complete

Default value is: ["error", "failed", "passed", "complete"]
tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/trends/tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "complete"
},
"buckets": [
{
"timestamp": 1681844306,
"datetime": "2017-03-01T12:13:39Z",
"count": 3,
"aggs": {
"browser": [
{
"name": "<browser>",
"count": 3
}
],
"browserError": [
{
"name": "<browser>",
"count": 1
}
],
"browserFail": [
{
"name": "<browser>",
"count": 4
}
],
"device": [
{
"name": "<device>",
"count": 6
}
],
"deviceError": [
{
"name": "<device>",
"count": 2
}
],
"deviceFail": [
{
"name": "<device>",
"count": 5
}
],
"errorMessage": [
{
"name": "<error>",
"count": 0
}
],
"framework": [
{
"name": "<framework>",
"count": 0
}
],
"frameworkError": [
{
"name": "<framework>",
"count": 0
}
],
"frameworkFail": [
{
"name": "<framework>",
"count": 0
}
],
"os": [
{
"name": "<os>",
"count": 8
}
],
"osError": [
{
"name": "<os>",
"count": 2
}
],
"osFail": [
{
"name": "<os>",
"count": 7
}
],
"owner": [
{
"name": "<owner>",
"count": 0
}
],
"status": [
{
"name": "<status>",
"count": 0
}
]
}
}
],
"metrics": {
"additionalProp1": {
"additionalProp1": 1,
"additionalProp2": 4,
"additionalProp3": 5
},
"additionalProp2": {
"additionalProp1": 6,
"additionalProp2": 8,
"additionalProp3": 3
},
"additionalProp3": {
"additionalProp1": 6,
"additionalProp2": 7,
"additionalProp3": 2
}
}
}

GET /v2/insights/{source}/trends/errors

Return statistics for errors that occurred in tests run in the specified period.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/trends/errors?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "complete"
},
"buckets": [
{
"name": "<name>",
"count": 3,
"items": [
{
"id": "abc123",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build123",
"creation_time": "2023-04-18T21:14:29.374Z",
"start_time": "2023-04-18T21:14:29.374Z",
"end_time": "2023-04-18T21:14:29.374Z",
"duration": 4,
"status": "complete",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>"
}
],
"has_more": true
}
],
"all_items_count": 4
}

GET /insights/v2/trends/errors

Return statistics from all sources for errors that occurred on tests run in the specified period.

Parameters

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • error
  • failed
  • complete

Default value is: ["error", "failed", "passed", "complete"]
tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/trends/errors?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "complete"
},
"buckets": [
{
"name": "<name>",
"count": 3,
"items": [
{
"id": "abc123",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build123",
"creation_time": "2023-04-18T21:14:29.374Z",
"start_time": "2023-04-18T21:14:29.374Z",
"end_time": "2023-04-18T21:14:29.374Z",
"duration": 4,
"status": "complete",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>"
}
],
"has_more": true
}
],
"all_items_count": 4
}

GET /v2/insights/{source}/trends/builds_tests

Return information about builds and tests run included in the build. Also, it provides information about tests without build names.

Parameters

source

| PATH | REQUIRED | STRING |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

interval

| QUERY | OPTIONAL | STRING |

Relative date filter. Available values are:

  • 1m (1 month)
  • 15m (15 months)
  • 1h (1 hour)
  • 6h (6 hours)
  • 12h (12 hours)
  • 1d (1 day)
  • 7d (7 days)
  • 30d (30 days)
Default value is 1d

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • complete
  • error
  • passed
  • failed

tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

device_group

| QUERY | OPTIONAL | STRING |

If source is rdc, return results only for the specified device group. Available values are:

  • private
  • public

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/v2/insights/<source>/trends/builds_tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "passed"
},
"builds": {
"items": [
{
"name": "<name>",
"tests_count": 5,
"owner": "<owner>",
"duration": 4,
"duration_absolute": 6,
"duration_test_max": 9,
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"tests": [
{
"id": "abc123",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build123",
"creation_time": "2023-04-18T21:32:45.153Z",
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"duration": 9,
"status": "passed",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>",
"is_expired": true
}
],
"aggs": {
"status": [
{
"name": "passed",
"count": 8
}
]
}
}
],
"has_more": true,
"total": 10
},
"tests_missing_build": {
"items": [
{
"id": "def456",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build456",
"creation_time": "2023-04-18T21:32:45.153Z",
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"duration": 10,
"status": "failed",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>",
"is_expired": true
}
],
"has_more": true,
"total": 0
}
}

GET /insights/v2/trends/builds-tests

Return information from all sources about builds and tests run included in the build. Also, it provides information about tests without build names.

Parameters

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

user_id

| QUERY | OPTIONAL | STRING |

Return only jobs that belongs to the specified user_id.

group_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified group_id.

team_id

| QUERY | OPTIONAL | STRING |

Return results only for the specified team_id.

start

| QUERY | OPTIONAL | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end

| QUERY | OPTIONAL | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

automation_backend

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified framework.

browser

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified browsers.

build

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to those grouped by this build name.

device

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified device.

device_group

| QUERY | OPTIONAL | STRING |

Return results only for the specified device group. Available values are:

  • private
  • public

os

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified operating systems.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: ["vdc", "rdc"]
status

| QUERY | OPTIONAL | ARRAY of STRINGS |

Limit results to only those with a specified status. Supported values are:

  • passed
  • error
  • failed
  • complete

Default value is: ["error", "failed", "passed", "complete"]
tag

| QUERY | OPTIONAL | ARRAY OF STRINGS |

Limit results to only those run on the specified tag.

tag_filter_mode

| QUERY | OPTIONAL | STRING |

It changes the default behavior of tag filters: when you add multiple tag filters, the default behavior is or. When you add tag_filter_mode=and, the results are limited to only those with all tags provided. Available values are:

  • and
  • or
Default value is or.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/insights/v2/trends/builds-tests?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"meta": {
"status": "passed"
},
"builds": {
"items": [
{
"name": "<name>",
"tests_count": 5,
"owner": "<owner>",
"duration": 4,
"duration_absolute": 6,
"duration_test_max": 9,
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"tests": [
{
"id": "abc123",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build123",
"creation_time": "2023-04-18T21:32:45.153Z",
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"duration": 9,
"status": "passed",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>",
"is_expired": true
}
],
"aggs": {
"status": [
{
"name": "passed",
"count": 8
}
]
}
}
],
"has_more": true,
"total": 10
},
"tests_missing_build": {
"items": [
{
"id": "def456",
"owner": "<owner>",
"ancestor": "<ancestor>",
"name": "<name>",
"build": "build456",
"creation_time": "2023-04-18T21:32:45.153Z",
"start_time": "2023-04-18T21:32:45.153Z",
"end_time": "2023-04-18T21:32:45.153Z",
"duration": 10,
"status": "failed",
"error": "<error>",
"os": "<os>",
"os_normalized": "<os>",
"browser": "<browser>",
"browser_normalized": "<browser>",
"details_url": "<url>",
"is_expired": true
}
],
"has_more": true,
"total": 0
}
}