Account Management API Endpoints
The Accounts API exposes the following endpoints related to individual and team account configuration and monitoring.
Refer to Getting Started for Authentication and Server information.
Team
Lookup Teams
GET /team-management/v1/teams/
ID
value, which may be a required parameter of other API calls related to a specific team.You can filter the results of your query using the name
parameter below.Parameters
id | | QUERY | OPTIONAL | STRING | Comma-separated team IDs. Allows to receive details of multiple teams at once. For example, |
name | | QUERY | OPTIONAL | STRING | Returns the set of teams that begin with the specified name value. For example, |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/teams?name=sauce' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams?name=sauce' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. Team info returned. | |
404 | Not found. |
{
"links": {...},
"count": 1,
"results": [
{
"id": "**************",
"name": "Sauce-Docs",
"settings": {
"virtual_machines": 25,
"real_devices": 0,
"live_only": false
},
"group": {...},
"is_default": false,
"org_uuid": "**************",
"user_count": 1
}
]
}
Get a Specific Team
GET /team-management/v1/teams/{team_id}/
ID
of the team is the only valid unique identifier.Parameters
id | | PATH | REQUIRED | STRING | The unique identifier of the team. You can look up the IDs of teams in your organization using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. Team info returned. | |
404 | Not found. |
{
"id": "80d69d16ebdb4c018cc9d81ea911761a",
"name": "Sauce-Docs",
"org_uuid": {
"id": "**********",
"name": "SLTC",
"created_at": "2020-10-05T16:21:01.513495Z",
"updated_at": "2020-11-09T23:46:47.752572Z",
"total_vm_concurrency": 46,
"settings": {...}
},
"group": {...},
"created_at": "2020-12-30T17:09:12.473388Z",
"updated_at": "2020-12-30T17:09:12.473415Z",
"settings": {
"virtual_machines": 25,
"real_devices": 0,
"live_only": false
},
"description": "Tech Content API Testing",
"is_default": false,
"links": {...}
}
Create a Team
POST /team-management/v1/teams/
Parameters
name | | BODY | REQUIRED | STRING | A name for the new team. |
settings | | BODY | REQUIRED | OBJECT | The settings object specifies the concurrency allocations for the team within the organization. The available attributes are:
The |
description | | BODY | OPTIONAL | STRING | A description to distinguish the team in the organization. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "A-Team",
"settings": {
"virtual_machines": "10"
},
"description": "Docs QA Team"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "A-Team",
"settings": {
"virtual_machines": "10"
},
"description": "Docs QA Team"
}' | json_pp
Responses
201 | Success. Team created. | |
400 | Bad request. |
{
"id": "9d3460738c28491a81d7ea16704a9edd",
"name": "A-Team",
"org_uuid": "5f436681bbfc4d9ca4aef1eba49ea3b7",
"group": {...},
"created_at": "2021-04-02T17:52:42.578095Z",
"updated_at": "2021-04-02T17:52:42.578126Z",
"settings": {
"virtual_machines": 10,
"real_devices": 0,
"live_only": false
},
"description": "Docs QA Team",
"is_default": false
}
Delete a Team
DELETE /team-management/v1/teams/{team_id}/
Parameters
team_id | | PATH | REQUIRED | STRING | The unique identifier of the team. You can look up the IDs of teams in your organization using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request DELETE 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>/' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request DELETE 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>/' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
Responses
204 | Success. No content returned. | |
404 | Not found. |
Update a Team
PUT /team-management/v1/teams/{team_id}/
Parameters
team_id | | PATH | REQUIRED | STRING | The unique identifier of the team. You can look up the IDs of teams in your organization using the Lookup Teams endpoint. |
name | | BODY | REQUIRED | STRING | The name of the team as it will be after the update. Pass the current value to keep the name unchanged. |
settings | | BODY | REQUIRED | OBJECT | The updated concurrency allocations for the team. The available attributes are:
The |
description | | BODY | OPTIONAL | STRING | A description to distinguish the team in the organization. If the previous team definition included a description, omitting the parameter in the update will delete it from the team record. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Doc-Team",
"settings": {
"virtual_machines": "10"
},
"description": "Docs Team"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Doc-Team",
"settings": {
"virtual_machines": "10"
},
"description": "Docs Team"
}' | json_pp
Responses
201 | Success. Team updated. | |
400 | Bad request. | |
404 | Not found. |
{
"id": "b3de7078b79841b59d2e54127269afe3",
"name": "Doc-Team",
"org_uuid": "5f436681bbfc4d9ca4aef1eba49ea3b7",
"group": {...},
"created_at": "2020-10-05T17:13:56.580592Z",
"updated_at": "2021-04-05T13:49:22.107825Z",
"settings": {
"virtual_machines": 10,
"real_devices": 0,
"live_only": true
},
"description": "Docs Team",
"is_default": false
}
Partially Update a Team
PATCH /team-management/v1/teams/{team_id}/
Parameters
team_id | | PATH | REQUIRED | STRING | The unique identifier of the team. You can look up the ID of teams in your organization using the Lookup Teams endpoint. |
name | | BODY | OPTIONAL | STRING | An updated name for the team. |
settings | | BODY | OPTIONAL | OBJECT | The updated concurrency allocations for the team. The available attributes are:
|
description | | BODY | OPTIONAL | STRING | An updated description. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PATCH 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"settings": {
"virtual_machines": "25"
}
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PATCH 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"settings": {
"virtual_machines": "25"
}
}' | json_pp
Responses
200 | Success. Team updated. | |
400 | Bad request. | |
404 | Not found. |
{
"id": "b3de7078b79841b59d2e54127269afe3",
"name": "Doc-Team",
"org_uuid": "5f436681bbfc4d9ca4aef1eba49ea3b7",
"group": {...},
"created_at": "2020-10-05T17:13:56.580592Z",
"updated_at": "2021-04-05T13:49:22.107825Z",
"settings": {
"virtual_machines": 25,
"real_devices": 0,
"live_only": true
},
"description": "Docs Team",
"is_default": false
}
List Team Members
GET /team-management/v1/teams/{team_id}/members/
Parameters
team_id | | PATH | REQUIRED | STRING | Identifies the team for which you are requesting the list of members. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>/members' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>/members' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
Responses
200 | Success. Team info returned. | |
404 | Not found. |
{
"links": {...},
"count": 0,
"results": []
}
Reset Access Keys for Entire Team
POST /team-management/v1/teams/{team_id}/reset-access-key/
Regenerating an access key invalidates the previous value and any tests containing the prior value will fail, so make sure you edit any tests and credential environment variables with the new value.
Parameters
team_id | | PATH | REQUIRED | STRING | Identifies the team for which you are resetting member access keys. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/teams/<team-id>/reset-access-key' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/teams/<team-id>/reset-access-key' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
Responses
200 | Success. All access keys reset. | |
404 | Not found. |
;[]
User
Lookup Users
GET /team-management/v1/users/
ID
value, which may be a required parameter of other API calls related to a specific user.You can narrow the results of your query using any of the following filtering parameters.Parameters
id | | QUERY | OPTIONAL | STRING | Comma-separated user IDs. Allows to receive details of multiple user at once. For example, |
username | | QUERY | OPTIONAL | STRING | Limits the results to usernames that begin with the specified value. For example, |
teams | | QUERY | OPTIONAL | STRING | Limit results to users who belong to the specified team_ids. Specify multiple teams as comma-separated values. |
roles | | QUERY | OPTIONAL | INTEGER | Limit results to users who are assigned certain roles. Valid values are:
Specify multiple roles as comma-separated values. |
phrase | | QUERY | OPTIONAL | STRING | Limit results to users whose first name, last name, or email address begins with the specified value. |
status | | QUERY | OPTIONAL | STRING | Limit results to users of the specifid status. Valid values are:
|
limit | | QUERY | OPTIONAL | INTEGER MAX=100 | Limit results to a maximum number per page. Default value is |
offset | | QUERY | OPTIONAL | INTEGER | The starting record number from which to return results. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/users?roles=3&limit=30' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/users?roles=3&limit=30' \
--header 'Content-Type: application/json' \
--data-raw '' | json_pp
Responses
200 | Success. Team info returned. | |
404 | Not found. |
{
"links": {...},
"count": 1,
"results": [
{
"id": "80d69d16ebdb4c018cc9d81ea911761a",
"name": "Sauce-Docs",
"settings": {...},
"group": {...},
"is_default": false,
"org_uuid": "******************",
"user_count": 1
}
]
}
Get a Specific User
GET /team-management/v1/users/{user_id}/
ID
of the user is the only valid unique identifier.Parameters
user_id | | PATH | REQUIRED | STRING | The user's unique identifier. You can look up the IDs of users in your organization using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. Team info returned. | |
404 | Not found. |
{
"id": "e5be7513ba224f6f9463c209cb4c5d83",
"username": "jim.smith",
"email": "jsmith@saucelabs.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2020-10-05T16:21:06.021260Z",
"updated_at": "2020-12-30T17:28:35.969274Z",
"teams": [...],
"roles": [...],
"is_staff": true,
"is_superuser": false,
"user_type": "admin",
"groups": [],
"organization": {...},
"is_organization_admin": true,
"is_team_admin": false
}
Create a New User
POST /team-management/v1/users/
Parameters
first_name | | BODY | REQUIRED | STRING | The new user's first name. |
last_name | | BODY | REQUIRED | STRING | The new user's last name. |
email | | BODY | REQUIRED | STRING | The user's contact email address. |
username | | BODY | REQUIRED | STRING | A login username for the new user. |
password | | BODY | REQUIRED | STRING | A login password for the new user. The password requirements are:
|
organization | | BODY | REQUIRED | STRING | The identifier of the organization to create the user's account. You can look up organization IDs by calling the |
role | | BODY | REQUIRED | INTEGER | Tnew user's permission role. Valid values are:
|
team | | BODY | OPTIONAL | STRING | The identifier of the team of which the new user is a member. You can look up team IDs using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "John",
"last_name": "Smith",
"email": "jsmith@icloud.com",
"username": "jsmith",
"password": "$m1th*RULES",
"role": 4,
"team": "<team-id>"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "John",
"last_name": "Smith",
"email": "jsmith@icloud.com",
"username": "jsmith",
"password": "$m1th*RULES",
"role": 4,
"team": "<team-id>"
}' | json_pp
Responses
201 | Success. User created. | |
401 | Unauthorized. | |
400 | Bad input. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-06T16:35:02.713149Z",
"teams": [
{
"id": "b3de7078b79841b59d2e54127269afe3",
"name": "Doc-Team",
"settings": {
"virtual_machines": 100,
"real_devices": 0,
"live_only": true
},
"group": {...},
"is_default": false,
"org_uuid": "bed0a8a559404117b3d10d3bfff4c8ab"
}
],
"roles": [
{
"name": "team admin",
"role": 4
}
],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...},
"is_organization_admin": false,
"is_team_admin": true
}
Update a User
PUT /team-management/v1/users/{user_id}
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
first_name | | BODY | REQUIRED | STRING | The user's first name. |
last_name | | BODY | REQUIRED | STRING | The user's last name. |
email | | BODY | REQUIRED | STRING | The user's contact email address. |
password | | BODY | REQUIRED | STRING | A login password for the new user. The password requirements are:
|
verify_password | | BODY | REQUIRED | STRING | A confirmation of the password. This value must match the |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "Hannibal",
"last_name": "Smith",
"email": "jsmith@icloud.com",
"password": "$m1th*RULEStheworld",
"verify_password": "$m1th*RULEStheworld"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "Hannibal",
"last_name": "Smith",
"email": "jsmith@icloud.com",
"password": "$m1th*RULEStheworld",
"verify_password": "$m1th*RULEStheworld"
}' | json_pp
Responses
200 | Success. User updated. | |
401 | Unauthorized. | |
400 | Bad request. | |
404 | Not found. |
{
"status_code": 400,
"non_field_errors": [
"Passwords need to match"
]
}
Partially Update a User
PATCH /team-management/v1/users/{user_id}
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user to update. You can look up a user's ID using the Lookup Users endpoint. |
first_name | | BODY | OPTIONAL | STRING | The user's first name. |
last_name | | BODY | OPTIONAL | STRING | The user's last name. |
email | | BODY | OPTIONAL | STRING | The user's contact email address. |
password | | BODY | OPTIONAL | STRING | A login password for the new user. The password requirements are:
|
verify_password | | BODY | OPTIONAL | STRING | A confirmation of the password. If the |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PATCH 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "Jimmy"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "Jimmy"
}' | json_pp
Responses
200 | Success. User updated. | |
401 | Unauthorized. | |
400 | Bad request. | |
404 | Not found. |
{
"id": "e5be7513ba224f6f9463c209cb4c5d83",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jimmy",
"last_name": "Smith",
"is_active": true,
"created_at": "2020-10-05T16:21:06.021260Z",
"updated_at": "2021-04-09T14:22:43.884794Z",
"teams": [...],
"roles": [...],
"organization": {...}
},
"is_organization_admin": true,
"is_team_admin": false
}
Get User Concurrency
GET /rest/v1.2/users/{username}/concurrency
At this time, the current usage for real devices is not accurately returned in the response. As a workaround, use the following endpoint:
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location --request GET 'https://api.us-west-1.saucelabs.com/v1/rdc/concurrency' --header 'Content-Type: application/json' | json_pp
Parameters
username | | PATH | REQUIRED | STRING | The username of the user whose concurrency you are looking up. You can look up a user's name using a variety of filtering parameters with the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/rest/v1.2/users/<username>/concurrency' \
--header 'Content-Type: application/json' \ | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/rest/v1.2/users/<username>/concurrency' \
--header 'Content-Type: application/json' \ | json_pp
Responses
200 | Success. User updated. | |
401 | Unauthorized. | |
400 | Bad request. | |
404 | Not found. |
Response Details
concurrency.organization.allowed | The total allowed concurrency for each device type allocated to the organization. |
concurrency.organization.current | The total concurrency for each device type currently in use by the organization. |
concurrency.team.allowed | The total concurrency for each device type allocated to the logged-in user's team. |
concurrency.team.current | The total concurrency for each device type currently in use by the user's team. |
*.{device_type} | Each set of concurrency reported in the response is broken down by the following device types:
Note that |
{
"concurrency" : {
"organization" : {
"allowed" : {
"mac_vms" : 1000,
"rds" : 20,
"vms" : 1000
},
"current" : {
"mac_vms" : 0,
"rds" : 0,
"vms" : 0
},
"id" : "7fb25570b4064716b9b6daae1a846790"
},
"team" : {
"allowed" : {
"mac_vms" : 1000,
"rds" : 20,
"vms" : 100
},
"current" : {
"mac_vms" : 0,
"rds" : 0,
"vms" : 0
},
"id" : "98b9f34e596047d99abba56f517846a9"
}
},
"timestamp" : 1631125800.61984
}
Get a User's Team
GET /team-management/v1/users/{user_id}/teams/
At this time, users may only belong to a maximum of one team.
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"links": {...},
"count": 1,
"results": [
{
"id": "************",
"name": "Sauce-Docs",
"settings": {
"virtual_machines": 25,
"real_devices": 0,
"live_only": false
},
"group": {},
"is_default": false,
"org_uuid": "************"
}
]
}
Change User's Team Assignment
PUT /team-management/v1/users/{user_id}/teams/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the Sauce Labs user. You can look up the ID of a user in your organization using the Lookup Users endpoint. |
teams | | BODY | REQUIRED | ARRAY OF STRINGS | List of unique team identifiers. You can look up the ID of teams in your organization using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
--header 'Content-Type: application/json' \
--data-raw '{"teams": ["<team1-id>", "<team2-id>"]}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PUT 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
--header 'Content-Type: application/json' \
--data-raw '{"teams": ["<team1-id>", "<team2-id>"]}' | json_pp
Responses
204 | Success. The list of assigned teams has been properly updated. | |
400 | Bad Request. | |
403 | Requester is not authorized to perform this action. | |
404 | Not found. |
Subscribe a User to a Team
POST /team-management/v1/membership/
DEPRECATED
Set a user's team affiliation. Users are limited to one team affiliation, so if the user is already a member of a different team, this call will remove them from that team. Also, By default, the user will not have team-admin privileges, even if they did on a prior team.
Parameters
user | | PATH | REQUIRED | STRING | The unique identifier of the Sauce Labs user to be added to the team.You can look up the ID of a user in your organization using the Lookup Users endpoint. |
team | | PATH | REQUIRED | STRING | The identifier of the team to which the user will be added. You can look up the ID of a team in your organization using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/membership/' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": "<user-id>",
"team": "<team-id>"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/membership/' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": "<user-id>",
"team": "<team-id>"
}' | json_pp
Responses
201 | Success. User assigned Org Admin role. | |
400 | Bad Request. | |
404 | Not found. |
{
"id": 28099,
"user": {
"id": "e5be7513ba224f6f9463c209cb4c5d83",
"username": "nancy.sweeney",
"email": "nancy.sweeney@saucelabs.com",
"first_name": "Casey",
"last_name": "Sweeney",
"is_active": true,
"created_at": "2020-10-05T16:21:06.021260Z",
"updated_at": "2021-04-09T14:22:43.884794Z",
"teams": [
{
"id": "80d69d16ebdb4c018cc9d81ea911761a",
"name": "Sauce-Docs",
"settings": {
"virtual_machines": 25,
"real_devices": 0,
"live_only": false
},
"group": {},
"is_default": false,
"org_uuid": "***********"
}
],
"roles": [...],
"is_staff": true,
"is_superuser": false,
"user_type": "admin",
"groups": [],
"organization": {...},
"team": {
"id": "80d69d16ebdb4c018cc9d81ea911761a",
"name": "Sauce-Docs",
"organization": {...},
"group": {...},
"created_at": "2020-12-30T17:09:12.473388Z",
"updated_at": "2020-12-30T17:09:12.473415Z",
"settings": {...},
"description": "Tech Content API Testing",
"is_default": false,
"links": {}
}
},
"created_at": "2020-12-30T17:21:52.344918Z",
"updated_at": "2020-12-30T17:21:52.344961Z"
}
Assign a User Org Admin Rights
POST /team-management/v1/users/{user_id}/set-admin/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/set-admin/' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/set-admin/' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-09T15:37:20.278491Z",
"teams": [...],
"roles": [
{
"name": "organization admin",
"role": 1
}
],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...},
"is_organization_admin": true,
"is_team_admin": false
}
Assign a User Team Admin Rights
POST /team-management/v1/users/{user_id}/set-team-admin/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/set-team-admin/' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/set-team-admin/' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-09T15:37:20.278491Z",
"teams": [...],
"roles": [
{
"name": "team admin",
"role": 4
}
],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...},
"is_organization_admin": false,
"is_team_admin": true
}
Remove Admin Rights from User
POST /team-management/v1/users/{user_id}/set-member/
member
role to the user. If the user is currently assigned any Admin rights, this call removes those rights.Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/set-team-admin/' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/set-team-admin/' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-09T15:37:20.278491Z",
"teams": [...],
"roles": [
{
"name": "member",
"role": 3
}
],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...},
"is_organization_admin": false,
"is_team_admin": false
}
Get a User's Access Key
GET /team-management/v1/users/{user_id}/access-key/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/access-key' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/access-key' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"access_key": "********-****-****-****-************"
}
Reset a User's Access Key
POST /team-management/v1/users/{user_id}/reset-access-key/
Regenerating an access key invalidates the previous value and any tests containing the prior value will fail, so make sure you update any tests and credential environment variables with the new value.
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/reset-access-key' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/reset-access-key' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"access_key": "********-****-****-****-************"
}
Deactivate a User
POST /team-management/v1/users/{user_id}/deactivate/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/deactivate' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/deactivate' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
403 | Forbidden. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": false,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-12T16:37:31.370711Z",
"teams": [...],
"roles": [...],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...}
},
"is_organization_admin": false,
"is_team_admin": false
}
Activate a User
POST /team-management/v1/users/{user_id}/activate/
Parameters
user_id | | PATH | REQUIRED | STRING | The unique identifier of the user. You can look up a user's ID using the Lookup Users endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/activate' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/activate' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
403 | Forbidden. | |
404 | Not found. |
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"email": "jsmith@icloud.com.com",
"first_name": "Jim",
"last_name": "Smith",
"is_active": true,
"created_at": "2021-04-06T16:35:02.047237Z",
"updated_at": "2021-04-12T16:37:31.370711Z",
"teams": [...],
"roles": [...],
"is_staff": false,
"is_superuser": false,
"user_type": "subaccount",
"groups": [...],
"organization": {...}
},
"is_organization_admin": false,
"is_team_admin": false
}
Get your active team
GET /team-management/v1/users/me/active-team/
Parameters
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/users/me/active-team/' \
--header 'Content-Type: application/json' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/me/active-team/' \
--header 'Content-Type: application/json' | json_pp
Responses
200 | Success. | |
403 | Forbidden. | |
404 | Not found. |
{
"id": "d13cc39b78da4015aa3ca67b234ecb0b",
"name": "Team A",
}
Service account
Lookup Service Accounts
GET /team-management/v1/service-accounts/
Parameters
id | | QUERY | OPTIONAL | STRING | Comma-separated service account IDs. |
username | | QUERY | OPTIONAL | STRING | Substring username search phrase. |
teams | | QUERY | OPTIONAL | STRING | Comma-separated team IDs. |
limit | | QUERY | OPTIONAL | INTEGER | Number of results to return per page. |
offset | | QUERY | OPTIONAL | INTEGER | The initial index from which to return the results. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/?limit=100&offset=0' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/?id=7ddb81628f5f4e77b5f74d9dec4980db,8ec1b3d47a5e4f25a7b6c8e9f0123456&username=bot-automation&teams=bd8466c7c94f4f2a8641a1fd4ac1a89d,c7a2b3d4e5f67890abcdef1234567890&limit=10&offset=0' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/?limit=100&offset=0' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/?id=7ddb81628f5f4e77b5f74d9dec4980db,8ec1b3d47a5e4f25a7b6c8e9f0123456&username=bot-automation&teams=bd8466c7c94f4f2a8641a1fd4ac1a89d,c7a2b3d4e5f67890abcdef1234567890&limit=10&offset=0' | json_pp
Responses
200 | Success. Service account list returned. | |
403 | Forbidden. You do not have permission to look up service accounts. |
{
"count": 2,
"links": {
"first": "https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/?limit=10&offset=0",
"last": "https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/?limit=10&offset=0",
"next": null,
"previous": null
},
"results": [
{
"id": "7ddb81628f5f4e77b5f74d9dec4980db",
"username": "bot-automation-service-account-d2164",
"name": "Automation Service Account",
"team": {
"id": "bd8466c7c94f4f2a8641a1fd4ac1a89d",
"name": "QA Automation Team"
},
"creator": {
"id": "504e6c7223fd4159815a08c38f677701",
"username": "john.doe",
"email": "john.doe@example.com"
}
},
{
"id": "8ec1b3d47a5e4f25a7b6c8e9f0123456",
"username": "bot-automation-service-account-565ad",
"name": "Staging Automation Account",
"team": {
"id": "c7a2b3d4e5f67890abcdef1234567890",
"name": "Staging Team"
},
"creator": {
"id": "e1f2g3h4i5j6k7l8m9n0o1p2q3r4s5t6",
"username": "jane.doe",
"email": "jane.doe@example.com"
}
}
]
}
Get a Specific Service Account
GET /team-management/v1/service-accounts/{uuid}/
Parameters
uuid | | PATH | REQUIRED | STRING | The unique identifier of the service account. You can find the |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/<uuid>' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/<uuid>' | json_pp
Responses
200 | Success. Service account details returned. | |
403 | Forbidden. You do not have permission to access this resource. | |
404 | Not found. The specified service account does not exist. |
{
"id": "7ddb81628f5f4e77b5f74d9dec4980db",
"username": "bot-automation-service-account-d2164",
"name": "Automation Service Account",
"created_at": "2024-10-24T14:45:43.606414Z",
"updated_at": "2025-01-23T15:57:32.520638Z",
"last_activity_time": "2025-02-15T11:22:10.123456Z",
"creator": {
"id": "504e6c7223fd4159815a08c38f677701",
"username": "john.doe",
"email": "john.doe@example.com"
},
"team": {
"id": "bd8466c7c94f4f2a8641a1fd4ac1a89d",
"name": "QA Automation Team"
}
}
Create a Service Account
POST /team-management/v1/service-accounts/
Parameters
name | | BODY | REQUIRED | STRING | A user-friendly display name for the service account. The name must be between 1 and 128 characters and may include:
|
team_uuid | | BODY | REQUIRED | STRING | The unique identifier of the team to which the service account will be assigned. You can look up team IDs using the Lookup Teams endpoint. |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Team A bot",
"team_uuid": "bd8466c7c94f4f2a8641a1fd4ac1a89d"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Team A bot",
"team_uuid": "bd8466c7c94f4f2a8641a1fd4ac1a89d"
}' | json_pp
Responses
201 | Success. Service account created successfully. | |
403 | Forbidden. You do not have permission to create a service account. |
{
"id": "7ddb81628f5f4e77b5f74d9dec4980db",
"access_key": "8e27aba8-be73-4ef3-9c2b-20f796b5ebff",
"username": "bot-automation-service-account-d2164"
}
Update a Service Account
PATCH /team-management/v1/service-accounts/{uuid}/
Parameters
uuid | | PATH | REQUIRED | STRING | The unique identifier of the service account. You can find the |
name | | BODY | REQUIRED | STRING | A user-friendly display name for the service account. The name must be between 1 and 128 characters and may include:
|
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PATCH 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/<uuid>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Bot Foo Bar"
}' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request PATCH 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/<uuid>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Bot Foo Bar"
}' | json_pp
Responses
200 | Success. Service account updated successfully. | |
403 | Forbidden. You do not have permission to update this service account. | |
404 | Not found. The specified service account does not exist. |
{
"id": "7ddb81628f5f4e77b5f74d9dec4980db",
"username": "bot-automation-service-account-d2164",
"name": "Bot Foo Bar",
}
Delete a Service Account
DELETE /team-management/v1/service-accounts/{uuid}/
Parameters
uuid | | PATH | REQUIRED | STRING | The unique identifier of the service account. You can find the |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request DELETE 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/<uuid>'
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request DELETE 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/<uuid>'
Responses
204 | Success. Service account deleted successfully. No content returned. | |
403 | Forbidden. You do not have permission to delete this service account. | |
404 | Not found. The specified service account does not exist. |
Reset Service Account Access Key
POST /team-management/v1/service-accounts/{uuid}/reset-access-key/
Regenerating an access key invalidates the previous key. Any tests or configurations using the previous key will fail, so make sure to update all tests and credential environment variables with the new key.
Parameters
uuid | | PATH | REQUIRED | STRING | The unique identifier of the service account. You can find the |
- United States
- Europe
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/<uuid>/reset-access-key/' | json_pp
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.eu-central-1.saucelabs.com/team-management/v1/service-accounts/<uuid>/reset-access-key/' | json_pp
Responses
200 | Success. Service account access key was rotated. | |
403 | Forbidden. You do not have permission to reset the access key for this service account. | |
404 | Not found. The specified service account does not exist. |
{
"access_key": "3f78c473-3396-432d-b6d1-48e2dd7c57b1"
}