The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree
Skip to end of metadata
Go to start of metadata

The Sauce Labs REST API is accessed over HTTPS with standard methods and authentication, 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/.

What You'll Need

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. PUT and POST requests must have the content-type header set to application/json.