Skip to end of metadata
Go to start of metadata


The Sauce Labs REST API is accessed over HTTPS, with standard HTTP methods and authentication, and using JSON encoding for request and response data.

The API is versioned by URL. The current version is v1, and resides under the saucelabs.com/rest/v1/base URL. Some v1.1 methods have been introduced under saucelabs.com/rest/v1.1/.

IP Ranges and Data Center Endpoints
Sauce Labs has data centers in both the US and EU. You can access Sauce Labs services from either location by providing the appropriate URL endpoints, and whitelisting their associated IP ranges. 

 Click here to view US Data Center Endpoints

Virtual Device Cloudhttps://ondemand.saucelabs.com/wd/hub

Sauce Connect Proxyhttps://saucelabs.com/rest/v1 (do not need to specify, Sauce Connect Proxy will use this by default)

SSO:

  • https://saucelabs.com/sso/metadata for Signing/Encryption Certificate
  • https://saucelabs.com/sso/acs for Entity AssertionConsumeURL

REST API 

  • Virtual Devices and Desktops: api.us-west-1.saucelabs.com/v1
  • Real Devices: api.us-west-1.saucelabs.com/v1/rdc

IP Ranges:

162.222.72.0/21 (this is equivalent to the range 162.222.72.1 – 162.222.79.254)
66.85.48.0/21 (this is equivalent to the range 66.85.48.0 - 66.85.55.255)

 Click here to view EU Data Center endpoints

For more information, including framework configuration for the European data center, check out Sauce Labs European Data Center Configuration Information.

Virtual Device Cloudhttps://ondemand.eu-central-1.saucelabs.com/wd/hub

Sauce Connect Proxyhttps://eu-central-1.saucelabs.com/rest/v1 (specify with -x argument)

SSO:

  • https://eu-central-1.saucelabs.com/sso/metadata for Signing/Encryption Certificate
  • https://eu-central-1.saucelabs.com/sso/acs for Entity AssertionConsumeURL

REST API: https://eu-central-1.saucelabs.com/rest

IP Range:

185.94.24.0/22 (this is equivalent to the range 185.94.24.0 - 185.94.27.255


Authentication

The Sauce Labs REST API uses HTTP Basic Authentication. To authenticate, either include the Sauce username and access key in the request URL, or add an Authorization header to the request.

Authenticating with the Request URL Example
curl https://YOUR_SAUCE_USERNAME:YOUR_SAUCE_ACCESS_KEY@saucelabs.com/rest/v1/users/YOUR_SAUCE_USERNAME
Authenticating with an Authorization Header Example
curl -u YOUR_SAUCE_USERNAME:YOUR_SAUCE_ACCESS_KEY https://saucelabs.com/rest/v1/users/YOUR_SAUCE_USERNAME

GET, PUT, and POST Requests

All Sauce API methods default to a GET request unless noted otherwise, and all PUT and POST requests must have the content-type header set to application/json.

  • No labels