Skip to end of metadata
Go to start of metadata


Finding Your Username and Access Key

You can find your Sauce Labs username and access key in the User Profile > User Settings section of your Sauce Labs dashboard.


Get User Concurrency

Get account concurrency limits together with current used concurrency and manual testing minutes.

Returned data shows concurrency  for main account as "ancestor" and requested user as "self".

GET /rest/v1.1/users/USERNAME/concurrency
curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1.1/users/USERNAME/concurrency
Example JSON response
{
   "timestamp" : 1452260901.59655,
   "concurrency" : {
      "ancestor" : {
         "allowed" : {
            "mac" : 100,
            "real_device" : 30,
            "manual" : 100,
            "overall" : 100
         },
         "username" : "ANCESTOR_USERNAME",
         "current" : {
            "overall" : 0,
            "mac" : 0,
            "manual" : 0
         }
      },
      "self" : {
         "current" : {
            "manual" : 0,
            "mac" : 0,
            "overall" : 0
         },
         "username" : "YOUR_USERNAME",
         "allowed" : {
            "mac" : 100,
            "real_device" : 30,
            "manual" : 100,
            "overall" : 100
         }
      }
   }
}

Get User Activity

Cached: 5s

 

Get currently running job counts broken down by account and job status. Results are grouped by the job status for the requesting user and for its subaccounts. The response also includes a "totals" field that summarizes all the results.

GET /rest/v1/USERNAME/activity
curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/USERNAME/activity
Example JSON response
{
   "totals" : {
      "in progress" : 30,
      "queued" : 15,
      "all" : 45
   },
   "subaccounts" : {
      "YOUR_USERNAME" : {
         "queued" : 10,
         "in progress" : 20,
         "all" : 30
      },
      "CHILD_USERNAME" : {
         "all" : 15,
         "in progress" : 10,
         "queued" : 5
      }
   }
}

Get User Account Usage

Access historical account usage data. Returns the total number of jobs and VM time used, in seconds grouped by day.

GET /rest/v1/users/USERNAME/usage 

Parameters

start

optional

string

Usage for dates not smaller then specified.

Date in YYYY-MM-DD format.

end

optional

string

Usage for dates not greater then specified.

Date in YYYY-MM-DD format.

curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/users/USERNAME/usage
Example JSON response
{
   "usage" : [
      ["2015-3-20", [5, 467]],
      ["2015-3-1", [7, 114]]
   ],
   "username" : "USERNAME"
}

Get User Jobs Activity

Access user jobs activity data.

Returns the total number of jobs, mean concurrency, max concurrency and VM time used in seconds grouped by day.

GET /rest/v1/users/USERNAME/activity?level=user

Parameters

since

optional

string

Usage for dates not smaller then specified.

Date in timestamp format.

until

optional

string

Usage for dates not greater then specified.

Date in timestamp format.

format

optional

string

Response format, can by json (default) or csv.

curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/users/USERNAME/activity?level=user&since=1425931203&until=1426104003
Example JSON response
{
    "ccy_exec_mean": [0, 4, 3],
    "ccy_exec_peak": [0, 20, 20],
    "datestamp": ["2015-03-09", "2015-03-10", "2015-03-11"],
    "jobs": [0, 100, 70],
    "minutes": [0, 245, 123]
}

Get Team Jobs Activity (Extended Team Management)

Access team jobs activity data. This endpoint will work only if you are organization admin and you are using Extended Team Management. 

Returns the total number of jobs, mean concurrency, max concurrency and VM time used in seconds grouped by day.

GET /rest/v1/activity/teams 

Parameters

id

required

UUID

Team ID. More than one ID can be specified

since

optional

string

Usage for dates not smaller then specified.

Date in timestamp format.

until

optional

string

Usage for dates not greater then specified.

Date in timestamp format.

format

optional

string

Response format, can by json (default) or csv.

curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/activity/teams?id=d6a7ecef-366b-413a-96e2-231f770c9a27&id=142fcaf6-e7f2-44fd-9091-b677708275bf&since=1425931203&until=1426104003
Example JSON response
{
    "142fcaf6e7f244fd9091b677708275bf": {
		"ccy_exec_mean": [0, 4, 3],
    	"ccy_exec_peak": [0, 20, 20],
    	"datestamp": ["2015-03-09", "2015-03-10", "2015-03-11"],
    	"jobs": [0, 100, 70],
    	"minutes": [0, 245, 123]
	},
	"d6a7ecef366b413a96e2231f770c9a27": {
		"ccy_exec_mean": [0, 4, 3],
    	"ccy_exec_peak": [0, 20, 20],
    	"datestamp": ["2015-03-09", "2015-03-10", "2015-03-11"],
    	"jobs": [0, 100, 70],
    	"minutes": [0, 245, 123]
	}
}

Get Organization Jobs Activity (Extended Team Management)

Access organization jobs activity data. This endpoint will work only if you are organization admin and you are using Extended Team Management. 

Returns the total number of jobs, mean concurrency, max concurrency and VM time used in seconds grouped by day.

GET /rest/v1/activity/organization

Parameters

since

optional

string

Usage for dates not smaller then specified.

Date in timestamp format.

until

optional

string

Usage for dates not greater then specified.

Date in timestamp format.

format

optional

string

Response format, can by json (default) or csv.

curl -u USERNAME:API_KEY https://saucelabs.com/rest/v1/activity/organization?since=1425931203&until=1426104003
Example JSON response
{
    "ccy_exec_mean": [0, 4, 3],
    "ccy_exec_peak": [0, 20, 20],
    "datestamp": ["2015-03-09", "2015-03-10", "2015-03-11"],
    "jobs": [0, 100, 70],
    "minutes": [0, 245, 123]
}